Although good and inexpensive integrated analogue to digital (A-D) converters are now readily available, it may be instructive to build one from discrete components.
The present converter is based on a Type TLC274 IC, which contains four comparators. The output of these stages also forms the output of the converter.
The problem with designing A-D converters is producing a correctly tracking reference voltage. In fact, each bit requires a small dig-ital-to:analogue (D-A) converter to generate the needed reference. This problem is usually solved by assigning the MSB comparator half the supply voltage as reference: this is produced by potential divider R1 -R2. For each subsequent bit, the preceding bits are then added to the reference voltage, which requires a few resistors. In case of bit B, this means that bits c and D are used: for bit A, bits B, and D are used. The translating of the level of these bits is effected by IC2 and R1-R14.
The regulated 5-V supply voltage forms the basis for the reference voltage. The levels at the outputs of the buffers should ideally be 5 V (logic 1) or 0 V (logic 0). The resistors in the potential divider should be close tolerance types to ensure good linearity. The higher the resolution (the more bits) of the A-D converter, the more accurate the resistors need to be. It should also be borne in mind that the output level of the buffers in IC2 deviates more and more from the ideal the greater the current that must be provided. In other words, the value of the resistors must be relatively high. The problem is further minimized by connecting two non-inverting gates in parallel to increase fan-out. With values as shown, the voltage drop at the MS13 output buffer (that which provides the largest current) was 6 mV in the prototype. Compared with the value of theLSB of 312.5 mV, this is negligible.
The conversion speed depends on the propagation times of the comparators and buffers.
Although the TLC274 performs acceptably, for optimum results true comparators should be used.
The input sensitivity of the circuit is set with P1. Diodes D5 and D6 protect the opamp inputs against too high potentials.
The current drawn with all LEDs off is about mA; with all four LEDs on, this rises to about 20 mA.