SMART POWER OUTLET

by opengreenenergy in Circuits > Arduino

48297 Views, 560 Favorites, 0 Comments

SMART POWER OUTLET

55e8a5e82e7fb6641a0000ed.jpeg
55e8a42c4fbaded8ac0000e9.jpeg
55e8a38345bceb90c8000100.jpeg
Smart Power Outlet

[ Play Video ]

Hi, welcome to my new Instructable on Home Automation.

This project was started to solve some common problems faced by everyone. Imagine it is a cold winter night,you are reading a novel on your bed, before going to sleep. After reading few pages,you are feeling drowsy and your eye getting closed.Oops! your room light is still on,but you have no more interest to wake up and go near to the power outlet.Then obviously you will want to do it from your bed.But how can you do it ? Don't worry your Smartphone will do the job.

In this tutorial, I will show you how to make your smart power Outlet by using an android smartphone and Arduino. This requires you to have no experience of android programming at all, as a free third party application will do the job.Though this project was started to control my bedroom light,but later I added some more interesting features on it.

Features :

1. Turn on or off lights, fan,air conditioning and other appliances in your room

2. Control a RGB led strips

3. Gather sensor data ( and create thresholds or alarms that react to that data )

Thanks to techbitar and InfidelFish for the inspiration to remix their ideas.

You can find the original projects from the link given below.

1. ArduDroid: A Simple 2-Way Bluetooth-based Android Controller for Arduino

2. Arduino Home Automation (Bluetooth)

Disclaimer: This project works on AC 230V which is quite dangerous and anything wrong may kill you. I will not responsible for any damages to the equipments or loss of life. Make this at your own risk.

Parts and Tools Required :

55e32ba6937ddba8e6000b30.jpeg

Parts Required :

1. Arduino Nano ( eBay )

2. Bluetooth Module - HC 06 ( eBay )

3. Relay Module (eBay )

4. 12V /2A smps ( eBay )

5.Buck Converter ( eBay )

6.Transistor TIP31C (eBay )

7. LM35 temperature Sensor ( eBay )

8.Headers pin ( eBay )

9.AC Socket

10.AC Plug ( eBay )

11. 3 Core Wire

12.Fuse Holder and Fuse ( eBay )

13. Screw Terminal (eBay )

14. 1K resistor

15. Perforated Board ( eBay )

16. Plastic Enclosure

17. Duct Tape

Tools Required :

1. Dremel

2. Drill

3. Hot Glue Gund

3.Ruler

5.Vernier Caliper

6.Wire Stripper/Cutter

7.Soldering Iron

8.Screw Driver

How It Works ?

anroid _arduino.jpg

The Smart Power Outlet project is based on “ArdudDroid ” . This application controls the various appliances connected to your arduino and relays. When the buttons( digital pins) on the apps are pressed, corresponding Bluetooth signals are sent from your android phone to the Bluetooth module (HC06 ) you have hooked up to your arduino. The arduino finds out which signal was sent and compares it to the predefined signals assigned for each appliance. When it identifies that signal, then the arduino activates the relay hooked up to its digital pin by passing 5V through it. Thus the relay is switched ON and the corresponding appliance connected to the relay is turned ON as well.

The apps have slider for all the arduino pwm pins.We can send signal from the apps to change the duty cycle of arduino pwm pins.The RGB strips is controlled by giving 3 PWM signal from the arduino.To carry more current a transistor based driver is used.

The apps also have option to read the value from Arduino analog pins. To use this feature a LM35 temperature sensor is hook up to arduino pin A0.When user press the button,it will show the room temperature.

Preparing the 12V Supply

IMG_20150902_082418.jpg
55e88a0445bceb90c8000062.jpeg
55e88a5150e1b6cef3000034.jpeg
IMG_20150902_083038.jpg
55e88a4d937ddbecfd00002e.jpeg

Our mains AC supply voltage is 230V. The arduino board,Bluetooth Module,Relay module and RGB strip need DC Voltage .The RGB driver needs 12V and all other board requires 5V.To do the job we have two options

1. Step Down transformer and bridge rectifier

