ADC interpretation

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
Timo
Posts: 7
Joined: Tue Nov 06, 2007 8:42 pm
Location: Northumberland
Contact:

ADC interpretation

Post by Timo »

The problem I'm experiencing has some similarities with topics already addressed but I am unable to find a solution within these.
I’m trying to obtain a degrees C temperature readout derived from the Microchip MCP9700A temp sensor, interpreted in Flowcode by an ADC input.
This device has a resolution of 10 mV per deg. C however part of the snag is that since it is capable of sensing down to -40 deg C it has an offset of 0.5V corresponding to 0 deg C.
Providing the A03 pin to of the PIC16f877A with a 1.7v +REF and including appropriately modified ‘Sample ADC’ macro using a C code box yields a resolution of
15 bits per 100mV (Byte variable to store ADC value), using 1.7V as the reference affords acceptable resolution but at 1.5 bits per degree its not clear how to resolve the actual temperature reading and provide the required offset.
Any advice appreciated.
Regards,
Tim

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ADC interpretation

Post by Benj »

Hello Tim

I think this is correct but I could be wrong.

Could you first minus the offset from your result to get just the positive temperature.

Then divide the raw value by 3 and multiply by 2 to get your temperature equivalent reading.

eg

Offset voltage = (256 / 1.7V) * 0.5V = 75

an adc reading of 1.1V = (256 / 1.7V) * 1.1V = 166
166 - 75 = 91
(91 / 3) * 2 = 60 degrees C.

an adc reading of 0.8V = (256 / 1.7V) * 0.8V = 120
120 - 75 = 45
(45 / 3) * 2 = 30 degrees C.

Timo
Posts: 7
Joined: Tue Nov 06, 2007 8:42 pm
Location: Northumberland
Contact:

Re: ADC interpretation

Post by Timo »

Thanks Ben I'll try your suggestion.
Regards,
Tim

Post Reply