Hi,
I have used "es_battery_voltage_saadc" in SDK 14.2 to read the voltage of battery, now I'm using SDK 17.02, but there is no es_battery_voltage_saadc.
Is there a better way to read the voltage of battey in SDK17.02?
Hi,
I have used "es_battery_voltage_saadc" in SDK 14.2 to read the voltage of battery, now I'm using SDK 17.02, but there is no es_battery_voltage_saadc.
Is there a better way to read the voltage of battey in SDK17.02?
Hello,
I have used "es_battery_voltage_saadc" in SDK 14.2 to read the voltage of battery, now I'm using SDK 17.02, but there is no es_battery_voltage_saadc.
You could still find this function in SDK_ROOT\components\ble\ble_services\eddystone\es_battery_voltage_saadc.c
Looking into the function it seems that it is just retrieving a single sample of the SAADC, without any conversion or mapping to a discharge curve of a battery (at least not that I immediately can see), so I am not sure how accurate the battery measurement would be from using this alone - unless some postprocessing of the returned value is also done somewhere.
If you would like to see the general approach for measuring a non-lipo battery you could take a look in the BLE proximity peripheral example from the SDK. For the Li-Po battery measurement case we have got this guide, which could be helpful to take a look at.
Is there a better way to read the voltage of battey in SDK17.02?
What kind of a battery will you be using?
In general, you will need to create your own mapping for the discharge curve of the specific battery you are working with - unless you are working with the CR2032 which ships with the nRF52 DK's (we have already made the discharge curve mapping for this particular battery).
Best regards,
Karl
Thanks for you reply Karl.
We are using Li-Battery .Actually, we just need to get the voltage of battery(3.6-4.2V).
In my application, I create a timer to get the voltage, so we don't use the SAADC_PPI example.
Thanks for you reply Karl.
We are using Li-Battery .Actually, we just need to get the voltage of battery(3.6-4.2V).
In my application, I create a timer to get the voltage, so we don't use the SAADC_PPI example.
Taylor said:Thanks for you reply Karl.
No problem at all, I am happy to help!
Taylor said:We are using Li-Battery .Actually, we just need to get the voltage of battery(3.6-4.2V).
In that case I highly recommend that you read through and follow the Lithium-ion battery measurement guide that I linked in my previous comment. Lithium-ion battery voltages can not be applied directly to the nRF52810 pins, since this exceeds it absolute maximum ratings and may therefore damage the chip.
Taylor said:In my application, I create a timer to get the voltage, so we don't use the SAADC_PPI example.
Sure. The method demonstrated in the SAADC example is primarily aimed at precisely periodic measurements. When you are not using the PPI peripheral to trigger sampling your sampling will have to wait for the CPU to be available, which would make periodic measurements miss their timing. In your case, where you only want to take a measurement every now and then, without any hard real-time constraints, it is fine to have the CPU trigger the sampling directly.
Best regards,
Karl