Introduction: 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.

Step 1: Parts and Tools Required :

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

Step 2: How It Works ?

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.

Step 3: Preparing the 12V Supply

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.

Step 4: Main Board

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.

Step 5: RGB Board

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.

Step 6: Prepare the Enclosure

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.

Step 7: Fix the Sockets

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.

Step 8: Prepare the Power Cord

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 )

Step 9: Electrical Wiring

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.

Step 10: Mount All the Boards

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.

Step 11: Connect All the Modules to the Main Board

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

Step 12: Arrangement for Indication

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.

Step 13: 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.

Step 14: Close the Enclosure

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.

Step 15: Testing

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 !!!

Comments

author
ÁlvaroG56 (author)2016-11-28

Could the bluetooth receiver substituted by a wifi module to use it with IFTTT or Alexa?

Thanks man, nice tut!

author
Mjtrinihobby (author)2016-04-21

Most excellent! I love this project.

author
sameerfarooq (author)2015-12-07

Hi!deba will this work with hc-05 Bluetooth module??Secondly, is there any mobile model exceptions??

author
JamashG (author)2015-10-14

sir can we do the same project with avr programming?

author
Gursimran Singh 425 (author)2015-10-11

I made it with help of my father, he too is electrical engineer and it is working!! :-)!! Voted!!!!:-)

author

Great..

thanks

Chears dear :)

author
AniketR2 (author)2015-10-05

hiiii......please snd me the coding of two power outlets you used in this project..its very important please........E-mail - machanicalbaccha@gmail.com

author
AniketR2 (author)2015-09-29

hiii.......I wanna connect atleast 6 3-pin power outlet wid arduino paired with HC-06..please help me wid the code........really a lot confused....my E-mail is - machanicalbaccha@gmail.com.

author
kennethanya (author)2015-09-13

i really appreciate seeing this project

author
deba168 (author)kennethanya2015-09-13

Thank You

author
mlakhwani (author)2015-09-07

nice project ...

but,can we use esp8266 in place for bluetooth ... so that it can b controlled over LAN??

author
deba168 (author)mlakhwani2015-09-07

Thanks

You are right.But to do that the user must have internet connection at their home :)

author
mlakhwani (author)deba1682015-09-08

yes a LAN connection is must but it would be really amazing... can we use 8 channel 12v relay(with it's own external power source.

author
mlakhwani (author)2015-09-07

thanks for replying ... hope to see more interesting projects in future... this was really very informative.

author
timothybil (author)2015-09-06

1. You did not show connecting the RGB strip to the control box.

2. Why would you not fuse the electronics as well as the load outlets?

author
kavish laxkar (author)2015-09-04

hmm nice to be a such cool stuff from INDIA.:) HaPpy with that.:)

Keep going ON..!!

Regards Kavish.

and ya i will try it soon .:)

author
deba168 (author)kavish laxkar2015-09-04

Thanks kavish

author
kavish laxkar (author)deba1682015-09-04

let me know deba..i want to control my fan and tubelight with just bluetooth..not RYB light..in dat case this code will work.?

author
deba168 (author)kavish laxkar2015-09-04

Yeah it will work.No need to change anything in software.

author
kavish laxkar (author)deba1682015-09-06

gr8 deba..can i just add u on fb..for sake of contact.?plz

author
Gursimran Singh 425 (author)2015-09-05

WOW! that's awesome ! keep up the work! thanks a lot bro!

author

Thanks

You are also doing well :)

author
jimsims (author)2015-09-04

I have been following your projects for some time. This is the best by far. Very impressive young man with a fantastic future.

author
deba168 (author)jimsims2015-09-04

Glad you like work.

author
aghosh15 (author)2015-09-04

u could use es8266 module (wifi module) then u cn cntrl it whn out side home also

author
deba168 (author)aghosh152015-09-04

I know this.Anyway thanks for suggestion :)

author
Saiyam (author)2015-09-03

This is such a useful idea!!

author
deba168 (author)Saiyam2015-09-04

Thanks Saiyam...

author
Seeed Studio (author)2015-09-03

nice project!

author
deba168 (author)Seeed Studio2015-09-04

Glad you like it :)

author
nqtronix (author)2015-09-04

Even though I've seen the idea before (granted, the other projects were without RGB strip capabilities), this is by far the best execution. The attention to detail (such as the cable ties and orginized interior) are outstanding. You've done a great job!

The only thing I'd suggest is adding a strain reliev to the mains cable, this can be as simple as adding a knot to the end.

author
deba168 (author)nqtronix2015-09-04

Thanks
I will make it soon.

About This Instructable

36,075views

551favorites

License:

Bio: I am an Electrical Engineer.I love to harvest Solar Energy and make things by recycling old stuffs. I believe ""IF YOU TRY YOU MIGHT ... More »
More by deba168:DIY Acrylic RGB LED SignHow to Make a Bench Power SupplySolar Powered WiFi Weather Station
Add instructable to: