# TTL Decimal Counter

172

## Introduction: TTL Decimal Counter

In this Instructable you will be building a digital decimal counter from TTL (transistor logic) ICs. TTLs have been obsolete for many decades now with CMOS being able to work at better voltage supply, input, and output ranges. Also, TTLs ICs cannot handle voltages higher than 5 volts.

This circuit can be created with one decimal counter IC. However, I used binary and BCD converter IC because this is what I had in stock.

I used a 330 resistor for each LED. You can use just one 330 ohm resistor for all of the 9 LEDs because they are never on at the same time.

## Supplies

Digital counter, binary to decimal converter (only if counter output is not decimal), wires, wire wrap tool, wire wrap (at least three colours), two 16 pin wire wrap sockets (do not use cheap sockets, use the ones with round holes only, getting TTL ICs to work might not be an easy task and even harder with poor connections), binary counter IC, binary to decimal converter, 15 LEDs, 330-ohm resistors (15), 5 V power supply (be very careful if you are using USB cable, you might damage the USB output), square wave generator (you can use 555 timer). Optional: 100-ohm resistor (for clock LED), 1 kohm resistor (BJT transistor inverter input), general-purpose NPN transistors or MOSFET for inverter/clock indicator, 5 V or 4.7 V (some TTL ICs do not work at voltages below 4.8 V, thus you might needs 5 V Zener diode or a standard voltage regulator IC) Zener diodes, one 10-ohm resistor (high power), RC power supply filter (high power 10 ohm and 1000 uF capacitor), plastic box, bolts, nuts, washers, pliers, screwdriver, wire connectors, crocodile clips, decoupling capacitors (ceramic capacitors or pillow capacitors).

## Step 1: Build the Circuit

Note that in the second photo you see a plastic end of the wire wrap wire wrapped around a few times for each wire-wrap pin (when the pin touches the matrix board) to ensure reliability. Wire wrap can easily break when you bend it s few times unless it is insulated.

The output from TTL binary counter 74LS168 is connected to binary to decimal converter 74LS42 (BCD integrated circuit) that is driving the 9 LEDs that you see on the right of the circuit. The 330-ohm resistors are connected in series with the LEDs.

The two NPN BJT (Bipolar Junction) transistors are basic inverter circuit. This is only needed if you are using a signal generator with zero DC offset input. The TTL clock input must be from 0 V to 5 V square wave from 555 Timer which I did not use for this circuit to avoid the use of the transistor inverter.

I used a BJT NPN transistor inverter made with two transistor for redundancy and easy power dissipation burden for each transistor:

https://electroconcepts.wordpress.com/2018/02/23/h...

You can also use a MOSFET:

It might possible to build this inverter with a comparator IC but not operational amplifiers due to minimum and maximum saturation voltages that TTL ICs cannot work with.

