cancel
Showing results for 
Search instead for 
Did you mean: 

Read battery voltage for external RTC on STM32

dreamcoder
Associate II

I am using STM32F446RE for my application to just log the time accurately. I have an RTC module DS3231SN[1] connected to the STM32 on the I2C. The RTC is connected to a coin cell battery CR2032[2] for a long life on its VBAT terminal. The entire board by itself is powered with an external 5V. However, the device is expected to last for 10 years and the device is powered on roughly for 2000h.

  1.  How much life can I estimate from a 230mAh battery? The datasheet mentions the different current drawn but I cannot say for sure how long the device is powered with the external 5V rail. Is the IBATTC used even though I am not using the temperature data in my code? [3]
  2. What is the best way to keep track of the status of the coin cell battery? I have connected the STM32 VBAT pin to the coin cell battery. The minimum supply voltage for the RTC is 2.3V. So, does that mean if the battery voltage drops to 2.3V, the RTC shuts down when there is no external 5V supplied?
  3.  I want to design an LED indicator for the battery status with the following states:  
    1. 3.0V - 2.75V = State 1 (Battery OK)  
    2. 2.75V - 2.5V = State 2  
    3. 2.5V - 2.3V = State 3  
    4. <2.3V = State 4 (Battery fail)  

I can read the battery voltage from the VBAT pin on the STM32. Is the voltage read a linear relation with the battery capacity? Circuit[4]

 [1]: https://www.mouser.de/datasheet/2/609/DS3231-3122489.pdf

 [2]: https://asset.conrad.com/media10/add/160267/c1/-/en/000650957DS02/datenblatt-650957-varta-lithium-coin-cr2032-bli-1-knopfzelle-cr-2032-lithium-230-mah-3-v-1-st.pdf

 [3]: https://i.stack.imgur.com/sN7Db.png

 [4]: https://i.stack.imgur.com/YJ5oH.png

1 REPLY 1
TDK
Guru

Voltage and capacity remaining are not linear. Look up "CR2032 discharge curve" to get an idea.

https://components101.com/sites/default/files/inline-images/CR2032-Discharge-Time.png

You could track total battery on-time, but measuring the voltage and correlating that to the curve is how battery life remaining is typically done. Temperature plays a big effect.

If you feel a post has answered your question, please click "Accept as Solution".