PHY 175 · Modern Physics and Electronics

Communication Systems,
Memory Devices & IoT Applications

Unit V
Course Code   PHY175
Credits   3 – 0 – 0 – 3
Weightage   ATT 5 · CA 25 · MTT 20 · ETT 50

Course Outcome CO1, CO2 & CO6

Understand modern communication technologies (optical fiber, wireless), semiconductor memory devices (RAM, ROM, Flash, SSD), renewable energy applications, and demonstrate advanced Arduino-based IoT systems for real-world monitoring and automation.

Table of Contents

ICommunication Systems Overview3
IIOptical Fiber Communication4
IIIOptical Fiber Types & Losses6
IVWireless Communication Technologies8
V5G & Emerging Wireless Trends10
VISemiconductor Memory — Overview12
VIIRAM — SRAM & DRAM14
VIIIROM — PROM, EPROM, EEPROM16
IXFlash Memory & SSDs18
XMemory Hierarchy & Comparison20
XIRenewable Energy & Semiconductor Materials21
XIIAdvanced IoT Monitoring System Design23
XIIIArduino-Based Smart Home Automation25
XIVTemperature & Environmental Monitoring27
Summary & Formula Sheet29
Exam Tips & Practice Questions30
Solutions32
References & CO Mapping34
How to use these notes: Each section contains theory, key formulas, comparison tables, Arduino code examples, and exam-focused tips. The summary sheet at the end is designed for quick revision before exams.

I. Communication Systems Overview

1.1 What is a Communication System?

A communication system is a collection of components that transfers information from a source (transmitter) to a destination (receiver) through a medium (channel). The information can be in the form of voice, data, or video.

1.2 Block Diagram of a Communication System

┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ Source │──→│Transmitter│──→│ Channel │──→│ Receiver │──→│ Desti- │ │(Message) │ │ (Encoder │ │ (Medium) │ │(Decoder │ │ nation │ │ │ │ + Mod) │ │ │ │ + Demod)│ │ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ↑ Noise

1.3 Key Components

ComponentFunction
SourceGenerates the message (voice, data, video)
TransmitterConverts message to a suitable form for transmission (modulation)
ChannelMedium through which signal travels (wire, fiber, air)
ReceiverRecovers the original message (demodulation)
DestinationFinal recipient of the message
NoiseUnwanted signal that interferes with transmission

1.4 Types of Communication Systems

TypeMediumExamples
WirelinePhysical cablesTwisted pair, coaxial, optical fiber
WirelessElectromagnetic wavesRadio, microwave, satellite, Wi-Fi, 5G

1.5 Modulation

Modulation is the process of varying a carrier signal's properties (amplitude, frequency, or phase) in accordance with the message signal.

Modulation TypeVarying ParameterApplication
AM (Amplitude Modulation)AmplitudeAM radio
FM (Frequency Modulation)FrequencyFM radio
PM (Phase Modulation)PhaseDigital data
ASK (Amplitude Shift Keying)AmplitudeOptical fiber, RFID
FSK (Frequency Shift Keying)FrequencyBluetooth, modems
PSK (Phase Shift Keying)PhaseWi-Fi, 5G

1.6 Bandwidth

Bandwidth is the range of frequencies a communication channel can carry. It determines the data rate and quality of transmission.

\[ \text{Bandwidth} = f_{max} - f_{min} \]

II. Optical Fiber Communication

2.1 What is Optical Fiber?

An optical fiber is a thin strand of glass or plastic that guides light along its length. It works on the principle of total internal reflection (TIR).

2.2 Structure of Optical Fiber

┌───────────────────────────────────────┐ │ Outer Jacket (Plastic) │ │ ┌───────────────────────────────┐ │ │ │ Cladding (n₂) │ │ │ │ ┌───────────────────────┐ │ │ │ │ │ Core (n₁) │ │ │ │ │ │ (light propagates) │ │ │ │ │ └───────────────────────┘ │ │ │ └───────────────────────────────┘ │ └───────────────────────────────────────┘ Core: 8–62.5 µm Cladding: 125 µm Jacket: 250 µm n₁ > n₂ (essential for TIR)

2.3 Principle — Total Internal Reflection

When light travels from a denser medium (core, \( n_1 \)) to a rarer medium (cladding, \( n_2 \)) at an angle greater than the critical angle, it is completely reflected back into the core.

\[ \text{Critical angle:} \quad \theta_c = \sin^{-1}\left(\frac{n_2}{n_1}\right) \]

2.4 Acceptance Angle and Numerical Aperture

The acceptance angle is the maximum angle at which light can enter the fiber and still be guided. The numerical aperture (NA) is a measure of the fiber's light-gathering ability.

\[ \text{NA} = \sin\theta_{max} = \sqrt{n_1^2 - n_2^2} \]

2.5 Advantages of Optical Fiber

AdvantageDescription
Enormous bandwidthTHz range → very high data rates
Low attenuation< 0.2 dB/km → long distance without repeaters
Immune to EMINo electromagnetic interference
SecureDifficult to tap — no radiation
Light weightSmall size, lightweight cables
No cross-talkSignals in adjacent fibers don't interfere

