Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Battery measurement when charging?

Is there a way only from the analog input where measure the battery voltage to distinguish that battery is charging?

I am short on IOs and will be quite a challenge to find extra input to hook a charging signal from the charging IC or the USB connector Frowning2

Thanks

  • Hello,

    Which device are you working with?
    The SAADC may measure the VDD bus directly through configuring the channel to measure VDD or VDDHDIV5.
    This will not require any external routing or wiring. You can try this in the SAADC example by changing the channel configuration set with NRFX_SAADC_DEFAULT_CONFIG_SE to use the SAADC input NRF_SAADC_INPUT_VDD instead of _AIN0.

    Best regards,
    Karl

  • Hello, The device is nRF52840, but the problem is that between battery and nRF I have an external 3.3V voltage regulator. The only direct connection between the battery (LiIon 3.7V) is the voltage divider that is hooked to AI0, so I was interested if there is some algorithm that by just only reading analog input can distinguish if battery is charging or is full (4.2V)?  My charging chips are MCP73831 or bq24092.

    Thanks

  • Hello again,

    samsam said:
    The device is nRF52840, but the problem is that between battery and nRF I have an external 3.3V voltage regulator.

    Thank you for clarifying, this is very helpful to know.

    samsam said:
    The only direct connection between the battery (LiIon 3.7V) is the voltage divider that is hooked to AI0

    How is this voltage divider connected to your AIN0 pin?
    Please be advised that the absolute maximum rating for voltage on the I/O pins with VDD < 3.6 V is VDD + 0.3 V, so if you are letting the battery's 3.7 V directly to the AIN0 pin these limits are exceeded and might permanently damage the chip.

    samsam said:
    so I was interested if there is some algorithm that by just only reading analog input can distinguish if battery is charging or is full (4.2V)?  My charging chips are MCP73831 or bq24092.

    Yes, but this will depend on how your analog input is wired to your battery circuit. You could then measure how the voltage of the battery changes over time, and use this to deduce what the charger is doing.
    Better yet, I skimmed quickly through the MCP73831 datasheet, and it seems to me that it comes with a Charge Status Output feature that can be used to determine the current state of the charging.
    Have you looked into making use of this for your application? 
     
    Best regards,
    Karl

  • Hi Karl,

    The voltage divider (both schematic and values) are the same as https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52 - second schematic (with capacitor)

    I know that MCP73831 (bq24092 also) has  status output, but I already wrote in my very first posting – I’m short on IOs and in order to use an extra input for this purpose, I’ll have to sacrifice some other functionality Frowning2

    Thanks

    P.S. devzone again behaves weird - I don't have "Reply" button to answer your last posting, so had to "Reply" myself on older posting. This problem runs couple years already I think :( Cant it be fixed?

  • samsam said:
    The voltage divider (both schematic and values) are the same as https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/measuring-lithium-battery-voltage-with-nrf52 - second schematic (with capacitor)

    Oh, thank you for clarifying this! If the voltage divider is wired the same way as in the blogpost schematic, you can measure the voltage of your battery directly - like explained in the blogpost.
    This makes me unsure if I might have misunderstood some part of your question - since this is exactly what is explained in the blogpost?

    samsam said:
    I’m short on IOs and in order to use an extra input for this purpose, I’ll have to sacrifice some other functionality Frowning2

    Aha, I see. Well, if your schematic is as in the tutorial, you can sample the voltage of your battery as shown in the tutorial. You will then have to implement some logic that determines with high enough accuracy and any real-time constraints your application may have, whether the voltage is rising or falling, to determine whether the battery is charging or not.

    samsam said:
    P.S. devzone again behaves weird - I don't have "Reply" button to answer your last posting, so had to "Reply" myself on older posting. This problem runs couple years already I think :( Cant it be fixed?

    Yes, this is a known issue for some time now, unfortunately..
    A workaround is to click the timestamp of the comment you are interested in replying to - this should make all the options for the comment show up. This is far from ideal, and we hope to have this fixed soon, you and me both!

    Best regards,
    Karl

Related