Power Strip

IoT Power Strip is a DIY device that allows to turn on/off two pairs of the outlet sockets via a Web browser through Wi-Fi.  It does...


IoT Power Strip is a DIY device that allows to turn on/off two pairs of the outlet sockets via a Web browser through Wi-Fi. 
It doesn't require any infrastructure besides the Wi-Fi enabled the device with HTTP browser (e.g.: smartphone, tablet, laptop). That means that you don't need some IoT server to be installed in your intranet (like MQTT server or Web Server), you even don't have to have internet access to operate the IoT Power Strip. 

The software features: 
* Operate secondary controller ports through Web Interface; 
* HTTP Server with optional authentication for 2 users; 
* Wi-Fi configurable through Web interface (both connecting to existing Wi-Fi network and creating a new Wi-Fi AP with the option of disabling AP on successful connection to Wi-Fi network); 
* In AP mode all the DNS queries are resolved to ESP8266 IP address; 
* Ports Control UI configurable via Web UI; 
* Send raw UART commands through the Web interface; 
* Built-in IDE for editing the software through

DETAILS
A year ago I decided to make a simple device with a web interface for reliably turning on/off a couple of mains sockets via Wi-Fi. I thought that ESP-01 (having GPIO0 and GPIO2 available), and 2-channel Relay Module would be enough for that, and with NodeMCU writing a software would be not a problem at all.


During the prototyping of the device, the set of requirements were expanded a little:

Wi-Fi shall be configurable through Web Interface (both Access Point (AP) and connection to another Wi-Fi network). Setting up Wi-Fi shall not turn on/off the mains sockets. Such a trivial thing like moving Power Strip from one place (with one Wi-Fi network) to another (with another Wi-Fi network or without it) shall not prevent re-setting Wi-Fi with the Web UI;
The device shall work even without Wi-Fi network available (detect it during startup, and turn on the AP where a smartphone can connect);
Some functions of UI shall be accessible to admin only, some - to the user (2 security roles); the credentials shall be configurable through Web UI;
Controls for turning on/off shall be configurable through a Web interface;
Web IDE shall exist for quick fixing / small enhancements. Web IDE shall work without Internet access (ad-hoc intranet created by ESP8266 AP shall be enough).

The requirements (especially the requirement about ports state reliability) influenced not only the software but the hardware.
At first, it turned out, that my ESP-01 instance may restart itself if I touch any wire (including GND and the output contacts of the relay module). I thought that there is something wrong with my ESP module, and replaced it with another one, but the second module behaved the same. After quickly browsing ESP-related Internet resources and checking the wiring, I found that I am probably unique to have this problem (it seems that ESP8266 just confused me with Mr. Bean, and acted accordingly).
Secondly, I found that the HTTP server can easily run out of memory when handling several requests simultaneously, and restart as the result (under NodeMCU 0.9.5 with about 22k of RAM available).
And last but not least, I didn't want the ports state to be changing when I will be playing with the software in runtime via Web IDE.
I hope that the reasons mentioned above answer the potential question you might have: "Why did you overkill the schema with the Arduino board in addition to the ESP8266 which itself could do everything?". IMHO an extra cheap Arduino Mini clone is a fair price for extra runtime hackability.

The project is open source, it is not hard to reproduce (especially if you own a 3D printer and necessary skills), and the components are achievable and relatively cheap.

COMPONENT NAME
Mains electric cable with plug
Outlet Box with 4 sockets, switch, and grounding
ESP-01 (ESP8266 module)
Arduino Pro Mini
2-channel Relay Module
5V Power Supply
ABS plastic, solder, rosin, low voltage wires, mains wires, a piece of Kapton, narrow heat-shrink

.

COMMENTS

Name

Arduino,2,Raspberry Pi,1,
ltr
item
Robokart: Power Strip
Power Strip
https://3.bp.blogspot.com/-JOLEhYspxu0/W2HfQ1TXgKI/AAAAAAAAAC8/T_330NxPArAMAx1U-TgaiL1BdaBvXMa3gCEwYBhgL/s320/charger-3285039_960_720.jpg
https://3.bp.blogspot.com/-JOLEhYspxu0/W2HfQ1TXgKI/AAAAAAAAAC8/T_330NxPArAMAx1U-TgaiL1BdaBvXMa3gCEwYBhgL/s72-c/charger-3285039_960_720.jpg
Robokart
https://blog.robokart.com/2018/08/power-strip.html
https://blog.robokart.com/
https://blog.robokart.com/
https://blog.robokart.com/2018/08/power-strip.html
true
2622452887334893503
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy