14
\$\begingroup\$

I'm attempting to make an alarm for a freezer so that if the door gets left open, after 1 minute or so, an alarm will sound.

I've got something similar to the schematic below. When the switch is open the capacitor starts to discharge through the base of the transistor but I have the LED in parallel with the transistor so that when the capacitor is discharged, the LED turns on. This is working fine, however I cant make the delay long enough. If I increase the capacitor value or the transistors base resistor, the delay time is longer, however because the capacitor is discharging slower the LED/Alarm is gradually faded on which I don't really want. I would like the alarm/LED to come on as suddenly as possible.

enter image description here

Is there a way for me to increase the delay but keep the alarm turning on relatively suddenly?

As a footnote, I do not want to use any ICs (i.e. the 555 timer)

\$\endgroup\$
  • 2
    \$\begingroup\$ Why don't you want to use an IC. If I were a tyre fitter and a customer told me he didn't want rubber tyres etc etc... \$\endgroup\$ – Andy aka May 5 '13 at 14:50
  • 1
    \$\begingroup\$ For a one minute delay, you should use an IC whether you want to or not. If you won't accept answers that use ICs, this should be closed as "too localized" because it won't be helpful to future readers. \$\endgroup\$ – The Photon May 5 '13 at 14:58
  • 7
    \$\begingroup\$ The reason I don't want to use an IC is because just plugging something in that somebody else has made doesn't help me understand how to actually create a timer. \$\endgroup\$ – vimist May 5 '13 at 15:02
  • 11
    \$\begingroup\$ @ThePhoton - if you MUST accept IC answers then you MUST listen to Olin too and always use a microcontroller. While both solutions have merit, limiting yourself to a specific subset of generally possible solutions for a good real world reason or as a learning exercise, is an entirely valid approach. \$\endgroup\$ – Russell McMahon May 5 '13 at 15:06
  • 2
    \$\begingroup\$ Actually when you exchange the push button and the capacitor, you'll have the same result. I like the LED in series with the transistor better too from an efficiency point of view. \$\endgroup\$ – jippie May 5 '13 at 15:24
18
\$\begingroup\$

You're charging the capacitor directly from the battery. So the charging time is related to the product RC, where R is just the internal resistance of the battery.

Try something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

Here, I have split the base resistance so that the capacitor is charged through a large portion of it.

This not only achieves the goal of slowing down the charging of the resistor, but it has another side benefit. When the switch is released, C1 discharges into the base of the transistor through only a 1K resistance, resulting in a discharge which is much faster than the charge. We can't make that resistor too small, because we need to protect the transistor's BE junction from the discharge current.

In simulation, the LED current starts to build at around 1.5 seconds and reaches a maximum at around 1.8. So that is not a sudden turn-on, obviously. But the turn-on increases with faster delays.

For a faster turn on, we need to add another transistor stage. The following circuit has a similar time delay to the above one, but the LED current ramps up more quickly, over a spread of 70 ms or so.

schematic

simulate this circuit

For longer times with fast turn-on, we need more gain. One way to do that is to replace the load resistor with an active load. According to an LTSpice simulation of this circuit, it generates a 55s delay, at which point the LED ramps up over an interval of about a quarter second. This graph shows the charging of the capacitor (blue) versus LED current (green):

enter image description here

However, it is getting more complicated than some IC based solutions. This approach is good for gratifying the hobbyist ego. ("I did it with discrete components, none of these easy to use op-amp or timer IC's, and look, there is even a current mirror and stuff!").

schematic

simulate this circuit

Can we make some small changes so that we don't need the huge charging resistor, and can use a smaller capacitor? Yes! Here is one way. We can raise the transitor Q1 so that there is a higher turn-on voltage at the base, by putting a Zener diode in the emitter, say 8.2V. Then a 100K charging resistor, and a 470uF capacitor give us a bit over a minute. By raising the voltage that the capacitor must develop, we can obtain a larger delay for the same RC values.

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ Thanks for the response Kaz, however I'm looking for a delay around the 1 minute mark if its possible to adapt your schematic to fit that? \$\endgroup\$ – vimist May 5 '13 at 16:00
  • \$\begingroup\$ That is difficult. Any increases in time with a larger R1 and C1 also increase the turn on time. For instance if we make R1 a megohm, we get in the ballpark of the minute delay, but the LED ramps up over several seconds. We need more gain to get that turn-on time down. \$\endgroup\$ – Kaz May 5 '13 at 16:21
  • \$\begingroup\$ Wow, thanks for the time you put into the answer! It sounds like this is the way to go. Hopefully I'll be able to understand whats happening a bit better if I start playing around with it. Thanks!! \$\endgroup\$ – vimist May 5 '13 at 22:26
2
\$\begingroup\$

Either you increase the capacitor, which is already getting a bit large, or you reduce the base current of the transistor. The second option can be accomplished by changing the BC547 for a BC516, a so called 'Darlington pair' and increasing 33k to 1M resistor. This will increase the timeout.

The other issue you mention, the slow fading, can best be solved with an Schmitt trigger.

For long timeouts like this other solutions are a better fit, but you'd have to move to IC's to keep complexity down.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the response. I've looked into doing something like this, however it just amplifies that problem of the alarm/LED gradually fading in. So this way does work, I would just like the alarm to suddenly come one. Is there a was to incorporate that? \$\endgroup\$ – vimist May 5 '13 at 15:05
  • \$\begingroup\$ Updated with Schmitt trigger, there are two circuit diagrams using discrete components (non-IC's). \$\endgroup\$ – jippie May 5 '13 at 15:06
1
\$\begingroup\$

To get a sharper turn on for the LED you need to increase the gain of the circuit. For those using ICs a comparator circuit would be used to compare the capacitor voltage to a reference level. Once the threshold was crossed the very high gain of the comparator would cause the output to quickly change and light your alarm LED.

Since you want to stay with simpler descrete components the next simplest approach for you to increase the gain of your circuit would be to connect two NPN transistors up in a darlington configuration. Darlington circuits will not fully saturate the output transistor and so you would have to adjust the resistor in series with the LED to achieve the same LED brightness.

I'll post a modified picture for you in a moment.

\$\endgroup\$
1
\$\begingroup\$

If you use a MOSFET and place the resistor from gate to ground

  • The MOSFET gate draws NO current at all (that you can detect)

  • Voltage decay time constant is now entirely RC based.

  • Turnoff occurs when Vcap falls to close to MOSFET Vgs_threshold.
    (More useful stuff to learn :-) ).

Be sure that MOSFET Vgs_max is > 12V. Many are about 20V. Some are lower.

Note that capacitor leakage for a 1000 uF cap may be significant for larger R discharge values.

However, a 10 uF tantalum cap and a 1M resistor have a 10 s time constant so probably give 20+ seconds of delay. A 47 uF electrolytic cap and 1M MAY work.

If an IC was acceptable then you will love what you can achieve with a CD 4060 in self oscillating mode - see fig 12. .

\$\endgroup\$
  • \$\begingroup\$ MOSFET option may not be 'snappy' enough when it comes to quick turn on / off, but indeed a good alternative to the Darlington. \$\endgroup\$ – jippie May 5 '13 at 15:18

protected by W5VO May 6 '13 at 0:00

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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