Interactive electronics resource

Discrete Analogue to Digital Converter Kit Instructions

Build, understand and experiment with an 8-bit analogue to digital converter made from standard logic ICs and analogue circuitry. This kit lets you observe the conversion process directly and explore how counters, resistor ladders and comparators can be combined to measure an analogue voltage.

Discrete Analogue to Digital Converter

Introduction

What is an analogue to digital converter?

An analogue to digital converter (ADC) is a circuit that takes an analogue voltage and converts it into a digital number, allowing digital systems such as computers to make measurements of real-world signals. While the analogue input voltage can take on any value within its operating range, the digital output has a finite number of possible values depending on the number of bits available.

The Discrete ADC uses an 8-bit output, meaning that it can represent 256 different binary values from 0 to 255. The nominal input range is 0V to 5V, although the practical upper limit and accuracy depend on the resistor ladder, logic output voltages and comparator behaviour.

What is the MitchElectronics Discrete ADC?

The MitchElectronics Discrete Analogue to Digital Converter is an advanced kit that combines analogue and digital methods to convert an analogue voltage into an 8-bit binary number, and what makes this kit particularly useful for learning about ADCs is that each part of the conversion process is implemented using individual functional circuits rather than a dedicated ADC IC.

The kit uses a counter-type conversion method, whereby a binary counter is repeatedly incremented while the voltage represented by that counter is compared against the voltage being measured. Once the counter-generated voltage becomes greater than the input voltage, the circuit stops counting and retains a binary result in an output register.

Schematic

Discrete ADC schematic

How it works

The Discrete ADC is broken into several sub-circuits, each responsible for a particular part of the conversion process:

  • Clock source for incrementing the 8-bit counter (U2).
  • Read / Busy flip-flop for starting and stopping the conversion (U1A).
  • 8-bit counter made from two 4516 4-bit binary counters (U3 and U6).
  • 8-bit output register for holding the conversion result (U4).
  • R2R-style digital to analogue converter for generating the comparison voltage (R15 to R30).
  • Comparator for comparing the ladder output voltage with the analogue input (U5A).

Starting a conversion

To start a conversion, the push button SW2 is pressed, which generates the START signal that resets both 4516 binary counters while also setting the flip-flop U1A into its on state (Q = 1). The Q output of U1A is connected to the CLK_EN signal, which enables the clock generator so that the counters can begin counting once START is released.

The two outputs of U1A also let external circuits determine when a conversion is taking place. The Q output, labelled CLK_EN, is high while conversion is in progress, whereas the inverted Q output, labelled BUSY on the schematic, is low during this time and returns high when the conversion stops.

The clock generator

The clock generator uses Schmitt trigger NAND gates found inside the HEF4093B (U2), with U2C, RV1, R8 and C1 forming the oscillator. As C1 repeatedly charges and discharges through the resistance provided by RV1 and R8, the output of U2C changes state, producing the clock pulses needed by the counter circuit.

When CLK_EN is high, U2A and U2B allow these clock pulses to reach the two counters, and the rate at which the counters increment can be adjusted using RV1. By slowing the clock down, it becomes possible to watch the conversion happen in real time using the LEDs on the board.

The clock generator also produces an inverted clock output, called /CLK_PHASE, which is connected to the clock input of the 74HC374 8-bit output register. The reason for using this inverted clock signal is explained later.

The 8-bit counter

The output of the clock generator is connected to two 4516 4-bit binary counters, U3 and U6, which are cascaded to produce a combined 8-bit counter. A single 4-bit counter can represent the values 0 to 15, but by combining two counters, the circuit can count from 0 to 255.

The eight counter outputs, D0 to D7, are connected to both the resistor ladder and the 74HC374 output register. Each time the counter increments, a new binary number is presented to the resistor ladder, which converts that number into an analogue voltage for comparison with the input being measured.

The R2R ladder digital to analogue converter

The output of the combined 8-bit counter is connected to a digital to analogue converter made using an R2R-style resistor ladder. The ladder is constructed using R15 to R30, and by connecting each bit of the counter to a different point along the ladder, the circuit produces a voltage whose value depends on the binary number being counted.

The ladder gives the most significant bits a greater influence on the output voltage than the least significant bits, allowing changes in the counter value to produce corresponding changes in the analogue output. The output of the ladder can be measured at TP1, labelled DAC_OUT on the schematic.