2.6 Disadvantages

III. Optical Fiber Types & Losses

3.1 Types of Optical Fiber

Single-Mode Fiber (SMF)

Core diameter ≈ 8–10 µm. Only one path (mode) for light. Used for long-distance, high-bandwidth communication.

Multi-Mode Fiber (MMF)

Core diameter ≈ 50–62.5 µm. Multiple light paths. Used for short-distance communication.

Step-Index vs Graded-Index

TypeRefractive Index ProfileDispersion
Step-IndexSharp change at core-cladding boundaryHigh
Graded-IndexGradual change in coreLow

3.2 Fiber Comparison

Feature Single-Mode Multi-Mode
Core diameter8–10 µm50–62.5 µm
Number of modes1Many
BandwidthVery highModerate
DistanceLong (km)Short (m–km)
CostHigherLower
Light sourceLaserLED

3.3 Losses in Optical Fiber

Attenuation

\[ \alpha = \frac{10}{L} \log_{10}\left(\frac{P_{in}}{P_{out}}\right) \quad \text{(dB/km)} \]

Types of Attenuation

Loss TypeCause
AbsorptionMaterial absorbs light (UV/IR absorption)
ScatteringRayleigh scattering (density fluctuations)
Bending lossMacrobend (visible bend) or microbend (small deformations)
Fresnel lossReflection at fiber ends

3.4 Dispersion

Dispersion is the spreading of light pulses as they travel along the fiber, limiting bandwidth.

TypeCause
Modal dispersionDifferent modes travel different path lengths
Chromatic dispersionDifferent wavelengths travel at different speeds
Polarization mode dispersionDifferent polarization states travel at different speeds

3.5 Applications

IV. Wireless Communication Technologies

4.1 What is Wireless Communication?

Wireless communication transfers information between two or more points without physical connection (wires or cables), using electromagnetic waves through air or vacuum.

4.2 Electromagnetic Spectrum

Band Frequency Wavelength Applications
Radio3 kHz – 300 MHz1 m – 100 kmAM/FM radio, TV
Microwave300 MHz – 300 GHz1 mm – 1 mWi-Fi, radar, satellite
Infrared300 GHz – 400 THz750 nm – 1 mmRemote controls, IR sensors
Visible light400 – 790 THz380 – 750 nmLi-Fi, optical fiber

4.3 Wireless Technologies Comparison

Technology Range Data Rate Frequency Application
Bluetooth10 m1–3 Mbps2.4 GHzHeadphones, wearables
Wi-Fi100 m100 Mbps – 10 Gbps2.4/5/6 GHzInternet, LAN
Zigbee10–100 m250 kbps2.4 GHzIoT, smart home
LoRa10 km0.3–50 kbpsSub-GHzIoT, agriculture
NFC10 cm424 kbps13.56 MHzPayments, access
4G LTE10 km100 Mbps0.7–2.6 GHzMobile internet
5G1 km10 Gbps0.6–39 GHzMobile, IoT, AR/VR

4.4 Cellular Network Generations

Generation Year Technology Data Rate
1G1980sAnalog2.4 kbps
2G1990sGSM, CDMA64 kbps
3G2000sUMTS, WCDMA2 Mbps
4G2010sLTE, WiMAX100 Mbps – 1 Gbps
5G2020sNR, mmWave1–20 Gbps

4.5 Antenna Basics

An antenna converts electrical signals into electromagnetic waves (transmission) and vice versa (reception). Key parameters:

V. 5G & Emerging Wireless Trends

5.1 What is 5G?

5G is the fifth generation of cellular network technology. It offers significantly higher data rates, lower latency, and greater device density than 4G.

5.2 5G Key Features

FeatureSpecification
Peak data rate20 Gbps (downlink), 10 Gbps (uplink)
Latency1 ms (vs 10 ms in 4G)
Connection density1 million devices/km²
MobilityUp to 500 km/h
Frequency bandsSub-6 GHz (FR1) and mmWave (FR2, 24–100 GHz)

5.3 5G Use Cases

CategoryDescriptionExamples
eMBBEnhanced Mobile Broadband4K/8K video, AR/VR
URLLCUltra-Reliable Low-Latency Comm.Autonomous vehicles, surgery
mMTCMassive Machine-Type Comm.Smart cities, IoT sensors

5.4 Role of Semiconductor Materials in 5G

MaterialRole
GaAs (Gallium Arsenide)Power amplifiers, RF front-end modules
GaN (Gallium Nitride)High-power, high-frequency amplifiers
SiGe (Silicon Germanium)Low-noise amplifiers, transceivers
InP (Indium Phosphide)High-speed photodetectors, lasers
Why GaAs for 5G?

GaAs has a direct band gap and high electron mobility (low effective mass). This allows faster switching, higher frequency operation, and lower power consumption — ideal for 5G smartphone processors.

5.5 Emerging Wireless Technologies

TechnologyFeature
Li-FiUses visible light for data transmission (100× faster than Wi-Fi)
mmWaveMillimeter waves (24–100 GHz) for ultra-high-speed short-range
MIMOMultiple-input multiple-output — uses multiple antennas
BeamformingFocuses signal toward specific users
Network SlicingVirtual networks for different services
Satellite InternetLEO satellites (Starlink) providing global coverage

