Projects

DIYstable DIYlatch

Two awesome general-purpose NE555 boards

Daniel Koch and Liam Davies

Issue 66, January 2023

Two awesome general-purpose NE555 boards.

The venerable NE555 is still one of the most popular integrated circuits (ICs) in the world. It is loved by makers everywhere because of its simplicity, its reliability, ruggedness, and versatility. It is also despised by many engineers, because at that level, there are far better options. However, there is still no real equivalent in that none of these options does so many different jobs.

Recently, when we were designing PCBs for the ATX power supply project elsewhere in this issue, we looked at some of the small circuits we could make to bulk out the order. What came to mind straight away was a generic board for the NE555, so that makers can install components quickly around this versatile chip and make the circuit they need with the reliability of a soldered, compact, secure PCB rather than a bulky and unreliable spring-contact breadboard.

While the NE555 is the target, you could easily use the LM7555, the high-precision, high-stability CMOS version. Many of the other parts are optional, too, especially regarding the astable version. SO, while we have provided parts lists, not all of the components on them are needed, and some are duplicates depending on which way you want to do things.

What we came up with was, in fact, two boards, and there may be more in the future. We settled on making the most common Astable configuration, as well as the less common but very useful single-button latch circuit. We will describe each individually, because it is as much the features of the PCB that make these boards useful, as it is the circuit they host.

The overall idea is boards which can have many different component values and sizes inserted into them to customise each version the way you want. The versions shown here are initial prototypes, and we need to make some changes before they are ready to go on sale. However, we really wanted to share them with you now, so we'll build them as-is and describe what will change for the production versions. However, we hope to have these available soon in their final form.

DIYstable

Parts Required:

Value

DIYstable PCB

1 x or 2x Base Current Limiting Resistors to suit transistor choice

1kΩ

2 x 25-turn Trimpots, Value of Choice

10kΩ

1 x PNP TO92-Packaged Transistor

BC327

And/Or:

1 x NPN TO92-Packaged Transistor

BC337

1 x Timing Capacitor of Choice

10µF

1 x Filter Capacitor of Choice

470µF

1 x 10nF to100nF Capacitor

100nF

1 x 1N4004 Diode

1 x NE555 Timer IC

1 x 8-pin IC Socket

6 x PCB Pins OR Headers & Sockets

Note: Some parts are optional, others are a selection between one or the other.

DIYstable is the name we came up with for the astable configuration of the NE555. Originally we were going to use it for the latch, which is also known as a bistable configuration, but we couldn't think of a better timer-based name so we stole it for the astable and called the bistable version the DIYlatch!

We have made the PCB as compact as we reasonably can without going crazy. It still has room for PCB pins for the inputs and outputs, which are labelled as J1, J2, and J3. That's because the PCB footprints are actually two-pin jumper headers, so we'll change those a bit on the production versions. We included a reverse-polarity protection diode, and instead of resistors for the timing, we included a footprint for another set of headers.

These three-way headers just happen to fit 25-turn top-adjust trimpots. The wiper and one terminal are linked, to make a variable resistor. So, you can mount a 500Ω, 5kΩ, or up to 1MΩ trimpot and adjust the value to get an exact resistance. This means you can make the timer very exact indeed compared to fixed resistors. These are marked as RV1 for the one between the supply rail and pin 7, and RV2 for the one between pin 7 and pins 6 and 2.

The fixed resistors on the board are the base protection resistors for the two output transistors. On the circuit diagram, we have these labelled as 1kΩ but you can make them whatever value you wish for whatever TO92-packaged transistor you are using. We have chosen a BC337 and BC327 for a 500mA output, but you could also use a PCB pin on the timer end of the resistor, and drive loads less than 200mA directly if you wish. These are highlighted here.

You can see some other three-way headers, too. These are actually for capacitors, but we included the ability to use capacitors of different pin spacing. To the left of the header positions is some screen printing showing that the lower holes are in the ground plane, while the upper two holes for each capacitor are both connected together, and are the timer side of the capacitor. This is also where the positive side should go when using electrolytic capacitors. The idea here is that you can use any timing capacitor from the smallest ceramic up to electrolytics of around 1000µF, depending on the pin spacing a given manufacturer uses of course. Speaking of electrolytics, C1 is also a dual-spacing position for a supply rail filter capacitor, intended to be between 220µF and 470µF. It is entirely optional but gives more reliable operation in many situations.

