Skip to main content
Ofer
Associate III
November 4, 2021
Solved

Battery voltage monitoring

  • November 4, 2021
  • 3 replies
  • 929 views

We are using battery Litium ion one-cell.

Voltage of cell is between 3.3V to 4.5V.

We want to calculate battery voltage.

Is it possible to put 4.5V to pin of MCU (STM32L452) ?

    This topic has been closed for replies.
    Best answer by Javier1

    STM32L452 has a differential ADC channels, you could try to use them as you only need 4,5-3,3=1,2v span <3,3v

    3 replies

    Javier1
    Javier1Best answer
    Principal
    November 4, 2021

    STM32L452 has a differential ADC channels, you could try to use them as you only need 4,5-3,3=1,2v span <3,3v

    hit me up in https://www.linkedin.com/in/javiermuñoz/
    TDK
    Super User
    November 4, 2021

    It is unclear whether pins set to analog mode are 5V tolerant. On previous families, they were not.

    Regardless, even if the pins are 5V tolerant in analog mode, you will not be able to read voltages above VDDA, which is at most 3.6V. You will need a resistor divider network.

    "If you feel a post has answered your question, please click ""Accept as Solution""."
    Piranha
    Principal III
    November 7, 2021

    And a resistor divider will consume some current. For many battery operated systems one also has to design in some switch and turn it on only for the moments at which the voltage needs to be measured. The simplest switch is probably a 5V tolerant GPIO pin configured as an open drain output.