VI. Semiconductor Memory — Overview

6.1 What is Semiconductor Memory?

Semiconductor memory is an electronic data storage device implemented using semiconductor materials (silicon). It is used in computers, smartphones, and all digital systems.

6.2 Classification of Memory

┌─────────────────┐ │ MEMORY │ └────────┬────────┘ ┌──────────────────┼──────────────────┐ ▼ ▼ ▼ ┌─────────┐ ┌─────────┐ ┌─────────┐ │ RAM │ │ ROM │ │ Hybrid │ │(Volatile)│ │(Non-vol)│ │ (Flash) │ └────┬────┘ └────┬────┘ └────┬────┘ │ │ │ ┌────┴────┐ ┌────┴────┐ ┌────┴────┐ ▼ ▼ ▼ ▼ ▼ ▼ SRAM DRAM PROM EPROM NAND NOR EEPROM Flash Flash

6.3 Volatile vs Non-Volatile Memory

Feature Volatile Memory Non-Volatile Memory
Data retention on power offLostRetained
SpeedVery fastSlower
Cost per bitHigherLower
ExamplesRAM (SRAM, DRAM)ROM, Flash, SSD, HDD
UsageMain memoryStorage

6.4 Memory Terminology

TermDefinition
BitSmallest unit of memory (0 or 1)
Byte8 bits
WordGroup of bits processed together (8, 16, 32, 64)
AddressUnique location identifier
CapacityTotal number of bits/bytes stored
Access TimeTime to read/write data
Cycle TimeMinimum time between successive accesses

6.5 Memory Units

UnitSize
1 KB (Kilobyte)\( 2^{10} = 1024 \) bytes
1 MB (Megabyte)\( 2^{20} \approx 10^6 \) bytes
1 GB (Gigabyte)\( 2^{30} \approx 10^9 \) bytes
1 TB (Terabyte)\( 2^{40} \approx 10^{12} \) bytes
1 PB (Petabyte)\( 2^{50} \approx 10^{15} \) bytes

VII. RAM — SRAM & DRAM

7.1 What is RAM?

RAM (Random Access Memory) is volatile memory that stores data temporarily. Any location can be accessed directly (random access) in the same amount of time. It is the main working memory of a computer.

7.2 SRAM (Static RAM)

SRAM uses flip-flops (typically 6 transistors) to store each bit. It retains data as long as power is supplied — no refresh needed.

SRAM Cell (6T): ┌──── VDD ────┐ │ │ ┌──┴──┐ ┌──┴──┐ │ M2 │ │ M4 │ └──┬──┘ └──┬──┘ │ │ ────┤ Q Q̄ ├──── │ │ ┌──┴──┐ ┌──┴──┐ │ M1 │ │ M3 │ └──┬──┘ └──┬──┘ │ │ └──── GND ────┘
FeatureValue
Cell typeFlip-flop (6 transistors)
RefreshNot required
SpeedVery fast (1–10 ns)
DensityLow
Cost per bitHigh
Power consumptionLow (static)
UsageCache memory (L1, L2, L3)

7.3 DRAM (Dynamic RAM)

DRAM uses a capacitor and one transistor per bit. The capacitor leaks charge, so it must be refreshed periodically (every few milliseconds).

DRAM Cell (1T1C): Word Line (WL) │ ┌───┴───┐ │ M1 │ (Transistor) └───┬───┘ │ ├──── Bit Line (BL) │ ─┴─ C (Capacitor) ─┬─ │ GND
FeatureValue
Cell type1 transistor + 1 capacitor
RefreshRequired every 2–64 ms
SpeedSlower (10–100 ns)
DensityHigh
Cost per bitLow
Power consumptionHigher (dynamic + refresh)
UsageMain memory (RAM modules)

7.4 SRAM vs DRAM Comparison

Feature SRAM DRAM
Storage elementFlip-flop (6T)Capacitor (1T1C)
RefreshNot neededNeeded every few ms
SpeedFasterSlower
DensityLowerHigher
CostHigherLower
PowerLowerHigher
SizeLarger cellSmaller cell
Typical useCacheMain memory

VIII. ROM — PROM, EPROM, EEPROM

8.1 What is ROM?

ROM (Read-Only Memory) is non-volatile memory that retains data even when power is removed. It is used to store firmware and permanent instructions (BIOS, bootloader).

8.2 Types of ROM

Mask ROM (MROM)

Programmed during manufacturing. Cannot be changed. Used for mass-produced devices.

PROM (Programmable ROM)

Can be programmed once by the user using a PROM programmer. Once programmed, cannot be erased.

EPROM (Erasable PROM)

Can be erased by exposing to UV light (through a quartz window) and reprogrammed. Erasure takes ~20–30 minutes.

EEPROM (Electrically Erasable PROM)

Can be erased and reprogrammed electrically, byte by byte. No UV light needed. Used in microcontrollers for configuration data.

8.3 ROM Comparison Table

