I had an idea to build an A/D circuit where an analog voltage is converted to digital, then displayed on a seven segment display - similar to a volt meter only I'm manually inserting voltage.
My basic idea is simple but I'm having problems with it. Currently I have
15 volts going through a pot, into a unity gain op-amp, and into an A/D.
My resolution (at the moment) is not important, however, I'd like to display one digit after the decimal point.
I believe I need to add 6 to any number over 9 to allow for a carry, but I'm unsure how to achieve it. I guess I'd need a logic circuit to determine if the number is beyond 9, then an adder, and then a binary to seven segment chip?
OK. Then use an A/D converter with built-in conversion to BCD. Such as the ICL7135.
Otherwise, the problem is that converting between 8 bit binary (such as a "regular" A/D produces) and BCD (such as a display driver needs) is not as trivial as it may appear. The equation is actually;
dbcd = (m*9256 + I*516 + b*26 + cc)*6 + x
In this equation, x = the actual decimal value; cc = the integer value of (x modulo 100)/10; b = the integer value of (x modulo 1000)/100; I = the integer value of (x modulo 10000)/1000; and m = the integer value of x/10000.
Which is trivial to do in software (eg a PIC) or in a lookup table (eg an EPROM) but "quite tricky" to do in logic chips.
Ah, but did you know that carrots grow particularly well in old buckets?
Lacing the soil in the bottom with plant food will encourage them to grow down towards it. The sides of the bucket stop (low flying) carrot fly from getting at the growing plants. Start with the buckets indoors (or a greenhouse/cold frame if you have one) to aid germination and then move them outside when it gets warmer. A bare copper wire wound around the bucket will stop slugs and snails climbing up..
My point being, the binary to multi-digit decimal display problem is an old chestnut, included in most electronics courses at some point. Any electronics engineer should be familiar with it - just as any gardener forced to live in a flat knows how to still grow carrots. ;)
You might want to investigate dual-slope analog to digital conversion. The idea is that you convert your input voltage into a proportional current, and use it to charge a capacitor for a fixed time. Then you switch to a known voltage, which produces a known current, and use it to discharge the capacitor while counting the time it takes. When the voltage reaches zero, the time elapsed is proportional to the input voltage.
For example, suppose the reference voltage is 2.0 V, and your counter counts to 1999 full scale - 2000 counts total. Suppose your input voltage is 0.4 volts. So you charge the capacitor while counting from 0 to 2000 at a current proportional to 0.4 V. Then you switch to the 2 V reference, so the current is 5 times larger, and count up from zero while the capacitor voltage drops back to zero volts. Since the current is 5 times larger, it takes 1/5 as long to reach zero, and the counter will only be at 400 - which is the measured voltage to display.
It's a nice technique, if you're not in a hurry, because drift in most of the circuit components is automatically cancelled out. The only "digital" part of the circuit is the counter, so you can easily use 3 digits of decade counters plus a flipflop to get a 2000-count counter with decimal outputs ready to drive LED display drivers directly. No binary to digital conversion needed - just count in decimal!
The nice thing about dual-slope A/D converters is that the conversion cancels noise (with a frequency > 2x the conversion rate). The technique is limited by the reference current and quality of the capacitors used. It's also slow, which is usually fine for most meters. It's not so great if you want to do true RMS reading, though.
Classical A/D converters can do direct decimal conversations by using a decimal (BCD) weighted digital to analog converters, as well.