Skip to main content

555 Timer Monostable Rundown and Tricks

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 C
This 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

Popular posts from this blog

Atmega328PB Dev on Linux x64

The Atmega328PB is the greatest thing to come to the Arduino platform since the UNO.  Who wouldn't want more 16-bit PWMs and double all 3 serial protocols? The new unofficial Arduino Mini PB Pro! To get the IDE to support it, follow this guide: https://github.com/watterott/ATmega328PB-Testing Since the JSON file is incomplete for Linux, do the manual toolchain replacement.  This was a little tricky, and there isn't much on the internet on where the toolchain resides inside the Arduino base folder.  Here's what I did to make it work. I downloaded the latest Arduino build, and I will refer to the extracted base directory as "arduino-1.6.9".  Also download the "hardware.zip" and the "Arduino Toolchain (4.9.2)" Linux x64 version from the github links. 1. Replace the toolchain The builtin toolchain resides in "arduino-1.6.9/hardware/tools/avr/".  Rename the avr folder to "avr.old".  Extract the "Arduino Toolc...

PB Pro Mini

No, it isn't Lead, nor is it Peanut Butter.  It is the 'B' version of the prolific ATmega328P microcontroller which started all this maker craziness off! Top view of PB Pro Mini Description This is a minimal microcontroller board with only a voltage reg, crystal, I2C pull-ups, LEDs and the chip itself.  The goal here is to reduce costs while hosting the beefy 328PB! This is based on, and pin compatible with, the Arduino Pro Mini 5v/16MHz from  Sparkfun . Notable, not-so-minor improvements for the 'B' version: 2 UARTs 2 I2Cs (TWI) 2 SPI Qtouch 5 Timers (with OC, IC, and PWM) Everything else is about the same.  You should be aware the clock driver on the chip is a low-power version, but this board and crystal operate at 16MHz just fine at 5V.  The Arduino library I've been using for the PB has been working without a problem! Getting Started You'll need a FTDI Friend  or FTDI Cable  to program this as there is no seconda...

Update to USBmicroISP: 6pin and 10pin headers

Actually using my USBmicroISP with microcontrollers other than Arduino Uno's led me to fix a udev rule issue with my Gentoo Linux laptop.  I was getting Permission Denied when I was trying to use avrdude as a normal user.  Yes, my user is part of the 'uucp' group... Background Some background on the Arduino ISP connector.  It is much different than the 10-pin AVR connector... 6-pin ICSP cable pinout.  NOTE: Numbers refer to ATtiny45/85 pins, not ICSP! Arduino ISP pinout. Notice the vertical line next to pin 1, which appears in silkscreen on the PCBs. Redboard ISP pinout.  Obviously the same as UNO.  Notice pin 1 location on upper-left, with horizontal white silk. My USBmicroISP has the cables coming off the IDC differently, but the key is in the correct orientation to the pinout in the top picture! (Please disregard numbering on first picture for ICSP purposes)  Usually the key and wires are facing inward (left side on 2nd and 3rd ...