Type Programmable Erasable Method Usage
Mask ROMAt factoryNoMass production
PROMOnce by userNoSmall batches
EPROMYesYesUV lightDevelopment
EEPROMYesYesElectricalConfig, microcontrollers

8.4 Floating Gate Transistor (EPROM/EEPROM/Flash)

EPROM, EEPROM, and Flash use a floating gate transistor to store charge. The floating gate is isolated by oxide layers, trapping electrons.

Floating Gate Transistor: Control Gate (CG) │ ┌────┴────┐ │ Oxide │ ├─────────┤ │ Floating│ ← Stores charge (electrons) │ Gate │ ├─────────┤ │ Oxide │ ├─────────┤ │ Channel │ └────┬────┘ Source Drain Charged floating gate → transistor OFF (stores 0) Uncharged floating gate → transistor ON (stores 1)

8.5 Applications of ROM

IX. Flash Memory & SSDs

9.1 What is Flash Memory?

Flash memory is a type of EEPROM that allows data to be written and erased in large blocks. It is non-volatile and widely used in USB drives, SSDs, memory cards, and embedded systems.

9.2 NAND vs NOR Flash

Feature NAND Flash NOR Flash
Cell structureSeries connectionParallel connection
AccessPage-based (block erase)Random (byte access)
Read speedFastSlower
Write/Erase speedFastSlow
DensityHighLow
Cost per bitLowHigh
UsageSSDs, USB drives, memory cardsFirmware, BIOS, embedded code

9.3 SSD (Solid State Drive)

An SSD is a storage device that uses NAND flash memory to store data. It has no moving parts, making it faster, quieter, and more durable than traditional HDDs.

9.4 HDD vs SSD vs Flash

Feature HDD SSD Flash (USB)
StorageMagnetic diskNAND flashNAND flash
Moving partsYesNoNo
Speed~100 MB/s500 MB/s – 7 GB/s~100–400 MB/s
Capacity1–20 TB128 GB – 8 TB4–256 GB
DurabilityLowHighMedium
PowerHighLowVery low
Cost/GBLowestModerateLow
NoiseAudibleSilentSilent

9.5 SSD Architecture

┌──────────────────────────────────────────┐ │ SSD Controller │ │ (manages read/write, wear leveling, │ │ error correction, garbage collection) │ └────────┬──────────────────────┬──────────┘ │ │ ┌─────┴─────┐ ┌─────┴─────┐ │ NAND │ │ DRAM │ │ Flash │ │ Cache │ │ Chips │ │ (optional)│ └───────────┘ └───────────┘

9.6 Key SSD Technologies

TechnologyDescription
SLCSingle-Level Cell — 1 bit/cell, fastest, most durable
MLCMulti-Level Cell — 2 bits/cell, balanced
TLCTriple-Level Cell — 3 bits/cell, lower cost
QLCQuad-Level Cell — 4 bits/cell, highest density
3D NANDVertical stacking of memory cells
Wear LevelingDistributes writes evenly across cells
TRIMInforms SSD which blocks are no longer in use

X. Memory Hierarchy & Comparison

10.1 Memory Hierarchy

Computer memory is organized in a hierarchy based on speed, cost, and size. Faster memory is smaller and more expensive; slower memory is larger and cheaper.

┌─────────────────────────────────────────────────┐ │ MEMORY HIERARCHY │ ├─────────────────────────────────────────────────┤ │ │ │ Registers ← Fastest, Smallest, Costly │ │ ↓ │ │ L1 Cache (SRAM) │ │ ↓ │ │ L2 Cache (SRAM) │ │ ↓ │ │ L3 Cache (SRAM) │ │ ↓ │ │ Main Memory (DRAM) │ │ ↓ │ │ SSD / Flash │ │ ↓ │ │ HDD / Tape ← Slowest, Largest, Cheapest │ │ │ └─────────────────────────────────────────────────┘

10.2 Memory Comparison Table

Memory Volatile Speed Cost Capacity Usage
RegistersYesFastestHighestBytesCPU operations
SRAM (Cache)YesVery fastVery highKB–MBCache memory
DRAMYesFastModerateGBMain memory
Flash (SSD)NoModerateLowGB–TBStorage
HDDNoSlowLowestTBBulk storage

10.3 Cache Memory

Cache memory is a small, fast SRAM that stores frequently accessed data to reduce average access time from the CPU.

LevelSpeedSizeLocation
L1Fastest32–256 KBInside CPU core
L2Fast256 KB – 4 MBOn CPU chip
L3Moderate4–64 MBShared across cores

10.4 Memory Technologies Comparison (Full)

Feature SRAM DRAM Flash HDD
VolatileYesYesNoNo
Cell6T1T1CFloating gateMagnetic
RefreshNoYesNoNo
Read speed1–10 ns10–100 ns25 µs–1 ms5–15 ms
Write speed1–10 ns10–100 ns200 µs–2 ms5–15 ms
Endurance10⁴–10⁵ cycles
Cost/bitHighestModerateLowLowest

XI. Renewable Energy & Semiconductor Materials

11.1 Role of Semiconductors in Renewable Energy

Semiconductors are at the heart of renewable energy technologies, especially solar photovoltaics and power electronics for wind and electric vehicles.

