Smart Lighting Automation is an advanced IoT-based system that intelligently controls lighting using an ESP32 microcontroller. This project is designed to optimize energy efficiency and improve user convenience by automating lighting control based on real-time inputs such as motion and facial recognition. It also allows manual control through a Wi-Fi-based web interface.
- Motion Detection: Automatically turns the LED on or off when motion is detected, ensuring efficient use of lights.
- Manual Wi-Fi Control: Control the lighting remotely through a web interface from any phone or PC.
- Enable/Disable Features: Users can enable or disable motion detection and manual control for a more customized experience.
- Facial Recognition: When face detection is enabled, the system records video, detects faces, and turns the LED on when a face is recognized. The LED turns off when no face is detected.
- Worker Identification: The system prints the names of recognized workers, providing useful identification in office spaces.
- Motion Detection: The system uses an IR sensor to detect motion and control the LED accordingly.
- Manual Control: Users can manually turn the LED on or off via a web interface connected to the ESP32 through Wi-Fi.
- Face Detection & Recognition: When enabled, the camera captures video and uses facial recognition to control the LED. The system identifies workers and displays their names, or "Unknown" if the person is not recognized.
- Video Recording: The system records and stores video data locally whenever face detection is enabled, providing a record of activity.
This project is particularly useful in office environments where it automates lighting based on presence and identity. When a person enters a room or cabin, the system turns the lights on and identifies them if their face is recognized. If the room is empty, the lights automatically turn off, saving energy. The added feature of face detection and recording makes the system ideal for areas where monitoring is needed.
- ESP32 Microcontroller: The brain of the project, controlling sensors, LED, and web interface.
- IR Sensor: Detects motion to automate lighting.
- OpenCV with Python: Used for facial detection and recognition.
- Face Recognition Library: For recognizing and identifying faces.
- Web Interface: Built to control the LED and system features remotely via Wi-Fi.
- Buzzer: Provides audible feedback when the LED is activated.
- Telegram Bot/Smartphone App: Future iterations will include remote control through a Telegram bot or smartphone app for greater flexibility.
-
Clone the repository:
git clone https://github.com/yourusername/smart-lighting-automation.git
-
Follow the steps to set up your ESP32 microcontroller and sensors. Refer to the
circuit_diagram.png
file in the repository for hardware connections. -
Install the required Python libraries for facial recognition:
pip install opencv-python face_recognition requests
-
Upload the ESP32 code to your microcontroller and set the correct IP address in the Python code.
-
Run the Python script for face recognition and manual control.
-
Access the web interface via the IP address of your ESP32 to manually control the system.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
-
Fork the Repository:
- Click the "Fork" button at the top right of the repository page to create your copy of the repository.
-
Clone Your Fork:
- Clone your forked repository to your local machine using:
git clone https://github.com/SyedThameemuddin/Smart-Lighting-Automation.git
- Clone your forked repository to your local machine using:
-
Create a New Branch:
- Create a new branch for your feature or fix:
git checkout -b feature/my-feature
- Create a new branch for your feature or fix:
-
Make Your Changes:
- Make your changes in the codebase and commit them:
git commit -m "Add my feature"
- Make your changes in the codebase and commit them:
-
Push Your Changes:
- Push your changes to your fork:
git push origin feature/my-feature
- Push your changes to your fork:
-
Open a Pull Request:
- Go to the original repository and click on "Pull Requests."
- Click on "New Pull Request" and select your branch to compare with the main branch of the original repository.
- Provide a description of your changes and submit the pull request.
- Please ensure your code adheres to the existing style and conventions.
- Include tests for any new functionality where applicable.
- Update documentation as needed.
Thank you for considering contributing to this project!
This project is licensed under the MIT License. See the License file for more details.