Why would you build a device to control your outlet? Why is it needed to be wireless and needed to use "RANGELESS"? Your conscience would ask.
We all have outlets in our homes. They literally power everything what we plug in there. However, we don't have full control over these. We still need to switch the planks off which will turn everything in our homes off. Or, destroy and open the outlet and remove the wires. Well, this device do switch one set of outlet on and off "Rangeless" wireless control. But why do we need to even switch them on and off? When sockets are off, the risks of electrical shock will be prevented. Another advantage of easy switching the outlet is that you can do a home automation which you can plug appliances with switches on so that when you switch the outlet, it turns on or off automatically without touching the appliance's switch.
In this instructable, we are going to use arduino pro mini as microcontroller, SIM800L Module as our communication to the network, Livewire Software as for schematics and lastly, Autodesk Circuits for our prototyping which is really accurate and good.
Step 1: Things You Need to Prepare
- Autodesk Circuits Account (Optional)
- (1) Arduino Pro Mini 5V
- (1)SIM800L GSM Module
- (1) FTDI Module Programmer
- (1) Cellular Network Sim (Local Network Provider)
- (1) USB AC-DC Adapter Charger (Phone Charger)
- (2) AC Female Sockets/Outlet (Local Electronic Store)
- (2Mtr) Solid Core or Simple Wire (Local Electronic Store)
- (1Mtr) Flat cable for 220V (Local Electronic Store)
- (2)5V 1 Channel Relay PCB Typeor at (Local Electronic Store)
- (2)Terminal Block (2 Terminal)or at (Local Electronic Store)
- (2) NPN3904 Transistor (Local Electronic Store)
- (2) 1N4007 Diode (Local Electronic Store)
- (2) 1K Ohm Resistor (Local Electronic Store)
- (2) 10K Ohm Resistor (Local Electronic Store)
- (2) 5mm Green LED's (Local Electronic Store)
- (2) PCB Through-hole 2x3 or 3x2 inches (Local Electronic Store)
- (1) Cardboard or any easy-to-cut materials (any size) (Local Department Store)
- Soldering Iron
- Glue Gun
- Marker or simply Pen
- Wire stripper & cutter
- Electrical Tape
- Portable Saw
Step 2: The Unique Power Supply (Module 1)
The Power supply is responsible for powering the whole setup in order to work. Without this, our project will be useless.For our power supply, we won't be using an expensive power supply box. We are going to use our Smartphone's USB Charger adapter. In completing these steps, you will get these materials from "Things you need to prepare" step:
- (1) USB Adapter Charger
- Solid Core or simple wire
- Flat cable for 220V
- Cardboard (Any Material)
First Step:Open up the case of your Mobile charger by cutting or sawing the plastic part of the charger to reveal the circuit board of the charger, and identify which is the USB port and the AC plug sockets. It is easy to identify which. The USB pins are where there are 4 consecutive pins and has USB port. The AC plug sockets are the ones that have two big pins soldered or inserted for other types.
Second Step: After identifying which is which, go to the USB port and look at the pins. When you look at the bottom with USB facing down, the VCC should be on the top right pin and GND on the top left pin. Now solder wires to that two pins mentioned. Now on the AC sockets, get your flat cable and do the same as the USB. Now there are no more VCC and GND in ac sockets because they are Alternating Current. Just solder directly the wires.
Third Step: Get any material. In my case I chose Cardboard. Measure your home outlet's dimension and transfer it to the cardboard. With it, align the adapter with the female part of the sockets. Make sure it aligns with the female ones. After, cut the part where the last paart of your charger occupies.
Last Step: Finally,glue your charger to the hole to hold it firm and permanent.
Step 3: Build the Main Circuit (Module 2)
The main circuit is where the Arduino Pro Mini, SIM800L Module, and the supporting circuit for relay can be found.The main circuit is responsible for receiving the text messages, processing the message and then sending command to the relay module to switch on or off. In completing these steps, you will get these materials from the "Things you need to prepare" step:
- (1) PCB Through-hole
- Arduino Pro Mini
- SIM800L Module
- Solid Core or simple wire
- (2) NPN3904 Transistor
- (2) 1N4007 Diode
- (2) 1K Resistor
You can also Prototype the main circuit (If you don't have trust on the Autodesk Circuit Simulator ;) ) by following the design I've made with the Autodesk Circuit which is the BEST ELECTRONIC SIMULATOR available online!
(NOTE: This prototype didn't include the Pro Mini version of arduino because I could not find it. BUT CONSIDER IT IN PROTOTYPING)
First Step: Get your SIM800L GSM Module, Arduino Pro Mini and PCB Through-hole. Position the two modules on the PCB according on how you are comfortable. You can just also copy mine :). Solder after the modules are being positioned.
Second Step: Now, Position the electronic components and solder. 1K Ohm resistor, NPN3904 Transistor and the 1N4007 Diode are in the list.
Third Step: Connect all the modules and components according to the schematics. (Strictly Follow) ;)
(And don't forget to insert a sim on the sim slot of the SIM800l Module)
Step 4: Build the Relay Module Circuit (Module 3)
The relay circuit is where the 2 relays can be found. It is responsible for receiving the command from the main circuit before switching the plugged power. In completing these steps, you will get these materials from "Things you need to prepare" step:
- (1) PCB Trough-hole
- (2) 5V Relays
- (2) Terminal Blocks
- Solid Core wires or simple wire
Here is a prototype of the Relay Module Circuit connected with the Main Circuit that I've made with Autodesk Circuits. In creating the final one, use the schematic above or download the PDF File as I've said.
(NOTE: The LED's in the prototype are just confirmation whether there is an electrical signal present in both relays)
First Step: Position the Relays and the Terminal Blocks and solder to hold firm. You may cut excess PCB spaces to make it smaller.
Second Step: Connect each parts according to the schematics.
Step 5: The Plugs
This part that we are going to build is where we can plug our desired appliance or devise to be switched "rangelessly".In completing these steps, you will get these materials from "Things you need to prepare" step:
- (2) AC Female Sockets
- Flat cable for 220V
- Electrical Tape
- Cardboard (Any Material)
First Step: Get that the same dimensions of your home outlet from the "Unique Power Supply" step and cut it the same as that.
Second Step: Align and center your female sockets by also aligning your home's outlet or make one yourself.
Third Step: Mark or trace the border of the female socket on what part of it should be inside the box. This will be your guide in cutting for the hole.
Fourth Step: Cut the traced line by a cutter or any cutting tool. Glue them to the cardboard or in the inside and make sure its pins fit in.
Last Step: Solder wires from each pin using flat cable which is made just for its type. To protect it, cover it witch electrical tape or a big enough shrinking tube.
Step 6: Connecting Each Modules
In order to make everything work, let us connect each modules to distribute the data and power.
First Step: Get the modules you've made The Power Supply with the cardboard, Main Circuit and Relay Circuit Module.
Second Step: Place the main circuit on top of the power adapter and glue beneath it. You have the two wires from the USB port of the USP adapter. Plug the VCC wire to the VCC pin of the Pro mini. Do also the same thing to the GND. You can either Solder or plug if you soldered female headers unto it.
Third Step: (Refer to Schematics) Now on the top of the Main Circuit, place the relay module and glue beneath or from its sides. From the Schematics, A relay has a coil which has 2 pins. solder the wire from one side pin from the coil of the relay to the Emitter pin of the NPN Transistor, and the other pin of the coil to the diode which is connected to VCC (5V). (Do also to the other relay)
Fourth Step: (Refer to Schematics) After you have done your connections from the circuits, now to the sockets and main power source. Get the two wires soldered from the AC Sockets of the charger and lock it in the Power Source Terminal Block with screw. When done, get the wires from the 2 AC Female sockets. Each socket has 2 wires. get the first socket's wires and lock it with screw in the First Socket Terminal Block. Do also the same for the 2nd socket, but connect its' wires to the Second Socket Terminal Block.
You are done with all the connections!! :D
Step 7: Testing & Uploading the Code
Before finishing up its case and putting the up together forever, it is important to check first whether all the connections work. (MAKE SURE THE NET LED IN THE GSM MODULE BLINKS SLOW AFTER THE FAST ONES. IT TELLS YOU THAT IT IS CONNECTED TO THE NETWORK)
First Step: Try first powering it up using the FTDI Programmer Module to check whether all of the modules work. When it did, Go to the next step.
Second Step: Download the SIM800L Library that I've found which was written by Cristian Steib. Extract the zip file and a folder will come out. Rename the extracted folder to "Sim800l" and transfer it to the libraries folder of the Arduino. Usually it is found in C: Drive.
Third Step: Download the Arduino code, Open the file, select your COM Port and Arduino Pro or Pro Mini to the selection of boards and upload.
Last Step: Try to text something to the number of the inserted sim. It should display the message being sent in the Serial Monitor. Try to text the commands
- SWITCHONPLUG1 -- To turn on the switch of the first plug.
- SWITCHOFFPLUG1 -- To turn off the switch of the first plug
- SWITCHONPLUG2 -- To turn on the switch of the second plug
- SWITCHOFFPLUG2 -- To turn off the switch of the second plug
Step 8: Finishing It Up (You're Done!)
After finishing all the steps, the only thing left here is to finish its case. In these steps, we're going to finish everything.
First Step: (Sides) Measure the distance between the cardboard of the power adapter and to the female sockets' cardboard, and get the height of your home's outlet. Transfer the measurements to the chosen material and start to cut, position and glue.
Second Step: (Top & Bottom) Measure the distance between the cardboard of the power adapter and to the female sockets' cardboard, and get the width of your home's outlet. Transfer the measurements to the chosen material and start to cut, position and glue.
And.. Enjoy texting your outlet to tell them to switch on and off. You can modify by the way the project. Just give credits. Enjoy, stay creative and God Bless :)