Hi,
Does nRF52832 use normal ADC input to detect battery level (ex. AIN0, AIN1...)? or nRF52832 have other method to do this job?
Thank you,
Chianglin
Hi,
Does nRF52832 use normal ADC input to detect battery level (ex. AIN0, AIN1...)? or nRF52832 have other method to do this job?
Thank you,
Chianglin
Hi,
The SAADC on the nRF52 has a direct connection to VDD, so you do not need to use any of the external AIN pins if the battery is directly connected to VDD on the nRF. This is selected by setting the PSEL register to VDD.
Note that measuring the battery voltage like this has a few disadvantages. For instance, the measurement operation will affect the measurement, since it is part of the circuit. You can minimize that effect by following these guidelines, but that requires you do use an external pin (AIN0,...) to do it. Even his approach gives quite course results though, so if you need very accurate battery data, the best option may be to use a dedicated battery gauge IC.
Hi,
If I don't need get a accurate battery level, then I can direct connect battery with Vcc pin. Does it correct?
How to set PSEL register?
Would you please give me a sample code?
Thank you
Hi,
Please refer to the Proximity Application example in SDK 15.3. There you can see how the SAADC driver is configured for VDD measurement in line 283-297 of <SDK15.3>\examples\ble_peripheral\ble_app_proximity\main.c. You can refer to the other ADC related code in the file to see a complete example of battery measurement (and even how to use the standard Bluetooth battery service if that is relevant).
Hi,
Thank you for your explain.
VDD is define in "H7" and "A7" pin of nRF52832, it is used as power input of MCU. Does it also can detect battery level?
Thank you,
chianglin said:VDD is define in "H7" and "A7" pin of nRF52832, it is used as power input of MCU. Does it also can detect battery level?
Yes, but only if you have connected VDD directly to the battery, as mentionned in my initial reply.