Control Fluorescent Lights with a Laser Pointer and an Arduino

 by rmd6502
IMG_0775.JPG
IMG_0774.JPG
A few members of the Alpha One Labs Hackerspace do not like the harsh light given out by fluorescent fixtures.  They wanted a way to be able to easily control the individual fixtures, perhaps with a laser pointer?

I got right on it.  I dug out a pile of solid state relays and brought them to the Lab.  I bought an Arduino Duemilenova and demonstrated the use of the LED Blink example sketch to actually blink a halogen lamp.  I found some info on using LEDs as light sensors [1] and an Arduino sketch demonstrating the technique[2].

I found that the LEDs were not nearly sensitive enough - the laser had to point straight into the light emitting part, or the LED wouldn't register.  So I switched to phototransistors.  They are much more sensitive, and over a wider range of frequencies.  With the proper filter over the transistor I could make it more sensitive to red light, and from a much wider range of angles to the sensor.

DISCLAIMER AND WARNING:  This instructable deals with line (mains) voltage at 120 or 240 volts.  Use common sense if you build this circuit - if you have a doubt about something, ask someone who knows.  You are responsible for your (and others') safety, and compliance with local electrical codes.

 
Remove these adsRemove these ads by Signing Up

Step 1: The Sketch and some Theory

I'll assume you know how to power your Arduino, and get a sketch compiled and loaded in.

For each lamp I use telephone cable, since it's cheap, has four conductors, and I had a bunch laying around anyway.  I used red for common +, black for ground, green for the phototransistor collector, and yellow for the relay control +.

A phototransistor passes an amount of current that varies with the amount of light falling on it.  The Analog to Digital Converter (ADC) in the arduino measures the voltage at the pin relative to ground.  I looked at the phototransistor data sheet and verified with a multimeter that the transistors pass 10mA at full light. Using Ohm's law, that's about 500 ohms at 5V,

To control the lamps I used a solid state relay module.  These are relatively cheap at the current rating we needed, about $4 for up to 4A.  Make sure to buy relay modules with a zero-crossing detector, especially if controlling anything inductive, like a fluorescent light, motor, or wall-wart transformer.  Switching them on or off anywhere but the zero point could cause voltage spikes which at best will reduce the life of your appliance, and at worst start a fire.

javila14 says: Feb 12, 2013. 9:26 PM
great! so you need to buy the ballasts?
WWC says: Nov 2, 2012. 1:44 AM
First time i ever saw wires soldiered on like that, even if they are bare wires they are typical just shoved into the headers. Glad it works for you.
moris_zen says: Nov 13, 2009. 7:42 AM
 Too bad there is no picture of the florecent lights . A video would be grat .
Very hard to get an impresion of what was done ...

rmd6502 (author) in reply to moris_zenNov 14, 2009. 12:55 PM
There are pictures, and an AVI - are they not showing up for you?
moris_zen in reply to rmd6502Nov 16, 2009. 12:50 PM
Ohh.. .. thanks - didn't see the Avi before .

diy_bloke in reply to moris_zenJul 9, 2012. 9:20 AM
I saw the Avi but in fact still dont know what I saw. A light wnet on and then it went off
Jodex in reply to rmd6502Nov 16, 2009. 6:58 AM
Yes, we can see them.
electronicghost says: Apr 19, 2010. 8:53 PM
any thoughts on being able to rapidly turn on and off the light without making the ballast mad? way to keep the light warm but off or dim?
Cartermarquis says: Oct 31, 2009. 10:14 AM
Nice!  I would have made a shield or something instead of soldering the wires straight to the Arduino, but otherwise this is an awesome project!
psytek in reply to CartermarquisNov 1, 2009. 8:47 PM
 I have to tell you, I witnessed that soldering job done in literally 20 seconds.  As they say "Desperate times call for desperate measures"  We were fresh out of header pins and this was the best way at the time to get the wires connected (safely).  I bet you will see an update soon once we get some header pins in or possibly a shield.   Although I think a shield may be too much for this.  Good work on this project by the way!  And I can't wait to see the serial interface side of this project when it is done too.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!