> I am designing a small digital voltmeter and current meter to build into a > piece of equipment. I'm probably going to use a 16c73 or 16c74. > I would like to be able to measure 0 to 40 Volts and 0 to 20 Amps. In the > lower range ( 0 to 25 Volts) I wanted .1 volt of resolution. If I feed the > input voltage through a 5.1:1 voltage divider network and into an A/D pin > clamping the voltage at 5 volts I should get .1 volts per step ie. 255 = > 25.5 volts, using Vdd = 5 volts as the reference. My problem is what do I > do to read above 25.5 volts with lower resolution? I was thinking about > switching in a further 2:1 divider network with a FET when my A/D reads 255 > and scaling the result in software to reflect the 2:1 division. Before you procede with this design, I would highly suggest that you consult Microchip's page of errata regarding the 16C74. If memory serves, the ADC is not accurate for any input voltage greater than about 3 volts. I would sug- gest that you feed the input through both 10:1 and a 20:1 divide-down net- works and use a VREF value of 2.5 volts. This will then give you 0 to 25 volts with 0.1 volt resolution, and 0 to 50 volts with 0.2 volts resolution. Since the A/D parts include multiple analog inputs, you could feed both in- puts to the part all the time (if the input is at 50 volts, the low-scale input will be at 5.0 volts; outside the useful range of the ADC but not so high as to cause clamping or device damage). One simple wiring approach would be to use 5 resistors in series: 47K, 33K, 100K, 10K, 10K. The left side of the 47K should be tied to the voltage to be measured. The node between the 100K and the first 10K should be tied to one of the PIC's inputs, along with a 0.01uF cap to ground. The node between the two 10K's should be tied to the other PIC input along with a second cap. The other side of the second 10K should be tied to ground. > For measuring current I am planning on using a .01 ohm shunt, ie. 20 > Amps would yield .2 Volts. I would scale Vdd down to .2 volts (25:1) and use > that as Vref. For measuring voltage as described above I would change the > A/D settings and use Vdd as the reference voltage. For current measurement, I think you will need to use an amplifier; if you try to scale Vref down to 0.2 volts, your measurements will be nominated by sampling noise and other nasty effects. I would suggest that if you wire three op-amps so as to produce an instrumentation amplifier with a 10:1 gain, your current measurements should be very accurate (you would connect the two sides of the instrumentation amplifier to the two ends of the shunt. By doing this, you cancel out any resistance between the shunt and ground.) > Can anyone suggest some way to simplify this project especially the > voltage measurement scaling. I would like to do away with the FET if > possible. Any comments or suggestions would be appreciated. Well, my current-measurement idea is more complex than what you propose (but should be much more accurate) but the voltage method should be simpler. That sound like a good compromise?