The resistor ladder in our Discrete ADC uses 10KΩ resistors for the series sections and 22KΩ resistors for the bit branches and termination. An ideal R2R ladder uses a precise 1:2 resistance ratio, so the difference in ratio, along with resistor tolerances and counter output characteristics, affects the voltage step sizes and the overall accuracy of the conversion.

Comparing the two voltages

The output voltage of the resistor ladder is connected to the positive input of the comparator U5A, while the analogue voltage being measured is connected to its negative input. This arrangement means that when the voltage being measured is greater than the voltage produced by the counter and ladder, the comparator output remains low.

As the counter increments, the ladder generates progressively higher voltages across its operating range until the comparator detects that the ladder voltage has exceeded the input voltage. At this point, the output of U5A switches high, and the voltage is passed through the potential divider made up of R32 and R33 before reaching the reset input of the 4013 flip-flop.

Resetting U1A causes its Q output to fall to 0V, disabling the gated clock output and preventing the counters from incrementing further. The oscillator itself can continue running internally, but its pulses no longer reach the counters.

Storing the conversion result

During conversion, the 74HC374 output register is clocked using the inverted clock pulse /CLK_PHASE, meaning that under normal counting conditions the register stores the current counter value when the main clock signal falls.

The reason for doing this is that changing the counter value and storing that value at the same instant can lead to unstable results, particularly when several bits change at once. Using the opposite clock edge gives the counter outputs time to settle before the register captures them.

We also use the inverted clock to allow the register to retain the last sampled count when the comparator detects the end of a conversion. When the comparator disables the clock, CLK is forced low and /CLK_PHASE goes high, which can produce an additional rising edge at the register if CLK was high at the time. As a result, the register can retain either the preceding sampled count or capture the count at which the threshold is crossed, depending on the relative timing of the comparator, logic gates and register. This is one of the timing characteristics of the Discrete ADC that you can explore by adjusting the clock speed and observing the digital output.

External output enable option

The circuit includes a slide switch, SW1, that selects whether the 74HC374 output is permanently enabled through the on-board pull-down arrangement or controlled by an external circuit through /OE. When /OE is low, the register drives its eight output pins, and when /OE is high, the output pins enter a high-impedance state.

This allows the ADC to be integrated into systems such as homebrew computers that share an 8-bit data bus between multiple peripherals. With suitable address decoding, a computer can enable the ADC output only when it needs to read the conversion result, preventing it from driving the bus while another device is active.

The binary output LEDs are connected to the register output pins, so they may extinguish when the outputs are disabled. These pins must only be enabled when it is safe to drive the external bus.

Why the LM358 uses a higher supply voltage

We designed the Discrete ADC to operate from a nominal 9V supply, with the digital logic powered from a regulated 5V rail, to accommodate the input voltage limitations of the LM358. The LM358 cannot normally accept input voltages all the way up to its positive supply rail, which is why it requires a higher supply voltage than the rest of the circuit.

For a traditional LM358 powered from 5V, the upper common-mode input limit is typically around VCC - 1.5V, although it varies with the particular device and operating conditions. This would restrict the usable input range to around 3.5V, which corresponds to roughly 179 counts for an ideal 8-bit ADC with a 5V reference.

To overcome this limitation, the LM358 is powered from the nominal 9V rail after protection diode D12, while the AMS1117-5.0 regulator U7 provides 5V for the logic. This gives the comparator sufficient input headroom to compare voltages close to 5V when the battery voltage is adequate.

As the output of the LM358 can rise above the 5V digital supply, we use a potential divider consisting of two 10KΩ resistors, R32 and R33, to reduce the comparator output voltage by half before it reaches the reset input of the 4013. A 9V signal would produce 4.5V at the output of the divider, although the voltage drop across D12 and the output characteristics of the LM358 reduce this voltage in practice. Use a suitable nominal 9V supply and replace depleted batteries, as a falling supply voltage can reduce the reset signal below the input-high threshold of the 4013 and prevent the conversion from finishing.

How to use

Connector references

Connector Pin 1 Pin 2 Pin 3 Pin 4
J1 GND VCC (5V) CLK /CLK_PHASE
J2 O0 O1 O2 O3
J3 START /OE BUSY CLK_EN
J4 O4 O5 O6 O7
J5 VIN GND N/A N/A

