Jonathan Thomson's web journal

5-by-555 February 28, 2011

Filed under: Electronics — jethomson @ 9:53 am

This is my entry for the 555 contest in the minimalistic category. I believe it might actually be an original use of the 555, if such a thing is even possible anymore. I call it the 5-by-555 because it can perform five (or more!) different functions all based on nearly the same topology. Plus, the name is a play on the phrase five by five.

 

The 5-by-555 can be used in many different ways. To explain how it works it’s easiest to first view it as a toggle flip-flop. When a toggle flip-flop is triggered (e.g. it detects a positive edge) it’s output becomes the inverted value of it’s previous output. Assuming the 555’s output is low, then when a pulse of a sufficiently short duration is input to the circuit the transistor will pull the trigger pin low and the 555 will switch it’s output to high. The threshold pin does not see the first input pulse because the discharged capacitor holds it low. While the output is high the capacitor charges at a rate determined by R1*C1. Once Vc reaches a certain voltage, a second input pulse will be missed by the trigger pin because the transistor is unable to pull it low and detected by the threshold pin because the capacitor is no longer acting as a sink; as a result the 555 will switch it’s output to low. While the output is low the discharge pin is grounded. This will cause the capacitor to discharge through R2 so that the trigger pin maybe pulled low again when the next pulse occurs. Diode D1 prevents the capacitor from discharging through R5 when the input is low. D1 also keeps the charged capacitor from activating the threshold pin. Diode D2 allows the charge time of C1 to be independent from R2 and prevents a voltage divider between R1 and R2 allowing C1 to hold the threshold pin low. The oscilloscope capture below demonstrates this behavior, but it also shows oscillation when the input is held high for too long (see nota bene).

 



N.B.
It’s important to understand that because the 5-by-555 uses the charge stored on a capacitor to remember its previous state it is sensitive to the duration and frequency of the input pulses. For pulses having a t_on that is longer than the charge time of the capacitor or occur before the capacitor has sufficiently discharged the circuit will not behave as expected. Therefore you must determine the maximum t_on and minimum t_off of a pulse train when picking resistor and capacitor values for your circuit. Most of the circuits shown in this article use pulses that have a fixed t_on; the remainder assume a worst case t_on.

When this article mentions charge and discharge time it is not referring to tau = R*C, but instead to the amount of time it takes for Vc to reach a voltage such that a new pulse will result in the output of the 555 changing states.


 

Toggle Flip-Flop and Oscillator
This circuit demonstrates the use of a 5-by-555 as a toggle flip-flop and as an oscillator. When the input pulse is the correct duration it will toggle the 555’s output. However, if the input is high for longer than the charge time of the capacitor the threshold pin will see the pulse and the 555’s output will begin to oscillate at a frequency determined by R1, R2 and and C1 as long as the input pulse is applied. Normally this ability to oscillate would be undesirable but with the right problem it could be useful. For instance, this circuit can be used to turn a light on or off when a momentary switch is pressed and released and flash when the switch is pressed and held.

 

 

 

 

Divide-by-n
A toggle flip-flop can be used to divide the frequency of a pulse train by two. The 5-by-555 circuit can divide-by-2 but it can also be made to divide-by-n if the charge and discharge times of the capacitor are adjusted such that the period of one cycle of the output is equal to the duration of n pulses [n*(t_on+t_off)]. The following images show the 5-by-555 used as a divide-by-7. The extra 555 is used to generate the input pulse train which is shown as the blue waveform in the oscilloscope capture.

 

You may have noticed that the capacitor on the control pin of the pulse generating 555 goes to Vcc and not ground. While this is an error it did not affect the operation of the circuit. The breadboard picture for the timer has the same error.

 

 

Timer
The 5-by-555 can act as timer where the output remains high for n-1 pulses and then goes low at the beginning of the nth pulse. This is accomplished by choosing an R1 value such that C1 charges slowly holding the threshold pin below (2/3)*Vcc until the beginning of the nth pulse. Then R2 quickly discharges C1 during one pulse cycle making the timer ready to respond to the next pulse so a new timing cycle may begin. The images below show the 5-by-555 setup as a timer that asserts a positive edge after ~7.20 ms (10*720 us) has elapsed; notice that the oscilloscope measured a period of 7.04 ms.

 

 