2. SMPS

I choose the second option, because I had so many unused 12V adapter in my stock.I will suggest this because

it is efficient,lighter and cheaper.You can easily get a ready-made SMPS from the market.

First identify the weak spot somewhere along the seams, and pry until the pack pops open.I carefully insert a screwdriver blade and twist to separate.

Mark the input and output terminals by a marker. Do not for get mark the polarity at the output.

Then cut the wires connected to the terminals.

Main Board

Arduino_Blutooth.png
55e32b134936d4a98e000725.jpeg
IMG_20150830_085556.jpg
IMG_20150830_085734.jpg
IMG_20150830_090315.jpg
IMG_20150830_094807.jpg
IMG_20150830_105039.jpg
IMG_20150830_092901.jpg
55e90b854936d4f60c00032b.jpeg

The main board is consists of an Arduino Nano board,a dc-dc converter and header pins for different modules

( Relay,Bluetooth,sensor,RGB) connections.

We can feed 12V supply from smps directly to the Arduino. But all the other modules work on 5V DC.So a separate DC-DC buck converter is used .

First cut the headers for Arduino Nano,and other connections.Then solder it as shown in the pictures.You can use duct tape to hold the headers during soldering.It will save a lot of time.

Then make the connections as per schematic.

For 12V power input solder a 2pin screw terminal.

RGB Board

RGB_Driver.png
55e32d442e7fb6d4ab000a99.jpeg
IMG_20150830_105639.jpg
55e32d76937ddb5c2700038d.jpeg
IMG_20150830_110900.jpg
55e90b0b937ddb1305000323.jpeg

The current and voltage form the arduino pwm pin is not sufficient to drive the RGB strips.So a separate power source and driver is required for it.

The driver circuit is made by 3 TIP31C NPN transistors and 3 1K resistors.

First solder the 3 transistors and resistors

Then solder the screw terminal and input/output headers.

Make all the connections as per schematic.

The input headers is 4 pins ( GND,R_PWM, G_PWM, B_pwm ) from the arduino.

The output headers is 4 pins ( 12V,R_PWM, G_PWM, B_PWM) to the RGB strips.

The screw terminal is used for 12V power input.

Prepare the Enclosure

IMG_20150902_083450.jpg
55e8a8484936d4f60c000116.jpeg
55e8a86e4936d4f60c000117.jpeg
IMG_20150902_085041.jpg
IMG_20150902_085228.jpg
IMG_20150902_091416.jpg
55e8a9a245bceb90c8000127.jpeg

First measure the socket size by using a vernier calliper or by ruler.

Mark the outlines on the enclosure by using a pencil and ruler.

Cut out the marked portion by using a Dremel Rotary tool.

Finish the edges by a hobby knife.

Make holes for power cord , fuse and RGB strips connector.I used my cordless drill to do the job.

Fix the Sockets

IMG_20150902_085406.jpg
55e8a9cc4fbaded8ac000108.jpeg
IMG_20150902_085938.jpg
IMG_20150902_090248.jpg
IMG_20150902_090542.jpg
IMG_20150902_090708.jpg
IMG_20150902_090719.jpg

Insert the Sockets in to the prepared slots. Keep the socket side by side and aligned them.

Drill holes for mounting.I used 3mm drill bit .

Then screw the bolts provided with the sockets.

Prepare the Power Cord

IMG_20150902_095614.jpg
IMG_20150902_113733.jpg
IMG_20150902_114323.jpg
IMG_20150902_100108.jpg

Use a 3 core insulated cable for making the power cord.The length of the cable is your choice.

Strips out the insulations at both the ends.I use my leatherman ( got it as prizes from Instructables) to do the job.

The 3 wires are colour coded.

Red -> Line

Black-> Neutral

Green -> Earth

Connect the 3 wires to the 3 pin power plug.( It will goes to your Mains Outlet)

Insert the other end in to the holes made earlier.

The 3 wires are connected to a 3 pin terminals ( it will provide connections for SMPS )

Electrical Wiring

