2023-08-07 01:53 AM
Hi all,
I'm working with an STM32WL and I'm looking for an information I can't found. I have a voltage divider with 2 resistors to meseaure the battery voltage. I'd like to know what is the minimum current that the stm32wl can have on an analog input pin ?
For the moment my resistors are higt (1,5M et 2,2m do current is low for 5v max in enter)
Thanks
2023-08-07 02:23 AM
It must be described in the STM32 datasheet in question:
"I/O input leakage current"
2023-08-07 04:45 AM
It depends on how long the sampling capacitor will take to charge up. Generally, max impedance of around 1 MΩ. Slowing down ADC clock and increasing sampling time will help.
RADC, CADC and RAIN can be found in the datasheet.
2023-08-07 05:26 AM
For measuring almost static voltages from the battery, it helps a lot if you connect an auxiliary capacitor of approx. 1uF-10uF between the analog pin and GND. This will help cover the current between the internal CADC and the voltage on the divider at the time of sampling. The resistors can then be large enough, but you have to wait for the first measurement until the auxiliary capacitor is charged.
2023-08-07 05:46 AM
2023-08-07 08:03 AM
Nice thanks a lot for all answers. :grinning_face:
Good idea, I think I'll add a capacitor between ground and analog pin input. I don't need a big sample rate, I'll check my battery level every 2 minute I think...
2023-08-07 08:53 AM
Check the STM ADC input impedance, it's might be quite low (from a mega ohm standpoint ;) ), so you have check how your resistive divider is influenced by that.