cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong voltage readings from ADC

Francesco_
Associate II

Board: NUCLEO STM32F103RB - MB1136 C-01

Hi all,

I try read, trought ADC1_IN0 (pin PA0) , the temperauture value from LM35, but read wrong value.

LM35: connected at 5V, GND and A0.

ADC1_IN0: work at 8 MHz with voltage reference of 3.3V and 12 bit of resolution.

In ADC-> DR register is store a value of 535 equal about 44°C but the temperature in the room is about 20°C.

I think there is a problem with the voltage reference of the ADC. Can you help me?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> Why i have a problem with sampling time hight?

There are requirements on the minimum sample time for internal channels such as VREFINT, VTEMP and VBAT. Look at the datasheet for your chip to see what they are.

If you feel this question is answered, please select "Select as best" to mark a post as the answer.

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

View solution in original post

5 REPLIES 5
TDK
Guru

Increase sampling time.

If you feel a post has answered your question, please click "Accept as Solution".
Francesco_
Associate II

Hi TDK,

thanks for your attention.

I change the ADC frequency at 10.67 MHz, in the ADC_SMPR1 register is all zero, therefore the sampling time is 1,5 cycle. The problem persist.

Why do you think that the problem is te sampling time? The temperature has a slow variation in the time.

TDK
Guru

> therefore the sampling time is 1,5 cycle

This is the minimum sampling time. I suggested you increase it, but it looks like you haven't and are still asking me why it's not working.

If you feel a post has answered your question, please click "Accept as Solution".
Francesco_
Associate II

You're right, i got distracted.

Now, i reduced the sampling time and the value of temperature is correct. Why i have a problem with sampling time hight?

TDK
Guru

> Why i have a problem with sampling time hight?

There are requirements on the minimum sample time for internal channels such as VREFINT, VTEMP and VBAT. Look at the datasheet for your chip to see what they are.

If you feel this question is answered, please select "Select as best" to mark a post as the answer.

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