Unit 4 Summary
Unit 4 Summary
| Lesson | Topic | Key content covered |
|---|---|---|
| Lesson 4.1 | Sensor and actuator taxonomy | 8 sensors surveyed (DHT22, HC-SR04, PIR, MQ-2, LDR, DS18B20, MPU-6050, BH1750). 6 actuators catalogued (LED, relay, buzzer, DC motor, servo, solenoid). |
| Lesson 4.2 | Sensor integration and data collection | HC-SR04 tank level, PIR occupancy lighting, MQ-2 gas alarm. Multi-sensor non-blocking data logger. Calibration, rolling average, hysteresis. |
| Lesson 4.3 | Sensor-driven actuator control | Closed loop vs open loop control. Smart fan controller (hysteresis), automatic night light (proportional control), security system state machine (IDLE/ALERT/ALARM). |
Key Sensor Quick Reference
| Sensor | Measures | Output | Interface | Key library |
|---|---|---|---|---|
| DHT22 | Temp + Humidity | Digital | 1-Wire (DHT) | Adafruit DHT |
| HC-SR04 | Distance | PWM echo | Trig/Echo | pulseIn() |
| PIR HC-SR501 | Motion | Digital | GPIO | digitalRead() |
| MQ-2 | Gas / Smoke | Analog + Digital | ADC + GPIO | analogRead() |
| LDR | Light | Analog | ADC (voltage divider) | analogRead() |
| DS18B20 | Temperature | Digital | 1-Wire | DallasTemperature |
| MPU-6050 | Accel + Gyro | Digital | I2C (0x68) | Adafruit MPU6050 |
| BH1750 | Light (lux) | Digital | I2C (0x23) | BH1750 library |
Key Terms Glossary
Active sensor
A sensor that requires external power to operate.
Actuator
A device that converts an electrical signal into a physical action.
Back-EMF
Voltage spike produced by an inductive load (motor, relay, solenoid) when switched off.
Closed-loop control
A control system where sensor feedback continuously adjusts the actuator output.
Flyback diode
A diode placed across an inductive load to suppress back-EMF voltage spikes.
Hysteresis
Using separate ON and OFF thresholds to prevent rapid chattering around a single setpoint.
Measurand
The physical quantity being measured by a sensor (temperature, pressure, light, etc.).
MQ sensor
A family of gas sensors using a heated tin-dioxide element whose resistance varies with gas concentration.
Open-loop control
A control system where the output is predetermined and not adjusted by sensor feedback.
PIR sensor
Passive Infrared sensor — detects changes in infrared radiation from warm bodies.
Rolling average
A signal filtering technique that averages the most recent N readings to reduce noise.
Sensor
A device that detects a physical condition and converts it to an electrical signal.
Setpoint
The desired target value that a closed-loop control system tries to maintain.
State machine
A design pattern where a system exists in one of several defined states and transitions based on events.
Threshold
A defined level at which a control action is triggered.
Transducer
A device that converts energy from one form to another (sensors and actuators are both transducers).
Further Reading & Resources
- Arduino Sensor Documentation — docs.arduino.cc
- Wokwi Simulator — wokwi.com — simulate HC-SR04, PIR, DHT22, LDR, relay, motor, servo with full Arduino code support
- Random Nerd Tutorials — randomnerdtutorials.com — detailed wiring guides for every sensor in this unit
- Last Minute Engineers — lastminuteengineers.com — excellent sensor datasheets, calibration, and example code
- Adafruit Learning System — learn.adafruit.com — in-depth guides for MPU-6050, BH1750, and other I2C sensors


