Things in IoT and IoT Security & Privacy - Basic
๐ Voltage Considerations for Sensors in IoT
⚙️ Why Voltage Matters:
-
Sensors require specific voltage and current to function correctly.
-
Supplying the wrong voltage can result in:
-
Incorrect readings
-
Permanent damage to the sensor
-
Microcontroller malfunction
-
⚡ Typical Voltage Levels:
| Sensor Type | Operating Voltage |
|---|---|
| Digital Sensors | 3.3V or 5V |
| Analog Sensors | Often 5V |
| Microcontrollers (ESP32, Arduino) | 3.3V or 5V |
๐ง Logic Level Compatibility:
-
ESP8266 & ESP32 use 3.3V logic.
-
Arduino Uno operates at 5V logic.
-
If a sensor outputs 5V but the MCU takes only 3.3V, a logic level shifter or voltage divider is needed.
๐ง Example:
If you connect a 5V IR sensor to an ESP32 input pin directly, the 3.3V-only GPIO may be damaged unless a voltage divider is used.
๐ก Working of Common IoT Sensors
1. PIR Motion Sensor
-
PIR = Passive Infrared
-
Detects infrared radiation changes caused by movement of warm objects (e.g., humans).
-
Working:
-
Has 2 slots with IR-sensitive materials.
-
When both slots receive equal IR radiation → idle.
-
Movement causes imbalance → triggers signal (usually HIGH).
-
Use: Motion-activated lights, security alarms.
2. Sharp IR Distance Sensor
-
Uses Infrared light to measure distance by triangulation.
-
Emits a focused IR beam; measures angle of reflection to compute distance.
-
Analog output voltage varies with distance.
Use: Obstacle detection in robots, distance measurement.
3. LDR Sensor (Light Dependent Resistor)
-
Resistance decreases with increasing light.
-
Connected in a voltage divider circuit to convert resistance to voltage.
-
Output is analog.
Use: Auto-brightness control, day/night detection.
4. Gyro Sensor (Gyroscope)
-
Measures angular velocity (how fast it is rotating).
-
Works using the Coriolis effect:
-
When the sensor rotates, a vibrating structure inside gets displaced, and that displacement is measured.
-
Use: Drones, smartphones (screen orientation), gaming.
5. Ultrasonic Distance Sensor (HC-SR04)
-
Sends out ultrasonic pulse (40 kHz).
-
Measures time delay of reflected pulse (echo).
-
Uses the formula:
Use: Robot obstacle detection, tank level measurement.
6. DHT Sensor (DHT11/DHT22)
-
Measures temperature and humidity.
-
Contains:
-
NTC Thermistor (for temperature)
-
Humidity sensor (capacitive)
-
-
Digital output on a single data line.
Use: Weather stations, smart home systems.
๐งช Why ADC is Required for Analog Sensors
๐งญ Analog vs. Digital:
-
Analog Sensors (like LDR, Sharp IR) output a variable voltage.
-
Microcontrollers only understand digital values.
๐ Role of ADC (Analog to Digital Converter):
-
Converts analog voltage to digital value (e.g., 0–1023 for 10-bit ADC).
-
Allows precise measurement of analog phenomena (light, temperature, etc.).
๐งฐ External ADC Needed When:
-
Your microcontroller lacks ADC (e.g., Raspberry Pi).
-
You need higher resolution or multiple analog inputs.
Example ADC chips:
-
MCP3008 (10-bit, 8 channels)
-
ADS1115 (16-bit, 4 channels, I2C)
⚙️ Actuators in IoT (Detailed Working)
1. Servo Motor
-
Can rotate to a specific angle (0° to 180°).
-
Controlled using PWM (Pulse Width Modulation) signal.
-
Internally has a motor + gear + feedback system.
Use: Robotic arms, pan-tilt camera mounts.
2. Solenoid
-
A coil of wire generates a magnetic field when current flows.
-
Pulls a metallic plunger inward (linear motion).
Use: Door lock systems, vending machines.
3. Stepper Motor
-
Moves in precise steps (e.g., 1.8° per step).
-
Each pulse sent rotates the shaft by a fixed angle.
-
Controlled using drivers (ULN2003, A4988).
Use: 3D printers, CNC machines, robotic vehicles.
๐ Why Relay is Required with Actuators
๐ Problem:
-
Microcontroller GPIO pin can supply only a few mA current.
-
Heavy actuators, AC devices, or solenoids need more voltage and current (e.g., 12V, 220V AC).
๐ Relay (Solution):
-
Electrically operated switch.
-
Low-power signal from microcontroller triggers relay to switch high-power circuit.
๐งฐ Types of Relays:
-
Mechanical Relay
-
Solid State Relay (SSR) (faster, silent)
Example Use:
Turn ON a 220V AC fan or bulb using a 5V Arduino.
๐ IoT Security & Privacy
๐ก️ Why It's Critical:
IoT devices collect sensitive data (e.g., cameras, sensors, GPS). A security breach can cause:
-
Data theft
-
Privacy invasion
-
Malicious control over devices
๐ Common Vulnerabilities:
-
Weak/default passwords
-
No encryption in communication
-
Unpatched firmware
-
Insecure APIs
✅ Best Practices for Security:
| Layer | Measures |
|---|---|
| Network | Use TLS/SSL, VPN, firewall |
| Device | Strong passwords, update firmware |
| Cloud | Encrypt stored data, access control |
| User | Educate about phishing and threats |
๐ Summary Table
| Component | Needs Voltage? | Needs ADC? | Digital/Analog | Control |
|---|---|---|---|---|
| PIR Sensor | Yes (5V) | No | Digital | GPIO |
| Sharp IR | Yes (5V) | Yes | Analog | ADC |
| LDR | Yes (5V) | Yes | Analog | ADC |
| Ultrasonic | Yes (5V) | No | Digital (Trigger/Echo) | Timing |
| Servo Motor | Yes (5V) | No | Digital (PWM) | PWM |
| Stepper Motor | Yes (12V) | No | Digital pulses | Driver |
| Solenoid | Yes (12V/220V) | No | Relay controlled | Relay |
| DHT11 | Yes (3.3V/5V) | No | Digital | GPIO |
-
Provide diagrams (block or circuit),
-
Share a ready-to-print PDF,
-
Help with IoT project ideas based on these sensors & actuators.
Comments
Post a Comment