2018-05-28 08:21 AM
Hello ST All.
I have a NUCLEOL476RG and i have some troubles trying to read a battery level using ADC.
I made a voltage divider partitor to get 3.3V starting from 14.1V.
1) using 162K resistor + 50K resistor the adc read 2.9v
2) using 68.8k + 20.78k the adc read 2.6v.
Using multimeter on partitor in both read 3.20v .
If i read 3.3 from Nucleo (CN7 pin 2 or 4) adc read correctly.
please, Anyone may helm me with hints?
Regards,
Carmelo
Solved! Go to Solution.
2018-05-28 09:04 AM
ADC input is high impedence. Then ADC sample the voltage by connecting a RC to the ADC input pin for a while, then disconnecting the input pin, and convert. When connecting the RC, the cap maybe discharged...
The input impedence should be small (ideally a supply voltage), and here it is very resistive, the RC curve slows down and is cut before reaching the asymptotic ideal voltage.
==> If this situation is correct, increasing the sample time to maximum will yield a value closer to the expected one.
==> If the required sample time shall be higher than possible, you could stop the ADC clock during sampling phase to 'freeze the time'.
==> Alternatively, put a decoupling cap to ground (10uF?) at the ADC sampling point. Battery level changes slowly so the response time of the divider maynot be critical...
2018-05-28 09:04 AM
ADC input is high impedence. Then ADC sample the voltage by connecting a RC to the ADC input pin for a while, then disconnecting the input pin, and convert. When connecting the RC, the cap maybe discharged...
The input impedence should be small (ideally a supply voltage), and here it is very resistive, the RC curve slows down and is cut before reaching the asymptotic ideal voltage.
==> If this situation is correct, increasing the sample time to maximum will yield a value closer to the expected one.
==> If the required sample time shall be higher than possible, you could stop the ADC clock during sampling phase to 'freeze the time'.
==> Alternatively, put a decoupling cap to ground (10uF?) at the ADC sampling point. Battery level changes slowly so the response time of the divider maynot be critical...
2018-05-28 07:36 PM
decoupling cap should be closer to 1uF or even 0.1uF,
your problem is the high impedance.
if you require a fast response, then you should use an external OpAmp to drive the pin with low impedance.
this will give you a much faster changing voltage on the pin from the source and a rapid read capability.
2018-05-29 01:54 AM
Thanks a lot.
i, as you suggested , increase sample time