Page 1 of 1

AD22100 Temperature Sensor - Formula required simplifying

Posted: Tue Nov 17, 2009 10:07 pm
by medelec35
I have a AD22100 temperature sensor.
According to data sheet Temperature coefficient of 22.5mV/ deg C
Since it has o/p at 0.25V (which would be the offset) at -50 deg C therefore
formula derived form that is Vout = (Measured temp +50)*0.0225+0.25
Transposing for measure temp (T)
T=50*(8*Vout-11)/9
With variable asigned as Int. If I replace Vout with ADC count I get
T = 50*(8*(5/1023*ADC Count)-11)/9
This works great on excel or a calculator, just not in a formula for a micocontroller. :cry:
To test
at 4.75V = ADC of about 971 Temp Approx 150 deg C
at 1.87V = ADC of about 382 Temp Approx 22 deg C

Edit Ive just worked out :
T=(2000*ADC)/9207-(550/9).....Getting better, any one can help please?
I would be really greatful.
Thank you.

Re: AD22100 Temperature Sensor - Formula required simplifying

Posted: Wed Nov 18, 2009 8:59 am
by medelec35
Worked out what is going wrong!
If result of any of calculations (including intermediate results) is greater than maximum 32767 or less than -32767 in case of integers, then results are not as expected.
I believe this is very easily overlooked (or me being dumb :p. Should set up a vote 1=Me dumb or 5= easily overlooked :lol: )

What does work is:
Temperature = ((20*ADC_Count)/92)-60
Phew!