0
\$\begingroup\$

I found a circuit to do what I thought I wanted it to do. I want an LED to turn on for a few seconds when an LDR detects darkness. The circuit works perfectly but now, of course, if the light source stays off the light stays on.

I would like the LED to turn off after the desired time and stay off until darkness is detected again after light.

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ You could do this with a cascaded second 555 one-shot, but honestly, though: Easy to solve problem for a microcontroller which would also use only a tiny fraction of the power! \$\endgroup\$ Oct 16, 2020 at 9:25
  • \$\begingroup\$ Does this answer your question? Is the NE555 the IC I need, and if not, what do I replace it with? \$\endgroup\$ Oct 16, 2020 at 9:25
  • \$\begingroup\$ I was going to use a microcontroller but thought a 555 would use less power, clearly not. It would be great to do this just with a couple of transistors. even turning the led on with a state change for 30 or seconds would be fine. \$\endgroup\$
    – maxum
    Oct 16, 2020 at 9:38
  • \$\begingroup\$ yeah, as in the link "one-shot" above, a one shot doesn't really require a lot of logic – if rough timing is enough, taking the time a transistor needs to discharge a capacitor works (it's basically the same as the logic gate, RC logic gate thing in that answer). To only detect the edge of your brightness signal, you'd do an RC highpass filter (simple!), then amplify the output of that (with a single transistor, an opamp, a logic gate...), to get the same "energy" for every pulse that you get from the transition, and then use that with the RC low-pass as outlined in the answer. \$\endgroup\$ Oct 16, 2020 at 9:51
  • \$\begingroup\$ Place D1 next to R1. Problem solved. \$\endgroup\$
    – user16324
    Oct 16, 2020 at 12:38

2 Answers 2

0
\$\begingroup\$

You have a monostable multivibrator there.

Yes, if your output stays low, it triggers another pulse immediately once the timer is up due to the way the 555 works.

What you need is something that pulls up pin 2 once the ldr gets under a certain threshold, but then also detects if it's light again - in your solution, that'd most probably need a second LDR or some clever engineering. In any ways, it means extra parts.

Also, consider that an LDR is very slow to adjust, on the magnitude of seconds.

Aaalso, you have a battery source, and connect it directly to a resistive load. The higher your light sensitivity, the lower the resistance. Let's say, it's in daylight, and the LDR goes to around 300 Ohm. Total serial load R1+R2= 5kOhm. I=U/R=9V/5000Ohm = ~2mA.

A typical 9V battery has a capacity of around 600mAh at low discharge rates - so just your resistive load drains around 1% of the battery every three hours in daylight, or 4% a day assuming 12 hours of daylight. You'd need to change your battery every 25 days.

Then you also have the problem of the 555 using around 10mA even when it's doing absolutely nothing. That is five times the discharge rate. So, you're lucky to get 4-5 days out of it from a 9V battery.

As others have said, look into microcontrollers instead, they're more suited to the task. if it needs to be power efficient, let it go into deep sleep and make the sensor (a phototransistor is better suited to this task anyways) wake up the processor from deep sleep, let it do its thing, then go back to sleep.

Or I just had an idea for a creative solution:

Mini solar panel (off of some cheap import site or something) that charges a capacitor. Once solar panel voltage drops under threshold, turn on LED. LED drains capacitor, no power in system left. Self-contained, length of LED glowing depends on chosen capacitor, no battery required.

\$\endgroup\$
0
\$\begingroup\$

The simple answer starts with design specs for ON time after darkness.

The easiest solution for minutes or hours of time is to use a CD4060 with built in clock and enable it with the LDR then disable RESET .
Then with any cascade binary counter output you choose for f/2^N stages using a feedback for output =1 to stop the clock input on p11(?) with a forward diode.

Daylight then resets the clock as it is stopped already but now armed for twilight.

Choose a large RC value for the clock with a low speed like 10 Hz.

Add a cap to the LDR to suppress transient light being blocked sufficiently large for the time expected.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.