ESP8266 based home automation system design
업데이트 시간: 2021-10-20 12:23:45
This program Jotrin will introduce how to build the perfect home automation system using ESP8266.
For the perfect home automation, I have chosen these points
No Internet required to work
Easy to install
To make such a system, I divided the operation into 3 parts
In order to design the perfect PCB for the perfect home automation system, Altium Designer was used.
While designing this board, I kept in mind to keep the board as compact as possible without compromising any functionality. Let's take a look at the components on the board.
We have an esp8266 chip, then we have two relays and a compact power supply. I also added screw connectors for AC, JST connectors for touch switches and sensors. Using 0603 SMD resistors and capacitors to reduce the PCB size.
I could have been more compact if I had used 0402 resistors and capacitors, but we can't solder such small components at home. altium did a great job with this design.
Start with small components such as resistors capacitors and diodes.
In order to solder them, we need a sharp soldering iron. Sharp tweezers and thin solder. For cleaning, you can use alcohol.
To solder, put some solder on one of the pads, then pick up the component with tweezers and place it in the right place. Hold it and place the soldering iron and melt the solder and remove it.
One side will be soldered. Now you can easily solder the other side.
By using the same method, I soldered all the components. The final PCB looks like this.
Now we can insert it directly into the connector. By the way, I soldered a temperature and humidity sensor. Thus, the hardware part is finished.
The firmware part
Arduino IDE Installation
1. Download the latest Arduino IDE version for your computer's operating system. 2.
2. Save the .exe file to your hard drive. 3.
3. Open the .exe file.
ESP8266 Development Board Installation
To install the ESP8266 development board in your Arduino IDE, follow these instructions
In your Arduino IDE, go to File > Preferences
In the Additional Boards Manager URLs field, enter http://arduino.esp8266.com/stable/package_esp8266com_index.json as shown in the following image. Then, click the OK button.
Note: If you already have an ESP32 board URL, you can separate the URLs with commas, as follows.
Open the Board Manager. Go to Tools > Board > Boards Manager... Search for ESP8266 and press the "ESP8266 by ESP8266 Community" install button.
To install the new library to your Arduino IDE, you can use the Library Manager (available from IDE version 1.6.2). Open the IDE and click the Sketch menu, then click Include Libraries > Manage Libraries.
The Library Manager will then open and you will find a list of installed or ready to install libraries. Search for the Blynk library and in Versions, select the latest version to date
Finally, click Install and wait for the IDE to install the new library. The download may take some time, depending on your connection speed. When it finishes, the "Installed" mark should appear next to the Bridge library. You can close the Library Manager.
You can now find the new libraries available in the Sketch > Include Library menu.
Now you need a USB to UART converter and solder the VCC Ground RX and TX wires from the converter to the board.
Download this code from the article and open it in the Arduino IDE.
Now add your wifi credentials here and add your Blynk authentication token here. You will get the Blynk authentication token from the blynk mobile app. All the details are provided in the article. So don't worry.
Finally, it's time to upload the code.
When uploading the code, you will first need to set esp to flash mode.
To do this, use tweezers and place it between the flash holes of the PCB. Then touch the reset pad with the other tweezer. esp will be set to flash mode.
Now upload the code.
Mount this PCB on the expansion board. The touch switch is attached to the back of the blank using a glue gun. The humidity sensor is glued to the housing and you are done.
The Blynk app is available for iOS and Android devices.
After downloading the app, create an account and log in.
Create a Blynk project
Next, click "Create new project" in the app to create a new Blynk app. Name it whatever you want, just make sure the "Hardware Model" is set to ESP8266.
The authentication token is very important - you need to paste it into the firmware of your ESP8266. Now, copy it down or use the "Email" button to send it to yourself.
Adding widgets to the project
You will then see a blank new project. To open the widget box, click on the project window to open it.
Add a Button and click it to change its settings. The Button toggles the output on the ESP8266. Set the button's output to Virtual V2.
Add another button for VIrtual V3.
Now add two Labeled Values to Virtual V1 and Virtual V0
For V1 use Temp - /pin/C in the label
For V0 use Humidity - /pin/%
This is the end of the project.
If you have any ideas, comments or questions about this project, please leave them below.