16

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)

OdinX
  • 821
  • 2
  • 9
  • 16
  • 2
    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... – Andy aka May 05 '13 at 14:50
  • 1
    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. – The Photon May 05 '13 at 14:58
  • 7
    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. – OdinX May 05 '13 at 15:02
  • 11
    @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. – Russell McMahon May 05 '13 at 15:06
  • Learning about this will be great, but your diagram and your explanation don't match - you've drawn it with the diode in series with the transistor, but explained it as in parallel (and shorting across the LED to turn it off doesn't sound like a great idea). – Chris Stratton May 05 '13 at 15:12
  • Hi Chris I know that my description doesn't match the diagram, thats why I wrote "something similar to the schematic below". I know what you mean about sorting the LED, I'm pretty new to electronics and this seemed like a logical way for me to achieve the result I desire, is there a better way? – OdinX May 05 '13 at 15:17
  • 2
    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. – jippie May 05 '13 at 15:24
  • Ah ok, that sounds good, I'll give it a go. Thanks. – OdinX May 05 '13 at 15:30
  • You don't specify what time delay you're looking for, and since you're relying on the internal resistance of the battery for an RC constant, it cannot be determined from your schematic. – Kaz May 05 '13 at 15:53
  • 1
    In the first sentence I say "after 1 minute or so". I'm not looking for anything specific. – OdinX May 05 '13 at 15:57
  • @Kaz - I think the resistor-less path is intended to be used in the direction (of activation/deactivation) where no time delay is required. The direction where delay is required should of course have a resistor - it's possible right now the delay in that direction is being driven by leakage or the base current. – Chris Stratton May 05 '13 at 16:19

4 Answers4

21

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

Kaz
  • 19,838
  • 1
  • 39
  • 82
  • 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? – OdinX May 05 '13 at 16:00
  • 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. – Kaz May 05 '13 at 16:21
  • 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!! – OdinX May 05 '13 at 22:26
  • Is it a problem not having a resistor on the base of Q2? – tom r. Apr 14 '21 at 06:03
  • @tom.r You are right; we have to think about the case when Q1 is fully on. – Kaz Apr 14 '21 at 15:52
3

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.

jippie
  • 33,033
  • 16
  • 93
  • 160
  • 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? – OdinX May 05 '13 at 15:05
  • Updated with Schmitt trigger, there are two circuit diagrams using discrete components (non-IC's). – jippie May 05 '13 at 15:06
2

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.

Michael Karas
  • 56,889
  • 3
  • 70
  • 138
2

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

Russell McMahon
  • 147,325
  • 18
  • 210
  • 386
  • MOSFET option may not be 'snappy' enough when it comes to quick turn on / off, but indeed a good alternative to the Darlington. – jippie May 05 '13 at 15:18