VCC on J1 is the regulated logic rail, not the 9V battery connection. CLK, /CLK_PHASE, BUSY and CLK_EN are internally driven signals; do not drive them from another output. START is active high, /OE is active low, and the output bits O0 to O7 represent the latched result, with O0 being the least significant bit.

Making a measurement

  1. Connect a suitable nominal 9V supply to the battery connection, observing polarity.
  2. Select the on-board output enable position of SW1 for standalone operation.
  3. Connect a stable analogue voltage to J5, with a common ground and a voltage comfortably within the nominal 0V to 5V input range.
  4. Adjust RV1 to a slow clock rate if you want to watch the conversion.
  5. Press and release SW2 to start the conversion.
  6. Observe the binary output LEDs and wait for CLK_EN to go low (BUSY goes high).
  7. Read the output from the LEDs or from J2 and J4.

The eight binary LEDs display O0 to O7, with D1, D2, D3, D4, D5, D6, D8 and D9 corresponding to bits 0 through 7. D7 indicates CLK, D10 indicates CLK_EN and D11 indicates BUSY.

Understanding the result

For an ideal 8-bit converter referenced to 5V, one least significant bit represents approximately 19.53mV (5V divided by 256). As an educational approximation, a binary value of 128 represents around 2.5V, while a value of 64 represents around 1.25V.

Our Discrete ADC is designed as an educational kit for exploring analogue to digital conversion, so its 8-bit resolution does not imply 8-bit measurement accuracy. The resistor ladder ratio, logic output voltages and comparator offset all influence the conversion result. To explore these effects, connect a known voltage source and measure DAC_OUT to compare the actual transfer characteristic with that of an ideal converter.

Operating characteristics and limitations

Conversion time depends on the input voltage

Because the ADC starts from zero and repeatedly increments the counter, measuring a higher voltage generally takes longer than measuring a lower voltage. This is a useful way to demonstrate counter-type conversion, but it also means that the ADC is slower and less predictable in conversion time than many modern ADC architectures.

The input must remain stable

The Discrete ADC compares the ladder output directly against the analogue input throughout the conversion, without using a sample-and-hold circuit. For consistent measurements, keep the input voltage reasonably stable until the conversion has finished, as changes in the input voltage during counting affect the point at which the comparator stops the conversion.

Full-scale conversion and accuracy

The maximum measurable input voltage is determined by the highest voltage produced by the resistor ladder, which can be lower than the nominal 5V input limit. The Discrete ADC uses the comparator to terminate conversions and does not implement a separate end-of-count timeout, meaning that an input voltage above the maximum DAC output can cause the counter to return to zero and continue counting. The resistor ratio can also produce unequal voltage steps, including transitions where the DAC voltage does not increase as the count increases. When integrating the kit into an external system, keep the analogue input within the usable conversion range of your assembled kit and monitor CLK_EN or BUSY to determine when a conversion has finished.

Applications and project ideas

Education

We developed the Discrete ADC to help students and engineers understand how counter-type ADCs work, as these converters combine several fundamental electronic circuits to perform a function that is crucial to many analogue systems. By slowing the clock and monitoring TP1, students can directly observe how a binary counter generates a changing analogue voltage and how a comparator detects the end of conversion.

Discrete computer projects

The discrete nature of the kit along with the support for external control makes this ADC suitable for integrating into bigger projects. For example, homebrew machines with an 8-bit bus, such as Z80 and 6502 computers, can use the ADC for reading analogue voltages without the need for additional microcontrollers, provided suitable address decoding, logic-level compatibility and bus control are used.

DIY multimeter

If connected to suitable display circuitry, the ADC can be used as the basis of a discrete voltmeter or ammeter. Building your own discrete meter provides an excellent way to learn about analogue measurement without relying on code, while also allowing you to explore the factors that determine measurement accuracy. Additional voltage scaling or current-sense circuitry is needed for measurements outside the ADC's direct input capabilities, and the kit must not be connected directly to mains voltages.

Going further

Try slowing the clock down with RV1 and monitoring the DAC_OUT test point while the binary output changes. Compare the voltage produced by the ladder at several known binary values and observe the comparator output to see exactly when the conversion ends.

Try it yourself

Circuit simulation

What you need

Component List