I used a high power 47-ohm resistor for the Zener diode circuit to protect the TTL ICs (http://www.theorycircuit.com/zener-diode-voltage-r...). I made another TTL counter circuit where I accidentally burned the TTL IC because the two Zener diodes failed due to high supply voltage and could not stop the TTL IC input from increasing to above 5 V., for this reason, I added a third Zener diode later in parallel not shown in this photo. An alternative option is to use fewer but higher power Zener diodes or standard 5 V voltage, regulators. There is also an option of using LM317 adjustable regulator. However, this might be obsolete with the increased use of switching power supplies.

The current value for each LED is: (Vs - Vled) / Rled = (5 V - 2 V) / 330 ohms = 9.09 mA, which is about 10 mA. When transistors are saturating at high frequencies there could be stray capacitance from the clock indicator LED which will be equivalent to a short circuit that will burn the transistor output. Thus I connected a 100-ohm resistor in series with the clock LED.

## Step 2: Test the Circuit

I was very lucky. My circuit worked immediately without too many problems. I tested on 1 MHz frequency.

The ICs might not be working for the following reasons:

- RC filter might be needed, each time the IC turns on it causes a surge in the power supply rail that might affect the operation of the IC, causing glitches or resetting the counter values. I already specified the capacitor and resistor values earlier in this Instructable that are useful for eliminating or reducing low-frequency glitches. You can try using 100 ohm and 100 uF instead of 10 ohm and 1000 uF values. The filter cut-off frequency is: 1/(2*pi*R*C) = 15.915 Hz. However, be careful with using RC filter and high current power supply. You might blow up capacitors, batteries or simply damage the power supply. Click on this link: http://www.learnabout-electronics.org/PSU/psu12.ph...

- you might need decoupling capacitors, small value decoupling capacitors are used to filter high-frequency surges that big capacitors cannot filter. Those surges occur when you raise the clock frequency to above about 20 kHz. Those capacitors are usually connected without any resistors because at such high frequency the resistor/impedance values could be zero due to stray capacitance. You can see those capacitors in motherboards or computer/laptop circuits. To calculate such capacitors you need to model the IC as a resistor when it is operating. You measure instantaneous input current and voltage across the IC terminals. You can calculate the equivalent IC resistance or impedance. This value could be random but there will be a DC component in this impedance value that will allow designing an appropriate decoupling capacitor filter. You might also need to assume to PCB track impedance that does not apply for this circuit.

- you might need to bias the outputs of the binary counter. We assume that input to BCD (binary to decimal converter) IC must be above about 3 Volts to ensure a logic "1" logic input. Otherwise, the BCD IC might process the input as logic "0". Let's assume that the minimum input current to the binary converter IC needs to be at least 10 mA. However, the binary counter can only supply an output current of only 8 mA. Thus we need an additional 2 mA from the resistor connected from power supply to counter output/BCD converter input pin. Therefore the maximum Rbias value will be: (5 V - 3 V) / 2 mA = 2 V / 2 mA = 1 kohms. If we reduce the Rbias to just 500 ohms than we provide 4 mA, ensuring that the total input current is 12 mA, slightly above the required 10 mA value. Increasing the Rbias value will reduce the maximum binary to decimal converter input thus keeping the logic "1" input voltage below the required 3 V.

However, we also need a minimum Rbias value because the binary counter might not be able to reduce the input below the required 0.5 V for the BCD IC input to ensure a logic "0". If the minimum current for logic "0" is 1 mA and the binary counter can provide 8 mA as logic "0" output than the minimum Rbias value is (5 V - 0.5 V) / (8 mA - 1 mA) = 4.5 V / 7 mA = 642.8571 ohms. The binary counter IC must provide at least 1 mA for the BCD input and at least 7 mA for the biasing resistor Rbias, making a total of 8 mA input. Reducing Rbias value to below 643 ohms will increase the minimum voltage for above 0.5 V thus, preventing a logic "0" input. Thus the Rbias resistor range is 680 ohms to 1000 ohms. The minimum Rbias value could is above the maximum. It all depends on IC specifications.

The next step is providing enough current for the LEDs. Each LED needs about 10 mA. Thus if the IC is providing 8 mA then we need 2 mA from the biasing resistor. In my circuit, the resistor is connected in series with each LED. The TTL IC was able to provide enough current for each LEDs. I was lucky. Let's assume that the maximum high output is 4 V. Thus you need a 220-ohm resistor in series with each LED ((4 V - 2 V)/ 220 ohms is approximately just below 10 mA) to prevent damage to the LED than can only handle 2 V voltage maximum. Next step is calculating the resistor that will be connected from power supply to BCD logic decimal output. The maximum biasing resistor value is when the output is no more than minimum 3 volts. Thus (5 V - 3 V) / 2 mA = 1000 ohms. Reducing the resistor value will increase the output voltage and the current entering the LEDs. However, you need to consider the maximum draining current of the binary to decimal converter IC. You can damage this IC.

Please comment if I made a mistake in this section because it is confusing. You are now done. Please watch the video. Participated in the
Make it Glow Contest