The smart plug uses Wemos D1 R2 board based on ESP8266, it provides connection to the device via Wi-Fi …
Tools and materials: -Two sockets-adapters;
-Wemos D1 R2 board;
-Resistor 1 kOhm;
-Network adapter 5В; -Screwdriver; -Pliers; -Soldering iron;
Step one: preparing a large outlet
There are two outlets in total. One socket, the larger one, will house all the electronics and it will be connected to the network, and the second, smaller one, is intended for connecting peripheral devices.
The large adapter must be disassembled and all contact plates and plug removed. The plastic partitions must be partially dismantled.
All electronic components must fit into the adapter housing and the lid must close.
The plug must be replaced.
Step two: scheme
Further, according to the above diagram, it is necessary to mount all the details in the socket housing. Cut a hole in the case on the line of the micro usb connector of the Wemos D1 board.
Step three: small adapter
Now we need to disassemble the small adapter. The adapter plug must be removed and the screws must be installed in its place. According to the diagram, connect the power wires to the screws (via the relay). Fix the two housings together with a screw.
Step four: programming
Now we need to program Wemos.
Download the folder from the Github page. Click the CH34x. In the next window, click “Install”.
After a few seconds, the driver should load. To check, we connect the device to a PC. Open the device manager. The manager must have a “USB SERIAL CH340” device.
Now you need to install the Wemos D1 board library.
Copy the links below.
& # 34; https & # 58; //dl.espressif.com/dl/package_esp32_index.json, http & # 58; //arduino.esp8266.com/stable/package_esp8266com_index.json"
Open arduino ide and go to the file & gt; & gt; settings.
Insert links as shown in the photo, separating them with a comma.
Next, open the “Wifi_device_CSS” code. In the code, we change the SSID and password to our own. We choose the board as Wemos D1 R2. We select the port to which the device is connected. Loading the code.
To find the IP address of the device, you need to do the following.
Open the serial monitor.
Select the baud rate 115200.
Close the serial monitor.
Now, disconnect the device and reconnect it. Open the serial monitor and the IP address of the device will be registered there.
Everything is ready. We install the device into an outlet. We connect a household appliance to it. We are waiting for a couple of minutes until it connects to Wi-Fi. Enter the IP address in the gadget browser. Now you can remotely control home appliances.
A demonstration of the work of such a smart socket, as well as the process of its assembly, can be seen in the video.