ComponentQuantityPCB Reference
1KΩ Resistor11R1, R2, R3, R4, R5, R6, R7, R9, R11, R13, R14
100Ω Resistor1R8
10KΩ Resistor11R10, R12, R23, R24, R25, R26, R27, R28, R29, R32, R33
22KΩ Resistor9R15, R16, R17, R18, R19, R20, R21, R22, R30
1MΩ Resistor1R31
10KΩ Potentiometer1RV1
10uF Capacitor3C1, C2, C4
100nF Capacitor8C3, C5, C6, C7, C8, C9, C10, C11
LED11D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11
Diode (type not specified)1D12
4013 Dual D-Type Flip-Flop1U1
4093B Quad Schmitt Trigger NAND Gate1U2
4516 4-Bit Binary Up/Down Counter2U3, U6
74HC374 Octal D-Type Flip-Flop1U4
LM358 Dual Operational Amplifier1U5
AMS1117-5.0 Voltage Regulator1U7
SPDT Slide Switch1SW1
Push Button Switch1SW2
Green Wire1J5
Black Wire1J5
9V PP3 Battery Connector1BT1
Discrete ADC PCB1—

Inspect the board

Interactive BOM

Not available in mobile view

Board reference

PCB & assembly

The PCB silkscreen provides the component references needed when assembling the kit. Compare the component references against the component list before soldering each part.

Discrete ADC PCB

Before applying power

  1. Check each resistor value and component position.
  2. Confirm the orientation of all ICs, LEDs, diodes and electrolytic capacitors.
  3. Check the regulator orientation and inspect the PCB for solder bridges.
  4. Check that the supply connections are correctly polarised and that no loose leads remain on the board.

Build with confidence

Construction tips

Recommended build order

Work from the lowest-profile components to the tallest so that the smaller solder pads remain accessible during construction.

  1. Fit the resistors, taking particular care with the resistor ladder values.
  2. Fit the small capacitors and D12, observing polarity where applicable.
  3. Fit the IC sockets, if supplied, and the regulator in accordance with the PCB footprint.
  4. Fit the LEDs and electrolytic capacitors, observing polarity.
  5. Fit RV1, SW1, SW2 and the connectors.
  6. Fit the battery connection and insert any socketed ICs in the correct orientation.
  7. Inspect all solder joints before applying power.

Electronics construction guide

If you are new to soldering or electronic kit construction, use the MitchElectronics Electronics Construction Guide alongside these instructions.

When it does not work

Troubleshooting

No LEDs illuminate

Check the battery and its polarity, D12 and the regulated 5V output of U7. If the status LEDs work but the binary output LEDs do not, check SW1 and the /OE input on U4, and remember that a binary result of zero will also leave the binary LEDs off.

The conversion does not start

Check SW2 and R12, confirm that START goes high when pressed, and check the state of U1A and CLK_EN after releasing SW2. Inspect the connections around U2 and the counter reset inputs. If the comparator is already asserting reset, investigate the analogue input and DAC_OUT voltages.

The counters do not advance

Check the clock generator around U2C, RV1, R8 and C1. With CLK_EN high, use an oscilloscope to confirm that CLK pulses reach the counter clock inputs. Check the cascade connection between U3 and U6 if only four bits appear to count.

The conversion never finishes

First check whether VIN is greater than the maximum voltage available at DAC_OUT. Next, measure the comparator output and the divided voltage at the reset input of U1A to confirm that the reset signal is high enough to be recognised by the 4013. A depleted battery may prevent this stage from working reliably.

The conversion result is incorrect

Check the ladder resistors R15 to R30 and their connections to the counter outputs. Confirm that /CLK_PHASE is the inverse of CLK and reaches U4. Compare the binary count with DAC_OUT using known input voltages, remembering that the resistor ratio and clock-stop timing affect accuracy.

External devices cannot read the output

Confirm that the external system shares a common ground, uses compatible logic levels and is controlling /OE through the correct SW1 position. Check that the external circuit does not drive the data bus at the same time as the ADC.

Ready to test and experiment?

The Discrete ADC demonstrates how standard analogue and digital components can be combined to perform a conversion that is usually hidden inside an integrated circuit. Once the kit is working, try adjusting the clock speed, measuring the DAC output and comparing the resulting binary number against a known voltage, as this will help you understand both how counter-type ADCs operate and what ultimately limits their performance.