light sensor

Discussion in 'The Projects Forum' started by haithem alsaab, Apr 9, 2014.

  1. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    Hello every body
    I'm still beginner in designing a circuits I decide to make a light sensor with three leds , If the light R very bright the 3 led will start work if it is less brightness 2 will work and if there is no light just one will work
    I know I have to use comparators but the problem I don't have a complete idea or a program to simulate plz help me
    thx a lot
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,388
    497
    Pick the light sensor. Once we know output of the light sensor, we can start looking for comparator.
     
  3. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    the photoresistor has 2m ohm in dark and 200 ohm in light
     
  4. #12

    Expert

    Nov 30, 2010
    16,283
    6,795
    Something like this:
     
  5. #12

    Expert

    Nov 30, 2010
    16,283
    6,795
    You're going to have to do better than that unless you want the first trigger point to be inside a closet with no light. Go outside and measure the cell at night.

    Edit: This turned out to be pretty much a mistaken post. Please ignore it.
     
    Last edited: Apr 10, 2014
  6. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    Consider a CdS cell, wide range of resistance. Just looked at one , dark 2MΩ, bright light, 100Ω, room light 5k, turned toward celing light 500Ω.
    Dark LED always on, Vf [ 3V white ] could be used as + V ref. for LM 393, dual comp. Assume a 6V VCC with a V divider of LDR, 2k & 3k to gnd. R Junctions to - comp. inputs. Comp. outputs connected to LEDs-R's- to VCC. Dark, _ inputs below 3V, outputs hi, LEDs off. Light increases, LDR = 5k, medium , tap now 50% of total divider, or 3V, med. comp goes low, LED on. Light bright, LDR drops low enough to raise bright comp - in to 3v. LED now on.
     
  7. burger2227

    Member

    Feb 3, 2014
    190
    24
    One LED is always on so you should only need 2 comparisons. The third LED can just use the supply voltage with a current resistor.
     
  8. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    I''m beginner so don't angry:D
    And As burger2227 said I'll use 2 compartors
    my problem
    Summed up in
    1- what is the appropriate value of source
    2- the value of resistor after led 220 ohm good or not
    3-the value of resistors between the compartors
    4-the value of resistor cross the photoresistor
    soooo sorry
     
  9. burger2227

    Member

    Feb 3, 2014
    190
    24
    All depends on what supply voltage you want to use. I'd imagine more than 3 volts for the comparitors. Bright LED's may need 3 volts without a resistor.

    Vcc - Vled / .02 = R

    The resistor divider could be made up of variable resistors so that they triggering can be adjusted. No fast calculations there. A lot of variables.
     
    Last edited: Apr 9, 2014
  10. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    What color LED, & Vf?
    VCC?, 6V would be nice, or 5V-4 AA Ni-H
    R = [ VCC - Vf ] / .02, for LEDs
    Thr LM393 is open collector so use it to sink current [ bring to ground ].
     
  11. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    Please don't lough on me I know it is a beginner questions
    1- how to find the output of compartor the gain is so high so how can I control it
    2- under which condition the comparor will work
    3- is compartor saturate like the amplifier which the good value for V+ , V-?
    4- from the figure below what is the good value for R8, so that it can open at least one led I try to make it as high as possible but in the good cases it feed the right hand resistor just with 2 V which is not enough to run one led
    5-any quick suggestion for the right hand resistors
    6-Is there a simulate and good program ?

    plz don't be angry I try to make some projects coz I know it is the only way to learn and as I said I'm still beginner
     
  12. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,535
    2,369
    Never even had to put my reading glasses on! :)
    Max.
     
    haithem alsaab likes this.
  13. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    : ) : )
    I'm waitting:D
     
  14. burger2227

    Member

    Feb 3, 2014
    190
    24
    Didn't you already have this topic in another thread? If so, go back there.
     
    haithem alsaab likes this.
  15. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,797
    1,103
    Try reversing your LEDs. Comparators normally need pull-up resistors so can't turn on LEDs with the polarity shown.
     
    haithem alsaab likes this.
  16. Bernard

    AAC Fanatic!

    Aug 7, 2008
    4,172
    397
    The output from a comparator is either low or open, with pullup R it's high. A high gain is used so that a verry small V differance will switch output, say 1 mV.
    If you used pots in series with LDR, you can have a wide range of adjustment, which can then be converted to fixed values if desired.
     
    haithem alsaab likes this.
  17. wayneh

    Expert

    Sep 9, 2010
    12,115
    3,040
    The point of using a comparator is to have "infinite" gain that you cannot control. If you need to control gain, use a regular op-amp.
    It won't, since the comparators cannot source current, only sink it. You need the resistor to go to Vcc and the LED, and then sink the LED current into the comparator output. Note that you can find comparators that source current, but the common ones do not.

    I believe the values of r4-r7 are far too small. Maybe 10K or 100K would make more sense?

    To operate those LEDs at 6V, 100Ω seems low but I haven't checked the specs. I would aim for 50-75% of the maximum current for the LED.
     
    Last edited: Apr 10, 2014
    haithem alsaab likes this.
  18. #12

    Expert

    Nov 30, 2010
    16,283
    6,795
    Something like this:
     
    haithem alsaab likes this.
  19. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    Thank u All guys
    what can I say ! I love u all : )
     
  20. haithem alsaab

    Thread Starter New Member

    Aug 8, 2013
    12
    1
    I Try this modify
    schemtic from Bernard
    but I got the one lamp open and the other not I used LM 301 compartor
    any suggestion:D I don't wanna use zener diode or other component just adjust the resistors thx a lot
     
    Last edited: Apr 11, 2014
Loading...