Control the Lights in Your Room or House From Your Android Phone!
by kf7oor in Workshop > Lighting
6017 Views, 89 Favorites, 0 Comments
Control the Lights in Your Room or House From Your Android Phone!
WARNING!!! THIS DIY PROJECT REQUIRES YOU TO WORK WITH 120V AC!! BE CAREFUL!!
*KF7OOR ASSUMES NO RESPONSIBILITY FOR ANY DAMAGE TO PERSONS OR PROPERTY DUE TO THIS INSTRUCTABLE OR ANY MODIFICATION OR USE OF THIS INSTRUCTABLE*
*THIS IS MEANT FOR NO MORE THAN 200W (100W PER OUTLET) USE AC FUSE RATED 1.5A*
Want wireless control of the lights in your room, house, or even your office? I will show you a quick and easy way to do so using a SPLat EC1 programmable logic controller. NO prior programming experience needed!
What you will need:
The SPLat EC1 PLC
1 Bluetooth Serial Port Module for Arduino
1 or more 12v coil 120v relays
1 npn transistor for each relay
1 1000 ohm resistor 1/4W for each relay
1 or more wall outlets
1 male AC plug
AC fuse rated 1.5A
Wire *must be capable of conducting 1.5A or more and insulation for 120vAC*
wire cutters
solder
soldering iron
hot glue gun
shrink tubing
something to mount it in. *an enclosure is highly recommended*
female header plugs
5v regulator (in this case i use the LM317T and tune it to 5v)
9v - 12v ac adapter (anywhere in between)
Android phone or devise with Bluetooth
A computer running SPLat/PC, the free SPLat programming environment (IDE)
And finally some miscellaneous hardware (nuts bolts)
Now lets get started!
Prepare the Enclosure
First lets start by cutting out a rectangular hole to fit our AC outlet. Make sure to leave space for the mounting bolts (I did not use bolts instead I used epoxy)
You can mount it on now or later but I decided to do it now to the the epoxy set
Now we will need to put a notch it the bottom part of the box were out AC cord will go in
DC Power Supply
Now lets grab that AC-DC converter and pop it open as shown. We will take the circuit board all the way out and cut the wires that are soldered to the male plug.
Next lets strip all of out wires including the power cord we intend to use for the main power.
Attach the Main Power Cord
We can now twist together and solder the power cord to the power input and attach an extra wire to supply the outlet with power then using some shrink tubing completely cover each soldered joint individually as not to short the wires then if necessary shrink both together with another piece of shrink tubing.
Replace Short Wires
If you have short wires for the 12V output you may want to replace them with longer ones but also remember what is positive and what is negative!
Regulator
You can use any pre made 5V regulator to power the EC1 however I used the LM317T variable regulator and tuned it to 5V
Program the EC1
Make sure you connect the BT module in the correct order as the order on the EC1 is not the same as on the module, then plug the EC1 via USB to your computer running Splat. Once you have connected to the EC1 you may either manually input the program from the photo or download the file "bt lights" then in the file menu click Translate for module and then Download to module and unplug the EC1.
To learn how to connect the BT module click here
If you would like to modify the program yourself you can visit the SPLat easy steps here.
Downloads
Put It Together
Now we can start to glue our parts into the enclosure, I started with the power supply then placed the regulator next to it. Then I placed the EC1 below them in order to keep it away from were the outlet will be. Next put the BT module in a fairly convenient spot. Now we can connect our power supply to the EC1s power input pins as shown.
*NOTE* I did mix up the colors of the two wires when soldering them so Blue is + and Yellow is -
The Relay
Now we must assemble the relay and its trigger. I glued an NPN transistor to the relay and soldered the Negative to its input, a 1000 ohm resistor to the trigger and a female header to the resistor to be connected to the EC1. then one of the coil leads from the relay to its output. then solder a wire from 12V to the other relay coil lead. we can now connect the female header to the EC1 pin 28 witch corresponds to output 1.
Now connect ONE of the AC wires to the input to the relay and solder another short wire to the output of the relay
The schematic for the relay assembly is shown above.
Connect the Outlet and Seal It Up
Finally we can ad a crimp connector to the two remaining AC wires and connect them to the outlet! Then all we need to do is seal up the box and plug it in!
Go ahead and download the SimpleHMI App and connect to the Bluetooth module, If you are having trouble you can refer to the "My first sample app" on the SPLat website!
Enjoy And fallow me for more cool SPLat based projects!