Introduction: Turn on and Off Your Things With a Laser!
There are already some great projects around here about hacking home automation systems, but what I wanted to do was to control my plugs creatively.
Thats why I decided to do this. To have the most functionalities possible I put a arduino inside the plug switch.
This way it was possible to add a light sensor to the plug and program it to turn on and off what is connected to it using a laser.
It just compares the last three reads and, if the second value is bigger than the first and the third one, it turns on/off the plug.
Here is a demonstration:
WARNING:
In this project it is required to open a device which has 220V in some parts, so be careful!
I'm not liable for anything stupid you do.
Step 1: Gather the Materials
- Home Automation System Switch
- Arduino - I decided to make one, but you can use any other
- 4N25 optocoupler
- 220 Ohm resistor
- LDR
- 10k Ohm resistor
- LED
- 220 Ohm resistor
-
Wires
Step 2: Open Your Plug
Start by opening the thing, then have a look and try to find what does what. The best way is to find where the pushbutton is connected to the pcb and see if there is anything written there. In my case it was indicated the GND wire and the other one.
If you want you can just connect these two wires to the 4N25 and just simulate the button this way. I preferred to keep looking, find the 5V and let the arduino directly control the relay.
Step 3: Solder the Wires
The technique I used wasn't the most conventional one, but worked which was all I wanted.
I just soldered the two wires to the board's original built-in microcontroller correspondent legs.
Step 4: Connect the Plug to the Arduino
To let the arduino control the plug without having to share grounds I used a 4N25 optocoupler. Two legs are connected to the arduino and other two to the plug.
The optocoupler basically consists of a LED and a phototransistor, the two circuits never touches each other.
Step 5: Add the LED
Connect to the arduino the LED which will show if the plug is on or off.
It is a basic LED connection, simply connect the long leg to a arduino's digital output through a 220 Ohm resistor and the short the ground.
Now your arduino can already control the plug. With this you can control the plug with your computer, or add sensors to it, which is what I will do on the next step.
Step 6: Add the Light Sensor
To let the arduino know when the laser is pointed to it, I use a LDR.
It is other basic connection, one leg to the 5V and the other connected to an arduino's analog input and to the ground through a 10k Ohms resistor.
Step 7: Test It!
Now that you have all the components well connected start testing the different parts individually.
First see if the arduino can successfully control the plug, to do that, you can just upload the Blink example, only changing the number of the digital output to yours.
Then you need to know if the sensor is reading well, just upload the AnalogInOutSerial example and read the values that the arduino prints to the serial console.
If it all has worked, upload the final program, you can create yours or just upload my which is attached.
Now your arduino should turn on/off the plug and the led when it detects a peek on the light readings.
Attachments
Step 8: Mount Everything in Place
If you have it all working, mount everything in place, and make it look well.
I didn't have a battery pack or other power source at hand, that's why I used another arduino connected to the computer to give it the 5V.
Step 9: Have Fun!
But it is not the only thing your arduino can do, so keep developing new programs and new functionalities!

Third Prize in the
Wicked Lasers Contest

Participated in the
MakerBot Challenge
11 Comments
Question 4 years ago
Can you use any switch with a button, or does it have to have the remote-control capability?
8 years ago on Introduction
very nice
8 years ago
Awesome! Cool use of lasers
10 years ago on Introduction
Awesome! I had a mini rocket launcher that you pointed a 'ray gun' at a target to launch. I think I will see if I can find it now.
10 years ago on Introduction
Can u pls tell me how to build an arduino microcontroller used on your project with cheap materials? im from PH thanks by the way and more power
11 years ago on Introduction
Do you think this switch could work?
http://www.amazon.com/AmerTac-RFK100LC-Mounted-Switch-Receiver/dp/B000HJBE68/ref=sr_1_15?ie=UTF8&qid=1303759300&sr=8-15
Reply 11 years ago on Introduction
I would say yes.
You should be able to simulate what the RF receiver does ;)
Reply 11 years ago on Introduction
Thanks
11 years ago on Introduction
Looks like a cool project. Can you provide a link for a home automation system switch? Oh and I live in America so I need a home automation switch with an american outlet (as opposed to your European one).
Reply 11 years ago on Introduction
I guess that any switch can be used.
I bought my kit in a local shop, so I find it quite hard to give you a link...
The only one I feel comfortable to give is this, which shows you how to build one: http://www.sparkfun.com/tutorials/119
Reply 11 years ago on Introduction
Ok, thanks. I'll try to look around for one.