The PCB is through-hole plated and masked both sides so soldering should be quite easy. We have built up this example with a pair of 100kΩ trimpots and a 10µF 16V capacitor. The filter capacitor for pin 5 is a 100nF MKT. Note that there is no extra resistor to maintain the recommended 1kΩ minimum around pin 7. This would have taken extra space and most people are capable of just making sure they don't turn the trimmer potentiometer down too far.

Some people will notice that we have only given the transistors one footprint. Traditionally, transistors were available with straight leads as they are shown here;
straight leads with the outer two bent out slightly for wider spacing; and one with the two outer leads bent outwards and the middle one bent back. We will probably update the PCB this way but we have found very few devices on the market that have anything other than very straight inline leads, a reflection on the gearing toward tape-and-reel distribution.

We included two output transistors rather than just one output pin so that you can very easily use the timer for either long high or long short duration timing. The NE555 cannot have an off time longer than its on time, so the solution is an inverted output. Because the output both sources and sinks current, a PNP transistor is connected as well as an NPN version. The NPN is conducting when the output is high, and the PNP conducts while the output is low. You can install both, or one and the other.

VARIATIONS

As-is, the circuit is designed to run loads using the two transistors, as you can see by the Fritzing. However, there is nothing to stop you accessing pin 3 directly via a PCB pin and connecting a less than 200mA load directly. While in the Fritzing above we connected the board as-supplied, we have below some variations showing that the board can be connected with just pin 3 and the supply rails to drive smaller loads directly. This Fritzing shows the board used with LEDs with current-limiting resistors soldered in the R1 and R2 positions instead of transistor base protection resistors, and the LEDs soldered between the base leg position of the transistor pad, and the relevant power rail connection on J1 and J2.

This variation allows small non-polarised loads under 200mA to be connected. Here, we used diodes instead of resistors going to the bases of the transistors, and added PCB pins where the transistor bases would be to attach the load to the relevant output jumper pins. Some people will want to do this but most of the time, you can just use the transistor outputs to do the job anyway.

Note that this arrangement will tend to only work if the connected loads have a reasonable resistance. If not, current will flow across both and they will not turn off and on. The resistance must be high enough that current flows through pin 3 to ground, and not the other load to ground, during the low phase. The diodes will still take care of this in the high phase.

Of course, the other variations regarding this board relate to the values of RV1, RV2, and C4 as the timing components.

FUTURE CHANGES

On the production version, we hope to adjust the input and output spacing slightly so PCB pins can be used instead of a jumper header for the outputs and the power in. We used PCB pins in our build but as-is, they're a bit too close together for easy or safe use that way. However, they do suit the use of plug-and-socket headers as seen in some of the other photographs. We will probably add space so that LEDs and dropping resistors can be added so there is a visual indication of board operation, and maybe a power LED. We have also decided to alter the trimpot footprints so that the less accurate but far less expensive 270° turn basic trimpots can be used, as well as fixed resistors if you choose to use them for the timing of the IC.

We are thinking of adding a second parallel footprint to the TO92 transistors so that TO220 devices can be used instead, capable of driving much bigger loads. We will update the layout so that Q1 is near out1 and Q2 near Out2: Currently, they are where they are because of a quirk of the schematic we initially used to generate a layout. We also want to change the screen print outlines to better reflect what goes into them, like PCB pins and capacitors where we have used header spacings. Finally, we'll break out so that the NE555's output pin can be connected directly, as well as at the other end of the resistors which can be substituted with diodes if you want to control on/off non-polarised small loads.

USING IT AND CALCULATING VALUES

The first step is deciding what timing components you are going to use. If you go with the 25-turn trimpots that we did, what values will you use? Calculating the desired on/off times is the best start. There is no use fitting a 1MΩ trimpot, for example, if you only need a 10kΩ trimpot. Sure, you can get the 10kΩ value on the 1MΩ pot, but you'll lose a lot of the sensitivity gained by using 25-turn trimpots in the first place. Of course, in the production boards when we order them, you can use regular trimpots, too.

We have covered the operation of the NE555 many times, including how to calculate the values of the supporting components. If you want more details, you can check out Classroom 68 and Kids' Basics 47, 54, and 57. There are some great online calculators, too, which allow you to input values for resistors and capacitors and get high and low times that result; and even some that allow you to choose times and a capacitor value and the calculator suggests values for resistors. Just search for "555 calculator" and you'll find many options. There is no 'best one'. They have different features and benefits depending on what you need, and also on how you respond to different user interface styles.

DIYlatch

Parts Required:

Value

DIYlatch PCB

1x or 2x Base Current Limiting Resistor to suit transistor of choice

