Control: Sonoff Power Strip Hardware
Sonoff Power Strip
Hey guys Matt here from MKSmartHouse.com and in this video I am going to be doing a complete guide to connecting and setting up the Sonoff.
In this video I am going to be using a Sonoff dual but you can apply the same concept to other Sonoff devices. For those of you who don’t know the Sonoff dual is a smart device that can control the AC power flow to devices or in the case of this video outlets. Yes that is right I am going to be using the sonoff dual with outlets to make a smart power strip. I should note though that this is not the power strip I normally use because the one I use is a little bit more DIY and with mine you can control three outlets. I will be making a video on my power strip very soon. But, the power strip we will be making in this video is great for if you want to control only two things. I should also note that in this video we will be connecting wires that will be used for high voltage but, if you follow along with my video exactly then you should be fine. Just as a disclaimer I am not responsible for anything you do. One last thing before we get started and that is for this video we will be using the stock firmware that comes with the sonoff but, in the next video we will be installing our own custom firmware that will connect to our OpenHAB server through MQTT.
Alright let's get started. The first thing we are going to do is go over the parts we need to make this smart power strip. First up on the list is a 14 guage power cable and we are going to use this to connect the Sonoff and the oultets to power you could use a power cable that you have laying around just make sure it is 14 guage and has ground. Next to connect the outlets to the sonoff and ground we need 14 guage stranded wire in Black, white and green, I chose those colors because they are the same colors inside the power cable. Next to house everything we are going to use a 3 gang electrical box preferably an extra deep one so you have more room to work, then to interface with the and connect devices to it we are going to use two electrical outlets, since the sonoff does not have a ground port we are going to need a 3 port push in wire connector to connect all the grounds together, to close off the power strip and give it a nice finish we are going to need an electrical cover plate, I am using a cover that you can choose the pieces for and put it together to make 1 big cover. Then finally we are going to need the star of the show and that is the sonoff dual, this is the device that will be the brains of the power strip. As you may have noticed that the electrical components that I showed are for US electric but you can do the same thing even if you are not in the US simply just replace the US electric with your country's electric components, standards and wire colors. So please research a little bit about your countries electric code before you continue. Next let’s move onto the tools we will need. We are going to need wire cutters, wire strippers, a phillips screwdriver and a small flat screw driver. I will leave links to all the parts and tools over on my website, the link is in the description.
With the parts and tools out of the way let's get started. To start off let’s take the Sonoff out of the box. It comes in a very nice blue box which on 3 sides it just says sonoff, on 1 side is some barcode, on another side is the specifications, and finally on the back is QR codes to download the app for it. To open the box you just pull out the flap on the side. Then you can pull out the Sonoff which is the only thing inside the box. Now let’s take a quick tour around the sonoff. On the front you will find a button and some information such as the wiring inputs. Then on the rest of the device is just blank white space. But if we go back to the front and remove the cover we will find the wire ports.
Next grab the 14 gauge power cable and strip off some of the black insulation. To do this use the blades on the wire strippers to score the black insulation and sort of twist the black insulation free and remove it from the cable. Then if your power cable’s leads are not stripped then strip them to expose the copper. Next take the electrical enclosure and stick the power cable through one of the holes. I used a screwdriver to push the flap up a little so I can stick the cable in easier. Once it is in pull it so there is maybe about 10in inside the enclosure, this is to make connecting the sonoff easier which is the next thing we are going to do. So grab the power cables and first connect the black wire or in other words the live wire into the Input L port on the sonoff. To connect the cables into the sonoff take the small flat screwdriver and push down on the white button and then slide the cable into the hole. Then take the white or neutral wire and put it in the port labeled N. Now we have one wire left and this is the green ground wire. There is no where to connect this on the sonoff so take the 3 port push in connect and push the green wire into it, we will also push the outlet ground wires into it later. Great, now the sonoff is connected to the power cable. Next grab your phone it could be Android or ios and go to the app store. In the search type in eWeLink and press search then click install next to the one with an e in the icon. Once it is installed open up the app. Allow it to send notifications and on the screen press next. After that it will ask you to log in, if you have an account then log in otherwise like me you will press register. First enter your email address and press next. On the next page enter the verification code they sent to the email address you typed in previously, and type in a password 2 times and press register. It will say “Registered successfully, press OK. It will then bring you back to the log in page where you will log in with email address and password you used in the registration procces and click log in. Once you are logged in it will bring you to the devices page, where you will click on the plus button to add a device. Next plug the power cable into your home’s power. You should see some lights come on in the sonoff that means it is powered on! Next hold down the button on the Sonoff for 7 seconds or until the light starts flashing rapidly on it. Now go back to the mobile device and choose the option that says AP and press next. Now exit out of the app and go into your settings and then wifi. Click on the device that says ITEAD and some letters and numbers. It will then prompt you for a password, type in 12345678 and press join. Once you have connected to the device go back into the eWeLink app and click next it should then automatically load your wifi network, it takes to closest wifi network to that device, if the one loaded is not your wifi network then type your wifi network in. In the password field type in the password for your wifi and press next. The device will now try to connect to your wifi network. Once it is done it will ask you to name the device, I am going to keep it how it is and press complete. It will then say “Added successfully” press OK. The device is now added! You can try out the device by turning on and off channel 1 and channel 2. You should hear clicks come out of the device. Awesome the device is all setup! Now lets finish this up and put it all together. But. before we continue unplug the power cable from your home’s power. Next grab the rolls of 14 gauge stranded cable and cut two pieces of 12 inch cable from each roll of each color. So you should have 2 12 inch pieces of black white and green wires. Then grab the wire strippers and strip all the ends of all the wires to expose the copper. But, on one end it should be stripped according to the specifications for the outlets you will be using. For example on my outlets it gives a little template on how long the expose copper should be so, I stripped it to that. Then on the other side it should be stripped half an inch or a little bit more than 1 centimeter. Once all the wires are stripped we will begin to connect them to the outlets. So grab an outlet and a green wire. For all the connections on the outlets use the side of the wire that was stripped to the specification for the outlet. First take the green wire and twist the copper part, so it is more together and more solid. Then take a screwdriver and wrap the copper part of the wire around the screwdriver to make it into a hook. After that grab the outlet and hook the green wire around the green screw of the outlet. Using the philips screw driver tighten down the screw as much as you can to make a really secure connection. Then take the white wire and just like the green wire twist the copper part and wrap it around the screw driver. But, unlike the green wire hook it over the silver screw, on the outlet it should say white wire on that side and using the screwdriver tighten it down as much as it allows. I also like to screw down the other unused silver screw so that way it is not sticking out. Next take the black wire or live wire, twist it and wrap it around the screwdriver. Then hook it onto the gold screw and tighten it down. Like the silver screw I like to screw down the unused gold screw. Awesome! This outlet is done! Now repeat the same process for the other outlet! Once both outlets are done we are going to connect them to the sonoff. First grab the sonoff and one outlet. Then take the white wire and connect it to the Port labeled N on the sonoff. Next take the black wire from the outlet and connect it to the port labeled Out1 L on the sonoff. Now we are left with the ground wire so push it into the push in wire connector. After that Grab the next outlet and connect it the same way, white wire into the N port except connect the black wire into the Out2 L port on the sonoff. Also, push the green wire into the push in wire connector with the rest of the ground wires. All of the wiring is now done! All that is left is to tidy everything up! Grab the wire cover for the sonoff and screw it on using the philips screw driver. Then pull the power cable back out of the blue enclosure so that way there is no extra black cable inside and so the sonoff is sitting nicely inside at the bottom. After that take one outlet and twist it along with the wires and slightly screw it into the enclosure. The reason we twist it is to shorten the wires and make them more compact. Then take the other outlet and do the same thing. Once both outlets are in you can align them and tighten their screws down. As you can see if we take a look everything is all nice and tidy inside the enclosure so let's close it all up. Take the pieces for the plate and put them together to make a nice big plate. Then take the plate and test fit it over the outlets, you may need to adjust the outlets, luckily I did not have to. My blank plate required a metal riser so I screwed that into the empty spot. Finally take the plate and using the white screws that come with the plate screw it into the enclosure. Great! The device is now done, let’s test it out! I first plugged the power strip into my home’s power and the connected lights into each of the outlets. As you can see if I turn on each channel each light turns and the same thing is for if I turn each channel off. Awesome! The power strip is fully complete and working! In the next video we will be flashing custom firmware to the device so it will work with MQTT and our openHAB server. I would just like to mention again that all the links to all the materials and tools are available on my website which the link to is in the description. Alright thank you for watching and If you have any questions leave them in the comments section below or head over to mksmarthouse.com/forum. Good Bye!