Help in Dark LED detector+

Discussion in 'The Projects Forum' started by hazim, Feb 24, 2011.

  1. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    Hi all.
    The title doesn't express it correctly. What I want to do is a simple circuit that drives some LEDs on when dark is detected (or sudden darkness occurred) for several seconds and then turns them off. The circuit's power supply is a PP3 9V battery (alkaline). The circuit should be as simple as possible and should draw the minimal possible current during when LEDs are off.

    I design a circuit using LM358D op-amp using both halves as comparators, but after that I looked forward designing the circuit using only transistors. I design one using three 2N7000 MOSFEts and 3 resistors and a photoresistor and a capacitor and 3 super bright white LEDs.

    The circuit draws about 0.1mA when the LEDs are off when there is light, and about 0.18mA at dark when the LEDs are off. When the LEDs turn on for some seconds when sudden dark happens, it draws about 10mA through the LEDs and the rest of the circuit.

    Here is the circuit:
    [​IMG]

    R1, R3 values are chosen after experimenting. There values determine at what light intensity should the LEDs turn on, and determine the current through the LEDs too. R4 and C2 values determine the duration for ON time. Q2 and Q3 function together like an AND gate.

    The circuit still have a problem. When there is a little darkness, the LEDs light a little because the transistors' gate voltages are not zero.. This problem also creates another one which is the ON time of the LEDs where Q2's gate will not become zero after a while as C1 discharges. So this is a problem I want to solve. Any help is strongly appreciated especially because you read all my thread and gave me a period from your time :).

    I prefer to end my posts with "sorry for my bad English" because I really don't know if I have mistakes and how much, and to learn from these mistakes. So sorry for my bad English :)

    Regards,
    Hazim
     
  2. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    Now it's working much better using R1=470kOhm. This lets Q1 conducts at much more darkness. This editing improved the circuit operation when it's no completely dark where if it changed softly from light to darkness the LEDs light a little and then turns off after the capacitor discharges. So just when a sudden darkness occurred, the LEDs light at full brightness and this is the main requirement.

    This project is useful here in Lebanon since electricity goes off suddenly at anytime, so when people are sitting at evening and the electricity goes off suddenly, nobody will see anything for a while till they light a lighter or something else to turn battery lamps on or the electrical generator or so...

    It is also useful in bedrooms when one turns off the room lamp and go to bed, LEDs will light for a while till he/she goes to bed :). It can be built in artificial flowers and vases and different LED colors could be used making it a useful and beautiful project.

    Any suggestions and comments are welcomed
    Regards,
    Hazim
     
  3. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    But why no one replies? it's really a simple and nice small project. I will be happy to see your views and comment about the circuit.
     
  4. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Why post a hidden zipped file insted of a photo or schematic?
     
  5. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    The schematic is in the first post. The zipped file contains a 3gp video file I recorded to show how this small project is working. I can't upload 3gp but zip files are permitted so I zipped it.
     
  6. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    No concern no help no encouraging...
     
  7. someonesdad

    Senior Member

    Jul 7, 2009
    1,585
    141
    Hazim, don't worry about your English - you're doing fine.

    If I was doing this, I'd use a small 5 VDC relay with a form C contact. Then I'd connect a battery and the LEDs to the normally-closed contacts of the relay. A small wall-wart would keep the relay energized when the power was on. When the power failed, the relay would relax, lighting the LEDs. Include the photosensor and a FET if you don't want it lighting up during the day.

    For fancier behavior, I'd consider using a small 8-pin PIC microcontroller (they only cost about 50 cents). They can sink or source 25 mA from each pin, so they can drive LEDs directly (or drive a FET for more current). They also can run in low-power mode (microwatts) to monitor the light sensor, then turn things on when the power fails. Personally, I like the relay solution because it's simple, cheap, and easy to build.
     
  8. hazim

    Thread Starter Active Member

    Jan 3, 2008
    419
    13
    Thanks someonesdad :)
    I didn't understood exactly how the relay's way works but I see the relay's coil will draws tens of milliamperes for long durations. This will draws out the battery in a short time. Can you post a schematic for more clarification?
    I expect my circuit could work about 9 months on a PP3 9V battery.
    The microcontroller idea you are talking about is great, I have an excellent programmer and several softwares for doing the job, but I lack the experience in writing a program.

    Regards
    Hazim
     
Loading...