The Room Occupancy Light System automates lighting control using an ultrasonic sensor and ESP32 microcontroller. It detects room occupancy in real time and integrates with smart home systems via IFTTT webhooks, saving energy and enhancing convenience.
- Real-time occupancy detection.
- Automatic light control using IFTTT webhooks.
- Wi-Fi connectivity for smart home integration.
- Live status updates on an LCD display.
- ESP32 Microcontroller
- Ultrasonic Sensor (HC-SR04)
- 16x2 LiquidCrystal_I2C Display
- Jumper wires and breadboard
- Hardware:
- Connect the ultrasonic sensor to ESP32 pins (TRIG: GPIO5, ECHO: GPIO18).
- Attach the LCD to the ESP32 I2C pins.
- Software:
- Install libraries:
LiquidCrystal_I2C
,WiFi
,HTTPClient
. - Update the code with your Wi-Fi and IFTTT webhook details.
- Install libraries:
- Upload:
- Flash the code onto the ESP32 using Arduino IDE.
- The ultrasonic sensor detects distance, determining occupancy.
- State changes (occupied/unoccupied) trigger HTTP requests to IFTTT webhooks.
- The LCD displays the distance and occupancy status.
- Add PIR sensors for better accuracy.
- Enable power-saving modes.
- Log occupancy data for insights.
This system is simple yet effective for energy-efficient automation.