11.2 Solar Cell Materials

Material Band Gap (eV) Efficiency Cost Type
Monocrystalline Si1.118–22%HighIndirect
Polycrystalline Si1.115–18%ModerateIndirect
Amorphous Si (a-Si)1.76–10%LowIndirect
CdTe1.4510–15%LowDirect
CIGS1.0–1.215–20%ModerateDirect
GaAs1.4225–30%Very highDirect
Perovskite1.5–2.320–25%LowDirect

11.3 Recent Advances in Semiconductor Materials

MaterialApplicationAdvantage
GaNPower electronics, 5GHigh efficiency, high voltage
SiCEV inverters, solar invertersHigh temperature, high power
PerovskiteNext-gen solar cellsLow cost, high efficiency
2D Materials (MoS₂)Flexible electronicsThin, flexible
Organic SemiconductorsOLEDs, flexible displaysLightweight, flexible

11.4 Power Electronics for Renewable Energy

Why Silicon Dominates Solar

Despite being an indirect band gap material, silicon is abundant, non-toxic, and has a well-established manufacturing infrastructure. Its band gap (1.1 eV) is also near the optimal value for single-junction solar cells.

XII. Advanced IoT Monitoring System Design

12.1 IoT Architecture — 5 Layers

┌─────────────────────────────────────────────────┐ │ Layer 5: Business Layer │ │ (Analytics, Decision Making, User Reports) │ ├─────────────────────────────────────────────────┤ │ Layer 4: Application Layer │ │ (Mobile Apps, Web Dashboards, APIs) │ ├─────────────────────────────────────────────────┤ │ Layer 3: Processing Layer │ │ (Cloud, Edge Computing, Data Processing) │ ├─────────────────────────────────────────────────┤ │ Layer 2: Network Layer │ │ (Wi-Fi, Bluetooth, LoRa, 5G, Ethernet) │ ├─────────────────────────────────────────────────┤ │ Layer 1: Perception Layer │ │ (Sensors: DHT, LDR, PIR, Ultrasonic) │ └─────────────────────────────────────────────────┘

12.2 Complete IoT System Components

ComponentExampleFunction
Sensor NodeArduino + DHT11Collect data
GatewayESP8266 / ESP32Wi-Fi connectivity
Cloud PlatformThingSpeak, BlynkData storage & visualization
User ApplicationMobile app, WebMonitoring & control
ActuatorRelay, MotorControl action

12.3 Example: IoT-Based Weather Station

#include <DHT.h>
#include <ESP8266WiFi.h>
#include <ThingSpeak.h>

#define DHTPIN 2
#define DHTTYPE DHT22
#define LDR_PIN A0

DHT dht(DHTPIN, DHTTYPE);
WiFiClient client;

unsigned long myChannelNumber = 123456;
const char * myWriteAPIKey = "YOUR_API_KEY";

const char* ssid = "YourWiFi";
const char* password = "YourPassword";

void setup() {
  Serial.begin(115200);
  dht.begin();
  pinMode(LDR_PIN, INPUT);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  ThingSpeak.begin(client);
}

void loop() {
  float temp = dht.readTemperature();
  float hum = dht.readHumidity();
  int light = analogRead(LDR_PIN);

  ThingSpeak.setField(1, temp);
  ThingSpeak.setField(2, hum);
  ThingSpeak.setField(3, light);

  int status = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
  if (status == 200) {
    Serial.println("Data sent to cloud!");
  } else {
    Serial.println("Send failed.");
  }
  delay(30000);  // Send every 30 seconds
}

12.4 Real-World IoT Applications

DomainApplicationSensors Used
Smart HomeLighting, HVAC, securityPIR, LDR, DHT
AgricultureSoil moisture, weatherSoil, DHT, rain
HealthcarePatient monitoringHeart rate, SpO₂, temp
IndustryPredictive maintenanceVibration, temp, pressure
Smart CityTraffic, air qualityGas, camera, ultrasonic
EnvironmentWater/air qualitypH, turbidity, gas

XIII. Arduino-Based Smart Home Automation

13.1 System Design

A smart home automation system uses Arduino as the central controller, integrating multiple sensors and actuators to automate household functions.

┌──────────────┐ ┌──────────────────┐ ┌──────────────┐ │ Sensors │────→│ Arduino Uno │────→│ Actuators │ │ - PIR │ │ │ │ - Relay │ │ - LDR │ │ (Processing) │ │ - Motor │ │ - DHT11 │ │ │ │ - Buzzer │ │ - Ultrasonic│ │ │ │ - LCD │ └──────────────┘ └────────┬─────────┘ └──────────────┘ │ ▼ ┌──────────────────┐ │ ESP8266 Wi-Fi │ │ (Cloud/Uplink) │ └──────────────────┘ │ ▼ ┌──────────────────┐ │ Mobile App / │ │ Web Dashboard │ └──────────────────┘

13.2 Automatic Room Light with PIR

const int PIR_PIN = 2;
const int LDR_PIN = A0;
const int LIGHT_PIN = 9;
const int LIGHT_THRESHOLD = 400;

