Simple Photocell LED Nightlight

Thread Starter

n2glox

Joined Aug 29, 2009
38
I am about as new to electronics as you can be. So bear with me.

I am trying to do a very simple LED circuit for a nightlight, using a Photocell to turn it on at night and off in the daylight. I found the circuit on the instructables forum and want something VERY simple. I do not care if it goes on when it is dim in the room, or when it is cloudy (i want some differentiation, but I am not picky).

THe instructables I looked at is here:

http://www.instructables.com/id/Blue-Bawls-automatic-LED-light/

I got the same parts he lists:

9 Volt Battery
Photo-Cell
NPN Transistor (2N 4401)
Super Bright White LED
100K ohms Resistor
470 ohms Resistor
9 Volt battery Snap

Except I want to run this of of a Wall Wart, and have been using a 12volt source on my breadboard.

I wire it up to match his breadboarding and it does not work. The LED comes on, but the Photo Cell does nothing to effect it. I have tried 2 different photocells that i got from All Electronics (smaller physically than his) and I get nothing.

I am trying to figure out whether i am messing up the breadboard work, or the wrong photocells.

Here are some Pics. I apologize, they could be sharper, but they show the circuit:







The fullsize images are here:
http://www.jklinephd.com/photoled1.jpg

http://www.jklinephd.com/photoled2.jpg


http://www.jklinephd.com/photoled3.jpg


The photocells came from jameco and here are the stats:

PHOTOCELL,90mW,150V PEAK,
27KohmMAX LIGHT,2MohmMIN DARK Jameco#:120310

PHOTOCELL,90mW,150VPK,5Kohm,
MAX LITE,20Mohm MIN DARK Jameco#:202391

PHOTOCELL,150mW,200VPK,3.6Kohm
MAX LITE,0.3Mohm MIN DARK Jameco#:202438

Suggestions? Errors I have made?

Thanks

Jeff
 

rspuzio

Joined Jan 19, 2009
77
When I went to the website you linked,
but I couldn't find the schematic even
though they talk about the schematic in
step 1. From the parts list and your pictures, I
gather that the way that this circuit works
is that the 100 kΩ fixed resistor and the
light-sensitive resistor are connected as a
voltage divider which goes to the base of
the transistor.

Suggestions? Errors I have made?

Your parts list says

100K ohms Resistor
470 ohms Resistor

but, when I look at the colors on the resistors,
what I see are 680 Ω and 1000 Ω. Using 680 Ω
instead of 470 Ω won't make much of a difference,
only make the LED not shine as bright but using
1 kΩ instead of 100 kΩ will completely throw off
the voltage divider, explaining why you can't
get the thing to shut off.
 
Last edited:

Thread Starter

n2glox

Joined Aug 29, 2009
38
When I went to the website you linked,
but I couldn't find the schematic even
though they talk about the schematic in
step 1. From the parts list and your pictures, I
gather that the way that this circuit works
is that the 100 kΩ fixed resistor and the
light-sensitive resistor are connected as a
voltage divider which goes to the base of
the transistor.




Your parts list says

100K ohms Resistor
470 ohms Resistor

but, when I look at the colors on the resistors,
what I see are 680 Ω and 1000 Ω. Using 680 Ω
instead of 470 Ω won't make much of a difference,
only make the LED not shine as bright but using
1 kΩ instead of 100 kΩ will completely throw off
the voltage divider, explaining why you can't
get the thing to shut off.
Thanks you for your help!!

I have to say Oops. Going to school does not means you can read.

You are correct I have a 1000 Ω Not 100k Ω

It is off to RS tomorrow.

Attached is the Pic of the Schematic

Can you explain why? I think i know, but I need to tune up my understanding.

Thanks Again.

jeff
 

Attachments

Bernard

Joined Aug 7, 2008
5,784
It looks like the photo-cell is connected to +12 instead of ground in picture. The 100k supplies base current, thr photo-cell shunts the base to ground, turning off the light. A low ohm sensor should work best, like the 3.6K.
 
Last edited:

rspuzio

Joined Jan 19, 2009
77
Going to school does not means you can read.
Especially when it comes to reading component color codes --- the
school of hard knocks seems to be the place for learning that. The
good news is that there aren't that many values in common use, so
it doesn't take too long before, say, "1000 Ω" pops into your head
when you see brown-black-red without even thinking about it.

Can you explain why? I think i know, but I need to tune up my understanding.
Sure. To turn on an NPN transistor, the base needs to be around 0.6
to 0.7 volts more positive than the emitter. In your schematic, the
photoresistor and the fixed 100 kΩ resistor form a voltage divider
so, in order to have the transistor (and hence the LED) turned off, you
need to have the voltage across the photoresistor be less than this
turn-on voltage.

So let's calculate the maximum resistance which will still keep your
LED turned off. Letting x be the resistance of the photoresistor, we have

\( {x \over x + 100000} = {0.6 \over 12} \)

which solves to x = 5.25 kΩ. If we look at the specs of the three
photoresistors, we see that the third one says 3.6 kΩ when fully lit,
so that should turn off once the lights go on. The second says
5 kΩ when fully lit so likely the only way to turn that one off would
be to shine a bright light right on the photocell. The first one says
27 kΩ so it has too much resistance to work in this circuit.

Also, it's worth noting that you can adjust the light level at which the
circuit turns on by changing the resistor from 100 kΩ to some other value.
 
Last edited:

Thread Starter

n2glox

Joined Aug 29, 2009
38
So let's calculate the maximum resistance which will still keep your
LED turned off. Letting x be the resistance of the photoresistor, we have

\( {x \over x + 100000} = {0.6 \over 12} \)

