cancel
Showing results for 
Search instead for 
Did you mean: 

Read a temperature sensor on a battery system

JJoao.1
Associate III

Hello everybody,

Actually I'm working on a temperature sensor. This project works on battery (2 x 1.5 V alkaline).

I would like to read the temperature in the room with an external analog sensor.

But I don't understand how VrefIN works. Because my Vcc supply is not fixed like it is on a battery.

Should I add an external fixed reference to the Vdda pin? but this one risks being distorted with the outside temperature?
I thought that an LDO internal to the microcontroller could power the ADC part, but I can't find it. My idea was to have a stable reference lower than Vcc (<2.5V) to read my temperature sensor and also the battery voltage to estimate battery wear.

 

Thank you

 

 

3 REPLIES 3
TDK
Guru

The VREFINT channel is a fixed voltage of about 1.21V. See the datasheet for exact range.

Measure the VREFINT voltage channel and infer/calculate what VREF+ is.

You know in general (assuming 12-bit readings):

VOLTAGE = (ADC counts) / 4095 * VREF+

so:

VREF+ = 1.21 * 4095 / (VREFINT counts)

 

After you know VREF+, you can measure VBAT or any other voltage you want.

If you feel a post has answered your question, please click "Accept as Solution".
Johi
Senior III

For sure this answer is a bit off topic, but there are sensors that measure temperature and send it through digitally such as DS18B20. I once built a pt100 measuring device to see afterwards that there were viable alternatives hence my reply.

Pavel A.
Evangelist III

+1 to @Johi , you can find a digital sensor which produces temperature in degrees, self-calibrates. Even more, for a battery powered device you can find a sensor that measures automatically and produces alarm/interrupt if the temperature goes out of specified range. Your MCU can sleep most of the time and wake from this signal.