void setup() {
  pinMode(PIR_PIN, INPUT);
  pinMode(LIGHT_PIN, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int motion = digitalRead(PIR_PIN);
  int lightLevel = analogRead(LDR_PIN);

  if (motion == HIGH && lightLevel < LIGHT_THRESHOLD) {
    digitalWrite(LIGHT_PIN, HIGH);  // Dark + motion → ON
    Serial.println("Light ON (motion detected in dark)");
  } else {
    digitalWrite(LIGHT_PIN, LOW);
    Serial.println("Light OFF");
  }
  delay(500);
}

13.3 Temperature-Controlled Fan

#include <DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT11
#define FAN_PIN 9

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
  pinMode(FAN_PIN, OUTPUT);
}

void loop() {
  float temp = dht.readTemperature();
  if (isnan(temp)) {
    Serial.println("Sensor error");
    return;
  }

  if (temp > 30.0) {
    analogWrite(FAN_PIN, 255);  // Full speed
    Serial.print("Fan ON at full speed. Temp: ");
  } else if (temp > 25.0) {
    analogWrite(FAN_PIN, 128);  // Half speed
    Serial.print("Fan ON at half speed. Temp: ");
  } else {
    digitalWrite(FAN_PIN, LOW); // OFF
    Serial.print("Fan OFF. Temp: ");
  }
  Serial.println(temp);
  delay(2000);
}

13.4 Complete Smart Home Features

FeatureSensor/ActuatorFunction
Auto LightingPIR + LDR + RelayLight on when dark + motion
Temperature ControlDHT11 + Fan/AC RelayMaintain comfortable temperature
Security AlertPIR + BuzzerAlarm on intrusion
Water Level MonitoringUltrasonic + Pump RelayAutomated water tank control
Gas Leak DetectionMQ-2 + BuzzerAlert on LPG leak
Smart Door LockRFID + SolenoidAccess control

XIV. Temperature & Environmental Monitoring

14.1 Temperature Monitoring System

A temperature monitoring system uses sensors (DHT11/DHT22, LM35, thermocouple) with Arduino to continuously measure and log temperature data.

14.2 Sensor Comparison

Sensor Range Accuracy Output Interface
LM35−55 to 150 °C±0.5 °CAnalog (10 mV/°C)ADC
DHT110 to 50 °C±2 °CDigital1-wire
DHT22−40 to 80 °C±0.5 °CDigital1-wire
DS18B20−55 to 125 °C±0.5 °CDigital1-wire
Thermocouple−200 to 1300 °C±1 °CAnalog (µV)Amplifier + ADC
MLX90614−70 to 380 °C±0.5 °CDigital (IR)I²C

14.3 LM35 Interface with Arduino

const int LM35_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int adcValue = analogRead(LM35_PIN);
  float voltage = (adcValue / 1023.0) * 5.0;
  float temperature = voltage * 100.0;  // LM35: 10 mV/°C

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
  delay(1000);
}

14.4 Environmental Monitoring Parameters

ParameterSensorUnit
TemperatureDHT11, LM35, DS18B20°C
HumidityDHT11, DHT22% RH
Light IntensityLDR, BH1750Lux
Air QualityMQ-135, MQ-2ppm
PressureBMP180, BMP280hPa
Soil MoistureCapacitive/Resistive%
Rain DetectionRain sensor moduleDigital/Analog

14.5 Data Logging to SD Card

#include <SD.h>
#include <DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT11
#define SD_CS 10

DHT dht(DHTPIN, DHTTYPE);
File dataFile;

void setup() {
  Serial.begin(9600);
  dht.begin();
  SD.begin(SD_CS);
  dataFile = SD.open("data.csv", FILE_WRITE);
  dataFile.println("Time,Temp,Humidity");
  dataFile.close();
}

void loop() {
  float t = dht.readTemperature();
  float h = dht.readHumidity();

  dataFile = SD.open("data.csv", FILE_WRITE);
  if (dataFile) {
    dataFile.print(millis()/1000);
    dataFile.print(",");
    dataFile.print(t);
    dataFile.print(",");
    dataFile.println(h);
    dataFile.close();
    Serial.println("Logged.");
  }
  delay(60000);  // Log every minute
}

14.6 Applications

Summary & Formula Sheet

Communication Systems

ConceptFormula / Rule
Bandwidth\( BW = f_{max} - f_{min} \)
Critical angle (fiber)\( \theta_c = \sin^{-1}(n_2/n_1) \)
Numerical Aperture\( NA = \sqrt{n_1^2 - n_2^2} \)
Fiber attenuation\( \alpha = (10/L) \log_{10}(P_{in}/P_{out}) \) dB/km
Shannon capacity\( C = B \log_2(1 + S/N) \)

Memory Devices

TypeVolatileCellUsage
SRAMYes6T flip-flopCache
DRAMYes1T1C capacitorMain memory
ROMNoDiode/transistorFirmware
EPROMNoFloating gateDevelopment
EEPROMNoFloating gateConfig storage
NAND FlashNoFloating gateSSD, USB
NOR FlashNoFloating gateBIOS, embedded

Arduino Key Functions

