Warning: This is a high voltage application, try at your own risk
Final part: Control devices separately in the same power outletIn this post, I will show all of you how to mod the power outlet to allow us to control two devices separately with the same power outlet.
I use physical SINO power outlet that is very famous in local store in Vietnam.
Step 1: I detach the cover on the back, and cut copper line on one side that connects two holes with each other. You don't need to cut both lines:
Step 2: I make hole on both copper heads, then make thread to use bolts to hold the power line later.
Step 3: Make hole on the cover to get power line go through of it as other corner.
Step 4: I already finish fixing the power outlet and reassemble parts together.
Step 5: To control two devices, I use two relay module ESP8266 instead of one as mentioned in previous posts, and put them all in the back. A 220vac -> 5vdc module provides enough current to both of relay modules as seen in document. To flash firmware to relay module ESP8266 look at this link or see bottom section, to control relay module ESP8266 loot at this link or see bottom section too.
Demo clip:
Main tutorial section1. IntroductionI used this to mainly control the bump in my garden for watering over 2 years and it has being worked well up to now. In the past, I watered my garden everyday in the morning about two years more ago before work. It cost me more 30 minutes to water the whole garden. Sometimes I were so busy and rush to work without watering the garden. Now, it happen no more, because I can remotely control the bump to spray water to feed the trees. I can also set timer to feed the tree at any time I love to. You can use this one to control any other I/O device, and I have another version for physical switch with both forward to control & backward to indicate current switch status (I will post another topic about this version).
There are a lot of digital power outlet with timer on the market, but I cannot control it via the internet, or embed some sensor to system to water on demand automatically. Therefore, I determine to make my own a smart power outlet from a physical one.
Current feature:
- Attach to any physical power outlet
- Turn ON/OFF any I/O device, such as: pump or electromagnetic valve directly via the Internet
- Set timer to turn ON or turn OFF device at any time
I test its stability by turning ON/OFF a driller, and introduce the timer feature to turn the driller ON/OFF automatically.
2. Prepare hardwareAll chosen parts are easy to find at local store.
- Module converts 220 vac to 5 vdc
- Module wifi relay switch with chip ESP-1
- USB to serial uploader
- Any physical power outlet
Assembly
Check VAC input, and VDC out put carefully as in the following photo:
Everything should be done as below photo:
Detach ESP-1 from wifi relay module to flash the firmware, wiring must be done as below instruction to be able to flash the firmware. Remember connect the 3.3v line after all, just before pushing the FLASH button.
Soft used to flash firmware is ESP8266Flasher.exe download from here and firmware from here. Please set all parameters as following:
Note: Check for right COM port in Device Manager
After all, click the FLASH button in OPERATION tab to begin flashing job. The blue led on ESP-1 should blynk continuously. To clear everything in ESP-1’s memory, flash it with the following empty file from here. Then you flash the firmware again, and after that input new uid, pass of wifi as you want. It is time to put ESP-1 back to wifi relay module and provide 220vac to the physical power outlet.
The power outlet is going to be controlled over the Internet, steps are as following:Step 1: Install the app named Simple Blynk – DIYOracle from Google Play Store, type “diyoracle” to search for this free app. You need to register an account before use:
After login successfully, open menu from top left, then choose Switches:
There is a Default switch already created at first, switch to Config tab to copy the token string for later use. You need to change the timezone to suit your location, and device name for easy remember.
Step 2: Provide the physical outlet with power, wait for Wifi hotspot xxxxxx_DIYOracle to show up in the list, then touch to make connection.
Open any web browser, and type 192.168.4.1 in the address bar. An interface as in the below photo will be displayed, choose the first menu Configure Wifi.
In this web page, you need to provide your wifi credentials to allow ESP-1 to connect to the Internet, then paste the copied token in the 3rd text box. The unique token helps server to match and control correct device on demand.
* In case wifi credentials, and token need to be changed later. You must push the Refresh Token in Config tab before any change will be made, that helps to clear ESP-1 memory, and start the web configuration portal to allow you changing the wifi credentials and a new token as described above. Otherwise, you have to flash ESP-1 with empty file as mentioned at the end of part 2, and re-flash the firmware again.
Step 3: Connect your phone to the Internet again, open Simple Blynk app and give a try to control the power outlet. The icon on top right should go green to indicate the power outlet connected status.
To set timers, go to the Schedules tab and click Add button at top right corner. Remember to change timezone to suit your location that make timer working well.
Finally, you can add more devices if you want, there is an ADD button on top of the right in the list screen. Each device need to provide a unique token to work properly.
Demo clip for everything has been done up to now:
ReferenceYou can read my whole post from here : wireless controlled power outlet
Comments