This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF51822 LiPo Voltage Reading

Hi! I am trying to read the voltage of a LiPo battery as explained in this blog post. The code on github however, is not compatible with the latest SDK for the SOC (12.3). Does anybody have an upgraded version or knows which function calls to swap? It is only a few lines of code so I hope somebody could help me with that.

Thank you!

Parents
  • Hi,

    We do not have a update of the github example, but you can refer to the ADC example in SDK 12.3.

    The important point is anyway the schematics in the blog post, showing how you use a resistor network to charge a capacitor (with high resistance resistors to reduce the current leakage). In turn, this capacitor charges the internal capacitor of the ADC during sampling. If this was not present, charging the internal capacitance would increase the current draw from the battery, pulling down the voltage, so the measurement would be incorrect. The ADC sampling code itself is straightforward.

  • Thank you for response! I have the schematics transferred to a simple breadboard and tried to copy the ADC sample code from SDK12.3, but somehow my app gets stuck on nrf_drv_adc_buffer_convert. I am using P01 to connect the ADC and use it with NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_2). What could be wrong here with the code?

Reply Children
Related