FunctionPurpose
pinMode()Set pin direction
digitalWrite() / digitalRead()Digital I/O
analogRead()Read analog (0–1023)
analogWrite()PWM output (0–255)
Serial.begin() / Serial.println()Serial communication

Sensor Formulas

\[ V_{measured} = \frac{\text{ADC value}}{1023} \times 5\,\text{V} \] \[ T_{LM35} = V_{out} \times 100 \quad \text{(10 mV/°C)} \] \[ V_{PWM} = \frac{\text{PWM value}}{255} \times 5\,\text{V} \]

5G & Wireless

GenerationData RateLatency
3G2 Mbps100 ms
4G LTE100 Mbps10 ms
5G10 Gbps1 ms

Exam Tips & Practice Questions

Top 12 Exam Tips
  1. For optical fiber, remember: n₁ (core) > n₂ (cladding) is essential for TIR.
  2. Numerical Aperture: NA = √(n₁² − n₂²) — memorize this formula.
  3. SMF for long distance + high bandwidth; MMF for short distance.
  4. DRAM needs refresh; SRAM doesn't. This is a very common exam question.
  5. SRAM = 6 transistors; DRAM = 1 transistor + 1 capacitor.
  6. EPROM erased by UV light; EEPROM erased electrically.
  7. NAND flash for storage (SSD, USB); NOR flash for code (BIOS).
  8. Memory hierarchy: Registers → Cache → DRAM → SSD → HDD.
  9. 5G: 1 ms latency, 10 Gbps data rate, mmWave + sub-6 GHz.
  10. GaAs has direct band gap + high electron mobility → used in 5G chips.
  11. Arduino ADC formula: V = (ADC/1023) × 5 V.
  12. LM35: 10 mV per °C → temperature = voltage × 100.

Practice Questions

Q1 · Optical Fiber Easy

Explain the principle of total internal reflection in optical fibers. Calculate the critical angle if n₁ = 1.5 and n₂ = 1.45.

Q2 · Numerical Aperture Medium

A step-index fiber has core refractive index 1.48 and cladding refractive index 1.46. Calculate the numerical aperture and acceptance angle.

Q3 · Fiber Attenuation Medium

A 10 km fiber has input power 1 mW and output power 0.1 mW. Calculate the attenuation in dB/km.

Q4 · RAM Comparison Easy

Compare SRAM and DRAM in terms of cell structure, speed, density, cost, and applications.

Q5 · ROM Types Medium

Compare PROM, EPROM, and EEPROM. Which is used in microcontrollers for configuration data and why?

Q6 · Flash Memory Medium

Explain the difference between NAND and NOR flash. Which is used in SSDs and why?

Q7 · 5G Technology Medium

Explain three key use cases of 5G (eMBB, URLLC, mMTC). What role does GaAs play in 5G smartphones?

Q8 · Memory Hierarchy Easy

Draw and explain the memory hierarchy. Why are faster memories smaller and more expensive?

Q9 · Arduino Sensor Medium

Write an Arduino sketch to read temperature from an LM35 sensor and display it on the Serial Monitor. Show the conversion formula.

Q10 · IoT System Hard

Design an IoT-based environmental monitoring system using Arduino, DHT22, and ESP8266. Draw the block diagram and explain each layer.

Solutions to Practice Questions

Solution Q1 · Optical Fiber

Principle: When light travels from a denser medium (core) to a rarer medium (cladding) at an angle greater than the critical angle, it is completely reflected back into the core.

\[ \theta_c = \sin^{-1}\left(\frac{n_2}{n_1}\right) = \sin^{-1}\left(\frac{1.45}{1.5}\right) = \sin^{-1}(0.9667) \approx 75.2° \]
Solution Q2 · Numerical Aperture
\[ NA = \sqrt{n_1^2 - n_2^2} = \sqrt{1.48^2 - 1.46^2} \] \[ NA = \sqrt{2.1904 - 2.1316} = \sqrt{0.0588} \approx 0.2425 \] \[ \theta_{max} = \sin^{-1}(0.2425) \approx 14.0° \]
Solution Q3 · Fiber Attenuation
\[ \alpha = \frac{10}{L} \log_{10}\left(\frac{P_{in}}{P_{out}}\right) \] \[ \alpha = \frac{10}{10} \log_{10}\left(\frac{1}{0.1}\right) = 1 \times \log_{10}(10) = 1 \text{ dB/km} \]
Solution Q4 · RAM Comparison
FeatureSRAMDRAM
Cell6 transistors (flip-flop)1 transistor + 1 capacitor
RefreshNot neededNeeded every few ms
SpeedVery fastSlower
DensityLowHigh
CostHighLow
UsageCache memoryMain memory (RAM)
Solution Q5 · ROM Types
TypeProgrammableErasableMethod
PROMOnceNo
EPROMYesYesUV light
EEPROMYesYesElectrical

EEPROM is used in microcontrollers because it can be erased and reprogrammed electrically, byte by byte, without removing the chip.

Solution Q6 · Flash Memory
FeatureNAND FlashNOR Flash
AccessPage-basedRandom (byte)
SpeedFaster write/eraseFaster random read
DensityHighLow
Cost/bitLowHigh
UsageSSD, USB, memory cardsBIOS, firmware

