Photo Sensor Project Question

Thread Starter


Joined Nov 15, 2010
Hello, new to the forums here and somewhat of a newbie to electronics. I have a project I'm working on and was hoping to get some help with the electronic components. So here goes....
I bought 5' of this LED Strip:, a 12v 12w 1A Power Supply, and this RGB Controller: Everything works great, I've even been able to cut the LED Strip into sections and solder wires between the sections. The part I'm having trouble with is that I want to add a photo sensor, photoresistor, or phototransistor to have the LED's turn on automatically when the room gets dark. Through investigation I've found that there are many ways to do this, but it appears one of the simplest methods seems to utilize an NPN transistor as seen here:

I've tried this circuit with success using this kit:
Juvenile I know but like I said I'm a beginner and it was on sale at Radio Shack :p
So how do I integrate this NPN transistor schematic into my project with:
A) The electricity being supplied by the 12v 12w 1A Power Supply and/or RGB controller instead of 2 AA batteries.
B) The LED being a 5' strip or RGB LED's instead of a single LED.
C) The resistor, NPN transistor and photo sensor being bought from Fry's or Radio Shack.
Thanks in advance!


Joined Feb 19, 2009
That little transistor won't be able to handle the power of the RGB strip.

You will need the same basic concept, but that transistor will be used to drive a power transistor (or power MOSFET) in order to switch cleanly.

See member Bill Mardsen's blog for details.


Joined Sep 9, 2010
How do you decide between using a mosfet or a relay?
Relays suffer from having moving parts, needing a bit more power to hold "on", and being more expensive. But they're great for simplicity, and they can switch AC.

In practical, hobbyist use, the biggest factor for choosing between MOSFET and relay is usually frequency. A relay makes no sense for long term use at frequencies above, say, 1 Hz. They just can't switch really fast and they will wear out after some number of toggles.


Joined Feb 19, 2009
How do you decide between using a mosfet or a relay?
Current requirements and frequency of switching mostly.

For a basic twice a day switch, a relay would be easier for you to implement.

You may have a few problems with relay chatter at dusk, when the transistor is one just barely enough to drive the relay the relay will keep switching until the photosensor is out of the voltage range entirely.