Introduction
In this project, I created a simple home automation system that controls three bulbs(9W or lesser) using an ESP32 and Pyserial. The system allows for easy control of household lighting through serial communication from a computer.
Components Used
- ESP32 microcontroller
- Three bulbs
- Relay module (to control the lamps)
- Pyserial (for serial communication)
- Power supply
- Jumper wires and breadboard
Project Overview
The project aims to automate the control of household lamps using the ESP32, which receives commands through serial communication from a Python script running on the computer. This communication is established using Pyserial, a Python library that allows communication with the ESP32 over a USB connection.
System Architecture
The system consists of the following elements:
1. ESP32:Serves as the main controller that receives commands via serial and controls the lamps using relays.
2. Relays:The relays are used to switch the lamps on or off based on signals from the ESP32.
3. Pyserial: A Python script running on the computer sends control signals (on/off) to the ESP32 through the serial port.
Circuit Diagram
Detailed circuit diagram showing the connection between the ESP32, the relays, and the lamps.
How It Works
The Python script communicates with the ESP32 over a serial connection. When the user sends a command (for example, to turn on or off a bulb), the ESP32 processes the command and triggers the appropriate relay. The relay then switches the lamp on or off, completing the automation process.
Conclusion
This project demonstrates a basic home automation setup using ESP32 and Pyserial. With simple code and readily available components, it's possible to control household devices like lamps, making daily life more convenient. This system can easily be expanded to include other devices, sensors, or even wireless control.
Source Code for the Project
ESP32 CODE:https://github.com/amirphiladam2/SmartHomeAssistant/blob/main/Bulbserialcom.c
ASSITANT CODE:https://github.com/amirphiladam2/SmartHomeAssistant/blob/main/Optimus.py
Next Steps
- Expand the project to control more devices (fans, alarms, etc.).
- Add a web interface or a mobile app for wireless control.
- Integrate sensors for automated control based on environmental factors (e.g., turning on lights when it gets dark).
0 Comments