1kΩ and 100Ω

2 x 10kΩ Resistors

1 x 100kΩ Resistor

1 x 10nF to100nF Capacitor

100nF

1 x 2.2µF Capacitor

1 x Filter Capacitor of Choice

470µF

1 x PNP TO92 Or TO220 Transistor of Choice

BC327 and TIP42

And/or:

1 x NPN TO92 Or TO220 Transistor of Choice

BC337 and TIP41

1 x 1N4004 Diode

1 x NE555 Timer IC

1 x 8-pin IC Socket

6 x PCB Pins OR Headers and Sockets

1 x Pushbutton Switch and/or 1 x tactile Switch

Hookup Wire

Note: Some parts are optional, others are a selection between one or the other.

The second circuit we designed a PCB for leverages the internal flip flop of the NE555, and does away with the timing side, to create a single-button on/off latch circuit. This one is pretty exciting as there are currently few products around that can perform this function for projects you are designing, with the reliability of a PCB. The circuit is the same as that published last month in Fundamentals on latches, but instead of a solder breadboard, it has a dedicated PCB.

The circuit works by having pins 6 and 2 of the NE555, the trigger and threshold pins respectively, tied together and held at half the supply voltage by the voltage divider formed by 10kΩ resistors R1 and R2. When an NE555 is first powered up, its output is low. When the pushbutton is pressed, this low voltage, held by the 2.2µF capacitor C3, is presented to pin 2, the trigger pin. Pin 2 is now below one third of the supply voltage, and because the current coming through the 10kΩ resistor on the voltage divider cannot charge the capacitor fast enough to stop the trigger pin activating, the internal flip flop changes state. Now, output goes high, which charges the resistor via the 100kΩ resistor R3.

The 100kΩ value is high enough to allow reasonable time to release the pushbutton before the capacitor is charged to 2/3 of the supply voltage, which would activate the flip flop again. Now, when the button is pressed again, the capacitor is charged to nearly the supply voltage, and this is presented to pin 6 (remember, pins 2 and 6 are tied together). Being above 2/3 the supply voltage, pin 6 trips the internal flip flop, allowing the capacitor to discharge through the 100kΩ resistor to ground through the now current-sinking pin 3.

The output is connected to two transistors. One is a PNP arrangement, Q1, which feeds output 2. This is an unfortunate quirk of the way we fed the schematic into the PCB auto-router, and didn't fiddle with it enough before ordering.

We knew we would want changes, so we'll fix this on the production version. The PNP transistor's base is fed by resistor R4, which is 1kΩ on the schematic and examples but can be any value you need for whatever transistor you need. There are two transistors in parallel, but you would only use one. We did this so the PCB can accept either TO92 or TO220 sized packages. That's why there is only one transistor on the schematic despite two in parallel on the board: you fit one or the other.

The output is also connected via another resistor to parallel-connected NPN transistors. The same applies to these as to the PNPs above. The idea of this is that the PNP transistor will be active when the NE555 output is low, and the NPN active when the NE555 output is high. So, you can have the circuit high or low on power up, depending on which transistor you fit.

Of course, you could also use it as a manual selector between two circuits, by using both outputs, but our main idea is that you fit either PNP or NPN, and use it to be high on power up or low on power up, and switch on and off from there at the push of a button.

The other thing to note is that there are two switch connections. One is for a standard tactile switch on the board, while the other is for jumpers to connect an external switch. They are wired in parallel so either or both will work.

Any normally open momentary switch will do, and this could be a pushbutton, a limit switch, or momentary toggle or rocker. Like the astable version, we used header pins for power connection and outputs. These are a bit too close for comfort for PCB pins, so on the production version, we'll add a bit of spacing but retain the option to use headers like we have in the photo for connection to our external pushbutton.

As before, there is a reverse-bias protection diode and a filter capacitor. If you're working with battery voltages you may wish to forego the protection diode to save the 0.7V drop across it and replace it with a wire link, unless you think that mixing up the battery connections is a likelihood - that depends on you and your situation.

We certainly prefer to have the protection diode when using batteries: We mix them up all the time! If you don't need the filter capacitor for stable operation, you can just leave that out.

ENDNOTES

We hope you find these multi-use circuits useful, and we hope to bring you the production versions soon with all the improvements we have identified! We are also thinking of which little projects to do next. The idea is anything like this that can be general purpose like the latch, or highly adaptable like the astable. If you have any ideas, please let us know! At this point, we're thinking an NE555 monostable, then probably some pre-programmed ATtiny85 circuits.