Counter
The frequency divider and the timer circuits are excited by input pulses with a fixed t_on and t_off. If pulses with a fixed t_on but a variable t_off (i.e. the arrival time of the next pulse is unknown) are used to charge C1 instead of Vcc through R1, then the 5-by-555 can be used as a counter. The images below show a modulo-5 counter. The Schmitt inverter circuit simply transforms button presses (simulated by V2) into pulses with a fixed t_on. Unfortunately the simulation doesn’t agree with the oscilloscope capture of the breadboard circuit. I’m not sure why. This may be a transient effect; for some reason the simulation slows to a snails pace at 80%. Using the 5-by-555 as a counter doesn’t work particularly well. It will miss pulses and sometimes go low prematurely. This is a result of pulses arriving before the capacitor has sufficiently discharged.

 

 

One-shot
Finally, the 5-by-555 can be used as a one-shot that can generate an output pulse shorter than the input. This is accomplished by allowing the capacitor to fully charge while the input is still high resulting in the output turning off. The larger R2 resistor increases the discharge time blocking the remainder of the input pulse from retriggering the 555.

 

 

Edge Triggering
If the t_on of a pulse is long and the charge time of the capacitor is short then the same pulse that triggered the 555 may also be seen by the threshold pin causing the output to go low prematurely. Sometimes this behaviour is desirable, but usually not. For pulses that are on for very long the resistor and capacitor values become prohibitively large. However, with some slight additions to the circuit it is possible to make it respond to only the positive edge of a pulse removing these problems. The following schematic was only simulated. It turns any pulse with a t_on longer than 1 microsecond into a 1 microsecond pulse. It appears from the simulation results that the maximum input frequency is approximately 200 kHz. This means that the fastest square wave the 5-by-555 can output is around 100 kHz. Notice that the input resistors were lowered to 100 kOhms. This is because the input capacitance of the threshold pin does not charge quickly enough with a 1 microsecond pulse when the input resistance is 10 Megohm.

 

Schematics
All of the schematics shown in this article were created in LTspice and are available in the.asc format for circuit simulation. They are packaged into a single zip archive and may be downloaded using this link.

If you like Falstad’s circuit simulator applet, here are a few links to 5-by-555 circuits implemented in it:
Toggle flip-flop (modified to better match the simulator’s speed)

Timer

Count to 7

 

Pitfalls
When the 5-by-555 is in steady state it will have a minimum voltage that it will store on C1. If this minimum voltage is not zero a transient output will result the first time the 5-by-555 is activated because the voltage across C1 is zero at t0.

The counter is extremely buggy. When a pulse arrives during the discharge period, one of three things can happen: 1) the pulse is ignored because the capacitor has not sufficiently discharged. 2) a new count begins with residual charge still remaining on the capacitor resulting in a shorter count that desired. 3) the capacitor has discharged (almost) completely resulting in the proper number of pulses being counted. Number 3 is the desired result. However, since it is assumed that the pulses occur at random intervals it is not possible to always discharge the capacitor before a new pulse arrives.

Keep in mind that electrolytics leak charge so they are likely unfit for use in counting pulses that have a long t_off.

 

Update
The 555 contest winners were announced April 21st by Chris Gammell and Jeri Ellsworth live on Jeri’s ustream. Unfortunately, I did not place in the final round. While I feel my entry was technically interesting it was not very exciting and just couldn’t hold up against the winners. However, I had the great fortune of winning a door prize! I was randomly selected to receive a XuLa-200 board courtesy of XESS. I could not be happier with my luck! The board arrived on the 4th of May with a little extra surprise. The padded envelope contained two items rolled up separately in bubble wrap. One was obviously the board because I could see through the bubble wrap; the second was a mystery. At first I assumed it was a USB cable or header pins, but as I peeled away the layers I could tell by the feel of it I had no idea what it was. Finally, I removed all the bubble wrap to reveal the grotesque face seen below. It’s a magnet and I love it. I put it on my old, indestructible, metal power strip with the hopes that it will keep the electrons with bad juju away.

 

A very big Thank You! to Chris Gammell, Jeri Ellsworth, all of the judges, and the sponsors (especially XESS!) for making the 555 contest a great success.

Advertisements