Home Automation Using ESP01
by Steve Willson Kujur in Circuits > Microcontrollers
11843 Views, 154 Favorites, 0 Comments
Home Automation Using ESP01
Hi, I'm Steve, and I've designed a switch using the ESP01 module. This switch has the capability to control up to 10 amps of current and is designed to work with 220V AC power sources. It's a practical and versatile solution for remotely managing electrical devices and appliances in your home or workspace.
Let's Start
Supplies
The Switch only requires very few components.
Multiple Firmware Options
ESPhome and Tasmota are two popular firmware options for open-source smart home automation, particularly for ESP8266 and ESP32-based devices. These firmware solutions offer customizable and feature-rich platforms for controlling and monitoring various IoT devices, such as smart switches, lights, sensors, and more.
ESPhome:
- User-Friendly Configuration: ESPhome is known for its user-friendly YAML-based configuration system. Users can define their devices and automation rules in a structured and intuitive manner.
- Integration with Home Assistant: ESPhome is tightly integrated with Home Assistant, a popular home automation platform. This makes it easy to create and manage smart devices within a single ecosystem.
- Over-the-Air (OTA) Updates: ESPhome allows for remote firmware updates, which is convenient for keeping your devices up-to-date without physical access.
- Real-time Debugging: It provides real-time debugging capabilities, which can be helpful for troubleshooting and fine-tuning your smart devices.
Tasmota:
- Wide Hardware Compatibility: Tasmota supports a wide range of ESP8266 and ESP32-based devices, and it's known for being compatible with many third-party products.
- Web Interface: Tasmota offers a web-based user interface for configuring and controlling devices. This makes it accessible to users who prefer a graphical interface.
- Rule Engine: It features a rule engine that allows for complex automation and scripting, making it a powerful choice for advanced users.
- Integration with Various Platforms: While it can be integrated with Home Assistant, Tasmota is also compatible with other platforms, providing flexibility in your smart home setup.
Both ESPhome and Tasmota have active communities and receive regular updates. Your choice between them may depend on your level of technical expertise and specific project requirements. ESPhome is often favoured for its simplicity and Home Assistant integration, while Tasmota appeals to those who want a high degree of customization and compatibility with various platforms. Ultimately, they both contribute to the open-source ecosystem of smart home automation, providing valuable options for DIY enthusiasts and developers.
Designing PCB
I utilized EasyEDA for PCB design and subsequently converted it into a PCB layout, and you can find the attached Gerber files for your reference.
DFM Gerber Viewer
You can use the DFM Gerber viewer to visualize the Gerber file.
Making PCB
To fabricate these PCBs, I utilized the "Next PCB" service, simplifying the process for you, as you only need to upload the Gerber files.
And Also Sponsored By NextPCB-Reliable Multilayer PCB Manufacturer
Order reliable PCB with $30 off
Enjoy free PCB assembly for 5 boards:
https://www.nextpcb.com/pcb-assembly-services
DFM free online PCB Gerber viewer:
AC to DC Converter
The ESP01 required 3.3V, while the relay needed 5V. To achieve this, I implemented an AC to DC SMPS (Switched-Mode Power Supply) to convert the 220V mains voltage to a stable 5V DC supply. Instead of using a ready-made, albeit pricier solution like the Hi-Link SMPS, I decided to experiment with this module which turned out to be not only cost-effective but also more compact in size.
Soldering
It took me a total of 10 minutes to gather all the essential SMD and through-hole components, organize them, and then proceed to solder each of these components in place.
GPIO
GPIO0 is for the relay, followed by GPIO1 and GPIO2 for two peripherals, and both are pulled high, eliminating the need to add pull-up resistors.
I've supplied ground and 3.3V to the GPIO2 JST connector so that you can power the DHT11 Temperature and Humidity sensor, with GPIO1, Ground available for connecting a tactile switch.
Uploading Firmwere
I employed the CP2104 USB to UART adapter for uploading the Tasmota firmware. There's no need for any additional software, you simply require the UART driver, and the Tasmota web portal will handle the rest of the process.
Connection
There are two screw terminals, one for input and one for output, capable of working with both 110V and 220V power sources.
Finishing Up
After accessing the IP address of the Tasmota device, I can control the light bulb's toggle locally.
"You've just completed it! Thank you for visiting my Instructables. Stay tuned for more exciting projects in the near future."