Voice-controlled technology is definitely a hot trend right now. Inevitably I fell for it and bought an Amazon Echo Dot myself when it went on sale. Ever since I got it in November I have been wanting to make a project with it. While searching online, I came across this amazing Git: https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch
The author basically emulated an wemo switches that costs 70 bucks and it’s never fun to buy something if you can make them on your own. Upon quick calculation, I decided that I can make my own version of voice controlled switches for less than $20 AND it would be an expandable architecture.
Main components used for this project are:
Power Socket Plugs: https://www.amazon.com/Pins-Power-Socket-Plug-Black/dp/B008J80J1A/ref=pd_cart_vw_2_1?_encoding=UTF8&psc=1&refRID=WSVRBSMHZW9CACSK89WT
8 Channel Relay Module: https://www.amazon.com/gp/product/B00R77PN1A/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1
Spare Power Supply (we only need the wall plug portion), 5A fuse +fuse holder, Snap-fit Socket Case
The idea is to use the wifi-enabled NodeMCU board to control relay switch to allow/cut off power from wall plug to the power socket. Since I alraedy have the emulator from the existing Github libraries, with a little modification, I was able to fit the Github source code into my specific application.
I separated this project into two parts. Hardware (without voice vontrol) and software (with voice control).
I started by testing the relay with an Arduino Uno since the code is very straight forward. (simply digital write to high for the GPIO pin).
I noticed the rating for the charger that I cut off was for 5A 125V. Since the relay rating is 10A 250V, I know the limiting factor here is the wall plug portion. In addition, I could only found stranded wires of gauge of 20. Ideally I’d be using wires of 16 Gauge for 3-5A usage. Since my main goal is to charge an iphone/small electronics, the power consumption is in a safe zone.
After successfully controlled the relay switch, I moved on to soldering and wiring all the electrical components. I cut off a spare power supply I had to use the wall plug portion of it. Here is a initial test video with a wired circuit for charging my friend’s phone with Arduino.
Now that the backbone has been built and successfully tested, I will start making things a bit better. First I CADed up some quick socket case with little extrusion that can snap fit on the power socket. I 3D printed it and it fits perfectly. I was taking the socket in and out just to hear that crisp snap sound (also a testing to see if the material is too fragile).
I also put in a 5A fuse to the circuit as a preventative act.
Software Portion (with voice control):
Now is time to incorporate the actual echo voice control. With some tweaking of the code from Github, I was able to successfully charge/stop charging my kindle. (I called it “phone charge” although later I realized I can’t video tape my own phone screen). Something interesting with the code though is that it seems like I can not get rid of the “light” invocation. Will have to dig further into the libraries to understand how to change this part. Below is a video of the result. Pay attention to the change of the battery bar on the kindle screen.
Since this is a personal project purely for experiment right before I am moving to Texas, I do not have time to implement multiple sockets. In the future, I will purchase actual wall plug powers like these instead of cutting power strips apart: