3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Control Fluorescent Lights with a Laser Pointer and an Arduino

Control Fluorescent Lights with a Laser Pointer and an Arduino
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 1The 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.

« Previous StepDownload PDFView All StepsNext Step »
7 comments
Apr 19, 2010. 8:53 PMelectronicghost says:
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?
Nov 13, 2009. 7:42 AMmoris_zen says:
 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 ...

Nov 16, 2009. 12:50 PMmoris_zen says:
Ohh.. .. thanks - didn't see the Avi before .

Nov 16, 2009. 6:58 AMJodex says:
Yes, we can see them.
Oct 31, 2009. 10:14 AMCartermarquis says:
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!
Nov 1, 2009. 8:47 PMpsytek says:
 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

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
3
Followers
2
Author:rmd6502