Rob,
You need to account for the ADC reference voltage and the number of bits. Assuming you are using the pic ADC, the ADC is 10 bits and is likely referenced to 5 volts.
This gives: 5V/1024 = 0.0048828 Volts per bit (4.8828mV per bit).
Now, as Tim mentioned, 100mV across the shunt = 1 Amp*.
Putting that together, each bit from the result of adc1 – adc2 will represent .048828 Amps (48.828mA).
Code:
amp = adc1 – adc2
mamp = amp * 4883
LCDOUT $FE, $80, DEC mamp/100, ".", DEC2 mamp, "mA"
*But, you mentioned “The board has two resistor divider adc inputs…” I would guess that these are dropping the voltages down to the input range of the pic. If this is the case, then you may not be getting 100mV per 1 Amp. For instance, if the voltage divider was set up to give 1/10 of the voltages before and after the shunt, you would end up with 10mV per 1 Amp getting to the ADC. So you will need to adjust the numbers above accordingly.
Bookmarks