Simple Photocell LED Nightlight

Discussion in 'The Projects Forum' started by n2glox, Aug 29, 2009.

  1. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    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:

    [​IMG]

    [​IMG]

    [​IMG]

    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
  2. rspuzio

    rspuzio Active Member

    Joined:
    Jan 19, 2009
    Messages:
    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.


    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: Aug 30, 2009
  3. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    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

    Attached Files:

  4. Bernard

    Bernard Senior Member

    Joined:
    Aug 7, 2008
    Messages:
    3,288
    Location:
    Tucson AZ USA
    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: Aug 31, 2009
  5. rspuzio

    rspuzio Active Member

    Joined:
    Jan 19, 2009
    Messages:
    77
    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.

    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: Aug 31, 2009
  6. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    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
  7. THE_RB

    THE_RB AAC Fanatic!

    Joined:
    Feb 11, 2008
    Messages:
    5,435
    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.
  8. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    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
  9. Ron H

    Ron H E-book Developer

    Joined:
    Apr 14, 2005
    Messages:
    7,050
    Location:
    Idaho, USA (GMT-7)
    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.
  10. Perfectboy

    Perfectboy New Member

    Joined:
    Sep 9, 2009
    Messages:
    9
    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.
    [​IMG]
  11. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    Thank you. I have to work to translate the above into english, but I get the gist of it.

    Thanks

    Jeff
  12. Audioguru

    Audioguru New Member

    Joined:
    Dec 20, 2007
    Messages:
    9,411
    Location:
    Ontario, Canada
    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.
  13. n2glox

    n2glox Thread Starter Active Member

    Joined:
    Aug 29, 2009
    Messages:
    38
    Location:
    Columbia Missouri
    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
  14. TexAvery

    TexAvery Member

    Joined:
    Oct 7, 2009
    Messages:
    58
    Location:
    Houston
    If 6vdc. is used in place of 9vdc. what would the value of the 2 resistors change to?
  15. BMorse

    BMorse Senior Member

    Joined:
    Sep 26, 2009
    Messages:
    2,673
    Location:
    Vermontville, Michigan (GMT -5)
    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: Nov 10, 2009
  16. TexAvery

    TexAvery Member

    Joined:
    Oct 7, 2009
    Messages:
    58
    Location:
    Houston
    So the breadboard is incorrect? What about the pencil schematic in the 3rd. post?
  17. BMorse

    BMorse Senior Member

    Joined:
    Sep 26, 2009
    Messages:
    2,673
    Location:
    Vermontville, Michigan (GMT -5)

    The pencil schematic is different from the layout of the board, and also wrong.....

    Attached Files:

    Last edited: Nov 10, 2009
  18. JoeJester

    JoeJester AAC Fanatic!

    Joined:
    Apr 26, 2005
    Messages:
    2,447
    Location:
    Grand Prairie, TX, USA
    The pencil diagram meets the objective of
    .

    However, the protoboard was not wired that way.
  19. BMorse

    BMorse Senior Member

    Joined:
    Sep 26, 2009
    Messages:
    2,673
    Location:
    Vermontville, Michigan (GMT -5)

    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
  20. TexAvery

    TexAvery Member

    Joined:
    Oct 7, 2009
    Messages:
    58
    Location:
    Houston
    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.
Similar Threads
Forum Title Date
The Projects Forum Need help with simple Photocell project. Oct 2, 2009
The Projects Forum Simple project with potentiometer and amplifier Wednesday at 9:55 PM
The Projects Forum Simple Bench Power Supply 10A Tuesday at 2:41 AM
The Projects Forum Simple diff amp question common mode input terminal quesiton Oct 14, 2014
The Projects Forum Need a simple "secure" switched contact circuit Oct 2, 2014

Share This Page