55e90c4e67400cee9f00030b.jpeg
55e8a9f92e7fb6040c000088.jpeg
55e8aa23937ddb130500013b.jpeg
IMG_20150902_103321.jpg
IMG_20150902_105228.jpg
IMG_20150902_105702.jpg
IMG_20150902_110322.jpg

Insert the fuse holder to its slot made earlier.Then tighten the nuts and washers.

Connect the neutral pins and earth pins of the two sockets by a black wire and and green wire.

Join two pieces of red and black wires.

Insert it to the corresponding pins of the screw terminal and screw them.

Connect a piece of green wire for earth connection.

Out of two red wire one goes to SMPS Input and other goes to one terminal of the fuse.

Out of two black wire one goes to the SMPS input and other goes to the socket neutral.

Make the other connection as per line diagram.


Alert : Be careful during the wiring.Anything wrong may damage your appliances.

Mount All the Boards

55e8aa412e7fb6641a000104.jpeg
IMG_20150902_111655.jpg
IMG_20150902_111826.jpg
IMG_20150902_112659.jpg

First arrange all the boards.

Apply hot glue at the back side of the boards and stick it on the enclosure.

Hold it for sometimes, until it will dry out.

Then use cable tie to bind wires bunch.

Connect All the Modules to the Main Board

IMG_20150902_114637.jpg
IMG_20150902_114642.jpg
IMG_20150902_114627.jpg

First connect all the modules Vcc and Ground to the power rail.Use female-female jumper wires making the connection.

5V-----------> Vcc
GND--------->GND

1. Blue Tooth Connection :

Arduino --> HC06

Rx-------------> Tx

Tx--------------> Rx

2. Relay Connection :

Arduino ---->Relay Module

D2 ----------> IN1

D4----------->IN2

3. RGB Board :

GND- > GND

Arduino---> RGB Driver Board

D6-----> R

D9------>G

D11-----> B

4.LM 35 Connection :

Arduino ---> LM35

A0------> Out

Arrangement for Indication

IMG_20150903_083338.jpg
IMG_20150903_083350.jpg
IMG_20150903_083754.jpg
55e90e4145bceb3ede00014e.jpeg

You do not need any separate LEDs for indication as all the modules have inbuilt led.Apart from these we need only two important indication.One is power and other is Bluetooth connectivity.

Power Indication : We can use the SMPS led for power indication.Drill a small hole (just above the SMPS led ) on top cover of the enclosure.

Bluetooth Connectivity Status : Make small hole on the side wall of the enclosure.Mount the Bluetooth module in such a way that the on-board led will coincide with the hole.I used duct tape to mount it.

To make the light diffuse, I used wax tap in the back side of the holes.

Programming

Download the code attached below.

Connect the Arduino Nano to your PC/Laptop through the USB cable.

Open the Arduino IDE.

Select Board as " Arduino Nano" and port no " XX " ( XX : com port no to which the hardware is connected )

Upload the code.

Downloads

Close the Enclosure

55e8a9a567400cee9f00011b.jpeg
IMG_20150903_085706.jpg
IMG_20150903_085805.jpg

Carefully arrange all the connections wires inside the enclosure then close the top cover.

Screw the all the screws.

Stick any attractive sticker on the top cover.I stick a Skull sticker, which I was got from Hacakaday.

Testing

55e8a9c84936d4012e000095.jpeg
55e8a9e54936d4012e000096.jpeg
55e8aaff2e7fb6641a000107.jpeg
55e8ab1945bceb3ede00009a.jpeg
55e8ab5815be4d8e62000113.jpeg

Plug in the power cord to the mains outlet.

The power indication led on the top will confirm that power is coming to the smart power outlet.You can also notice blinking of led on the Bluetooth module (HC-06).

Download the app from Play store and then installed it.

Open the app and pair it with the HC-06.In the first pairing it will ask password.Use "1234" or "0000".

After successful connection ,the blinking led on HC-06 will glow constantly.

Now touch different buttons to operates your devices.

Have fun with this DIY hacking tutorial!

If you enjoyed this article, don’t forget to pass it along!

Follow me for more DIY projects and ideas. Thank you !!!