which solves to x = 5.25 kΩ. If we look at the specs of the three
photoresistors, we see that the third one says 3.6 kΩ when fully lit,
so that should turn off once the lights go on. The second says
5 kΩ when fully lit so likely the only way to turn that one off would
be to shine a bright light right on the photocell. The first one says
27 kΩ so it has too much resistance to work in this circuit.

Also, it's worth noting that you can adjust the light level at which the
circuit turns on by changing the resistor from 100 kΩ to some other value.
Thanks!!

So if i were to get a 50kΩ then I solve it to 3.2kΩ photocell and a 60 k resisitor would solve to 2.6kΩ. So with a 50k I could use the one photocell marked 3.6kΩ? I could also use a pot with an adjustable resistor amount?

Thanks again.

Jeff
 

THE_RB

Joined Feb 11, 2008
5,438
Just replace the 1k resistor with a 33k or 50k pot. Then adjust the pot until the circuit works at the light level you choose.
 

Thread Starter

n2glox

Joined Aug 29, 2009
38
Just replace the 1k resistor with a 33k or 50k pot. Then adjust the pot until the circuit works at the light level you choose.
Thanks I have a 100k POT, but I will look for one that is 1K.

Thanks again. THis has been fun and I enjoy learning. I am going though materials and trying to learn the technical side, but sometimes translating technical into practical gets harry.

I soldered up the circuit tonight ( I chose a small board, even though I could have just soldered everything together - I have directions), but the Circuit Board (kjust a mock up board from RS) helps me to think it through. I still got the stupid transistor on backwards. UGH. Now I have to get a Solder Sucker to desolder the joints and redo it.

Its fun learning. I am going to use a modification of this to light up the eyes of a pumpkin for halloween.

Jeff
 

Ron H

Joined Apr 14, 2005
7,063
The minimum beta on 2N4401 is 80. For a collector current of (7V/470Ω) 15mA, you need the base current to be at least 15mA/80≈190uA. This means that, with the photocell completely off, the base resistor needs to be no greater than ≈43kΩ. The photocell ON resistance Rpc(on) must be about
0.5/Rpc(on)<8.5/43kΩ (assumes Vbe(off)=0.5V).
Rpc(on)<2.5kΩ.
This all assumes you have a fresh battery.

Having said that, it may or may not work with the 100k resistor, since most units will have beta>80.
 
The minimum beta on 2N4401 is 80. For a collector current of (7V/470Ω) 15mA, you need the base current to be at least 15mA/80≈190uA. This means that, with the photocell completely off, the base resistor needs to be no greater than ≈43kΩ. The photocell ON resistance Rpc(on) must be about
0.5/Rpc(on)<8.5/43kΩ (assumes Vbe(off)=0.5V).
Rpc(on)<2.5kΩ.
This all assumes you have a fresh battery.

Having said that, it may or may not work with the 100k resistor, since most units will have beta>80.
This analysis is very clear to your problem, i think. The next job you should do is to do more experiments. Hope you could make it.
 

Thread Starter

n2glox

Joined Aug 29, 2009
38
The minimum beta on 2N4401 is 80. For a collector current of (7V/470Ω) 15mA, you need the base current to be at least 15mA/80≈190uA. This means that, with the photocell completely off, the base resistor needs to be no greater than ≈43kΩ. The photocell ON resistance Rpc(on) must be about
0.5/Rpc(on)<8.5/43kΩ (assumes Vbe(off)=0.5V).
Rpc(on)<2.5kΩ.
This all assumes you have a fresh battery.

Having said that, it may or may not work with the 100k resistor, since most units will have beta>80.
Thank you. I have to work to translate the above into english, but I get the gist of it.

Thanks

Jeff
 

Audioguru

Joined Dec 20, 2007
11,248
Instructables are written by people who know nothing about electronics.
Without a schematic and without a proper circuit it will be a miracle if it works.
 

Thread Starter

n2glox

Joined Aug 29, 2009
38
Instructables are written by people who know nothing about electronics.
Without a schematic and without a proper circuit it will be a miracle if it works.
Well a miracle has occured. The circuit works fine. I have not tried a trimpot but that was my desire not the original plan. The link I posted above has a simple schematic and a parts list. Some details were left off but it worked.

The help here has been great for this person who knows very very little about electronics.



Jeff
 

BMorse

Joined Sep 26, 2009
2,675
I cant believe no one looked at his breadboard, for one he has the base resistor tied to V+ and the photocell on V+ (in the pics of the first post), the resistor needs to pull the base low(since it is an NPN) so it should be connected to ground....
 
Last edited:

JoeJester

Joined Apr 26, 2005
4,390
The pencil diagram meets the objective of
I am trying to do a very simple LED circuit for a nightlight, using a Photocell to turn it on at night and off in the daylight.
.

However, the protoboard was not wired that way.
 

BMorse

Joined Sep 26, 2009
2,675
The pencil diagram meets the objective of .

However, the protoboard was not wired that way.

Actually the pencil schematic will not work, I built it on a breadboard and it does nothing for what the op wants (It does not even work!!) So I built the above circuit on a breadboard and it works..... In the pencil drawing, all you are doing is keeping the base high with the resistor, when resistance increase from the photocell, it creates a voltage divider that is not "low" enough to turn off the transistor, but if you swap the resistor and photocell, and connect the LED as I show in my circuit, it will work like what the op needs, when the photocell is blocked the LED turns on...... when there is light, LED is off.....


My .02
 

TexAvery

Joined Oct 7, 2009
58
Thanks! I got it to work just fine. Now I would like to turn a LED on when light is present. Basically a reverse of the above project.
 
Top