Ah, that age-old old-timer, the 555 chip. It can be run in either astable (think repeating clock signal) or monostable (single pulse, then done) mode. I'm going to outline a simple monostable design, and some of the tricks that I needed to use to get it working great.
Design of a 555 Monostable 1 to 10 second Timer
Monostable timer with 24V trigger |
Two Component Timing
This particular design I needed to turn on a relay for about 5 seconds when the 24V rail came on. The basic timing of the 555 depends on R1+R6 and C1, in my circuit. The equation is as follows:τ = 1.1 R CThis is also displayed on the datasheet on page 10 as a graph of common resistor values. I chose 4.7uF and 1MΩ, which equates to τ = 5.17. I wanted my timing adjustable by at least 1 order of magnitude, centered on my 5 seconds. Thus, a minimum R of 200KΩ and a maximum of 2MΩ. I went with a split series resistance: a fixed 100KΩ and a 25-turn 5MΩ potentiometer. Eh, a little more than 10 seconds, but plenty more adjustability. :)
Relay Output
The output of the 555 can sink or source a good amount: 200mA max. I wanted to allow for a coil current of 500mA max. Thus, better use an NPN, Q2 on the low side. I chose a freewheeling diode, D1 of twice the coil current, so 1A, reverse across the coil. I also stuck a nice LED across the coil, instead of directly on the 555 output, to indicate when the coil has power, not necessarily when the 555 output is on. Notice the coil is setup for the +24VDC, but could be anything depending on your switching transistor, Q2.
Some people design their relay drivers with optocouplers. I'm not sure this is necessary, given the mechanical separation of the coil and the contacts, but it's not a bad idea if you have low TTL levels and don't want to introduce high coil voltages (or currents) to your CMOS chips or supplies. You are driving an inductive load, so voltage spikes would be common. But there are 5V coils out there, and decoupling supply caps are friendly, and one less part sometimes is cheaper.
Automatic Trigger
Not really an automatic trigger, but one that is somewhat monostable by itself: 24V comes on, it triggers the 555 with a short pulse. One way to do this is to employ a series capacitor of decent capacity to power our trigger circuit. It automatically releases, I guess.
The method, working backwards from the 555 requirement goes like this: The trigger input (pin 2 of 555) is an active low input that also needs to release. This would have been trivial had it not been for the release part. So, a quick low pulse can be accomplished by an NPN (Q1) pulling it to ground, with its base driven high. The base of the NPN now needs to go high, momentarily. We do this with a fairly large series capacitor in series with the 24V rail, to give enough base current for a couple milliseconds.
The cool capacitor trick here is based on what a capacitor does: its voltage across it cannot instantaneously change. When the 24V is off, the cap voltage is at 0V. Once the 24V comes on, if it brings one side of the cap up to 24V potential, the other side has to come up to 24V, if only for an instant, then it begins to charge (by going low). Thus, at 24V power-on we see the momentary 24V potential on the cap low-side, turning on the NPN just for a couple milliseconds. Then the NPN and R2 charge the low-side to 0V. Weird to think about, I know, but it works.
I have the capacitor so large at 10uF because I wanted it to be reliable, and with testing this became apparent. I also have a base resistor (R7) in series to slow the series capacitor discharge to a reliable turn-on time. If the hFE (DC current gain) of the NPN is higher than my measly 100, then our trigger pulse on pin 2 would be longer. I was testing with a 2N3904, but better NPNs are out there.
The other components surrounding are there to: guard against NPN base glitches (R2), protect the base from going too negative when 24V turns off (D2) and bleed the capacitor to 0V (R8).
Power Supply
You can use 5V to 15V to power the 555, at least for the version I bought. I also found during testing that my circuit would pickup 60Hz noise from the buildings lights (or somewhere) that indicated I needed some power capacitors. 4.7uF (C4) on the 5V rail did the trick. You could stick a 1uF or 0.1uF for higher frequencies, since we're dealing with a pretty old chip.
Credits
Most of this I learned by experience and testing. But, I love datasheets. You should too. Thanks to my older brother for letting me blow up many transistors back in the day.
That's about it! Happy two-timing it.
~JWilly
Comments
Post a Comment