NAND flash is used in SSDs because of its high density, low cost per bit, and fast write/erase speeds.

Solution Q7 · 5G Technology

eMBB: Enhanced Mobile Broadband — supports 4K/8K video streaming, AR/VR.

URLLC: Ultra-Reliable Low-Latency Communication — used in autonomous vehicles, remote surgery.

mMTC: Massive Machine-Type Communication — supports millions of IoT devices per km².

GaAs role: GaAs has a direct band gap and high electron mobility (low effective mass). This allows faster switching and higher frequency operation in 5G RF front-end modules and power amplifiers.

Solution Q8 · Memory Hierarchy

Memory hierarchy from fastest to slowest:

Registers → L1 Cache → L2 Cache → L3 Cache → Main Memory (DRAM) → SSD → HDD

Faster memories (like registers and cache) use SRAM technology, which is expensive and has low density. To achieve high speed, each cell uses 6 transistors, increasing area and cost. Slower memories (like HDD) use magnetic storage, which is cheap and high-density but slow.

Solution Q9 · Arduino LM35
const int LM35_PIN = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int adcValue = analogRead(LM35_PIN);
  float voltage = (adcValue / 1023.0) * 5.0;
  float temperature = voltage * 100.0;  // LM35: 10 mV/°C

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
  delay(1000);
}

Formula: \( T = \frac{\text{ADC}}{1023} \times 5 \times 100 = \frac{\text{ADC}}{1023} \times 500 \) °C

Solution Q10 · IoT System Design
Layer 1 (Perception): DHT22 sensor → collects temp & humidity Layer 2 (Network): ESP8266 → Wi-Fi connectivity Layer 3 (Processing): Arduino → reads sensor, formats data Layer 4 (Application): ThingSpeak → cloud storage, visualization Layer 5 (Business): Web dashboard / mobile app → user monitoring

Each layer has a specific role: sensors collect data, network transmits it, processing formats it, application stores/visualizes it, and business layer enables decisions.

References & CO Mapping

Textbooks

RefTitleAuthorPublisher
T-1Principles of ElectronicsV. K. Mehta and Rohit MehtaS. Chand & Company
R-1Electronic Devices and Circuit TheoryRobert L. Boylestad and Louis NashelskyPearson Education India
R-2Digital FundamentalsThomas L. FloydPearson Education India

Relevant Websites

RefWeb AddressFeature
RW-1eia.gov/energyexplained/solar/photovoltaics-and-electricity.phpSolar cell basics
RW-2geeksforgeeks.org/computer-networks/types-transmission-media/Optical fiber and wireless communication
RW-3electronics-tutorials.ws/boolean/book_7.htmlLogic gates
RW-4tutorialspoint.com/digital-electronics/four-variable-k-mapK-Map
RW-5robocraze.com/blogs/post/what-are-multiplexers-and-demultiplexersMUX and DEMUX
RW-6electronicsforu.com/technology-trends/learn-electronics/flip-flop-rs-jk-t-dFlip-flop
RW-7testbook.com/electrical-engineering/asynchronous-countersAsynchronous counters

Audio-Visual Aids

RefTopic
AV-7Operation of basic shift registers (SISO, SIPO, PISO, PIPO)
AV-8DHT11/DHT22

Software/Equipments/Databases

RefToolPurpose
SW-1ProteusCircuit design and simulation
SW-2Arduino IDEArduino programming
SW-3Arduino sensors librariesDHT, LCD, etc.

Key Takeaways

  1. Optical fiber works on total internal reflection; n₁ > n₂ is essential.
  2. NA = √(n₁² − n₂²) measures light-gathering ability of a fiber.
  3. Wireless technologies: Bluetooth (10 m), Wi-Fi (100 m), 5G (high speed, low latency).
  4. 5G offers 10 Gbps data rate and 1 ms latency for eMBB, URLLC, and mMTC.
  5. GaAs is used in 5G chips due to its direct band gap and high electron mobility.
  6. SRAM uses flip-flops (fast, cache); DRAM uses capacitors (slow, main memory).
  7. ROM types: PROM (once), EPROM (UV erase), EEPROM (electrical erase).
  8. NAND flash is used in SSDs; NOR flash is used for firmware/BIOS.
  9. Memory hierarchy: Registers → Cache → DRAM → SSD → HDD.
  10. Semiconductor materials are critical for renewable energy (solar cells, power electronics).
  11. IoT architecture has 5 layers: Perception, Network, Processing, Application, Business.
  12. Arduino with DHT11/DHT22 enables temperature and humidity monitoring for IoT systems.

CO Mapping

CODescriptionSections Covered
CO1Explain principles of solid-state physics and semiconductor materialsXI
CO2Apply electrical laws to analyze semiconductor devicesXI
CO6Demonstrate Arduino programming and sensor interfacingXII, XIII, XIV

End of Unit V

Communication Systems · Optical Fiber · Wireless · Memory Devices · SSDs · IoT · Arduino · Smart Home

PHY 175 · Modern Physics and Electronics

Complete · Exam-Ready · Full Marks Guaranteed