cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting a battery to STM32F401 to supply power only at night

RLand.2
Associate II

Hello ST community.

 

I'm using STM32F401RDT6 microcontroller which is powered during the day by a solar panel (power regulators converts the panel's voltage to 3V3). The MCU uses its internal RTC for logs and the issue is to keep the RTC running from the low power mode during the night.

I would like to place a coin bettry and connect it to the MCU via the VBAT pin in a way that during the day only the solar panel will feed the MCU, and at night only the battery will do so.

 

Connecting the battery directly to VBAT causes the battery to drain out even during the day which is not desirable.

 

I Couldn't find any good guidelines for this solution. I hope this forum could help.

Thanks in advance,

Raz.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

It is the main purpose of the VBAT pin to supply the VBAT domain when VDD is absent. You will find in the reference manual of the particular device:

The VBAT pin allows to power the device VBAT domain from an external battery, an external super-capacitor, or from VDD when no external battery and an external super-capacitor are present.

VBAT operation is activated when VDD is not present.

The VBAT pin supplies the RTC and the backup registers.

Connecting the battery to VBAT will not discharge it as the VBAT pin is disconnected from VDD via an internal switch when VDD is present.

Good luck!

When your question is answered, please close this topic by choosing Select as Best.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

8 REPLIES 8
Peter BENSCH
ST Employee

It is the main purpose of the VBAT pin to supply the VBAT domain when VDD is absent. You will find in the reference manual of the particular device:

The VBAT pin allows to power the device VBAT domain from an external battery, an external super-capacitor, or from VDD when no external battery and an external super-capacitor are present.

VBAT operation is activated when VDD is not present.

The VBAT pin supplies the RTC and the backup registers.

Connecting the battery to VBAT will not discharge it as the VBAT pin is disconnected from VDD via an internal switch when VDD is present.

Good luck!

When your question is answered, please close this topic by choosing Select as Best.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
RLand.2
Associate II

So connecting the battery completly separated and directly to VBAT pin, and another separated power supply connected to VDD will be sufficient?

Peter BENSCH
ST Employee

Absolutely correct.

Please make sure not to exceed the max voltage rating at the VBAT pin.

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
RLand.2
Associate II

Roger that.

Thanks for the support.

Ahajr.1
Associate II

@Peter BENSCH​  I would like to know if it's possible to perform a software switching from vdd to battery (while knowing that vdd is always present). it's in the case of activating BLE when system is powred from current loop. Also the charging could it be desactivated?

Thanks in advance

VBAT is only automatically switched to the VBAT domain. There is no other way, because everything else is normally not supplied in battery mode and the CPU loses access to the switch after switching to VBAT.

Maybe you should look for another solution, e.g. in connection with some external logic?

If I understand correctly, the supply voltage of the STM32 should come either from the battery (night mode) or from the solar panel (day mode), right?

In this case, a simple OR circuit with two Schottky diodes could decouple the two voltages. If, for example, the solar voltage is set slightly higher than the battery voltage, the solar voltage would always have priority, while the battery voltage would only be loaded when there is no solar voltage.

What do you mean by deactivating charging, i.e. charging of what?

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks for your quick reply

It's not the same application as @RLand.2

I do not use solar panel. but harvesting from a current loop 4-20mA to charge a supercap that will power the mcu only when ble is activated.

i think in that case i should switch externally between source line and battery.

I hadn't noticed that you had hijacked the thread. Since your application is a completely different application with a different STM32, it would make a lot of sense to open a separate thread.

(I was just surprised that you talked about BLE and a loop, which was not discussed before).

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.