I am trying to connect the STM32 bluepill board to a lithium cell as the main power source, and to the output end of a solar charger. The idea is to have the solar as a backup during the low sun hours, if for any reason the cell was not charged then the STM is not disconnected. I know this is achievable using Arduino, but for reasons beyond my control I must now shift the development to an STM32, is this possible? Can the STM32 be powered from two independent power sources. The datasheet is quite dense, and I'm frankly stuck. I attached a sketch showing what I want the circuit to achieve.

Some Parameters/Info:

  • The solar charger permits two outputs, one for load (connected to STM) the other to the cell

  • The STM will be connected at all times to the cell and solar charger output

  • The STM will not be disconnected from the lithium cell when the cell is being charged (I assumed the STM is a negligible load-could be wrong) nor will it be disconnected from the solar charger output-Not sure if this would result in some technical conflict.

  • I have concerns regarding the authenticity of my STM bluepill, considering that I'm outside the US/EU there is a fair chance it's a clone (I bought this under the assumption it is an original) I've read online that the internal voltage regulators fail quickly not sure if my proposed setup of two independent sources could accelerate the damage.

  • Not sure if the decline in power (voltage rise and drop) of the solar charger and the cell as it discharges and charges could damage the STM board stm32 connection with two independent power sources

  • \$\begingroup\$ Search for "ideal diode". It's basically a circuit that simulates two diodes that have essentially zero forward voltage drop. You can find commercial parts, or example circuits built from discrete components. \$\endgroup\$
    – Dave Tweed
    Dec 16, 2022 at 16:17

1 Answer 1


You can do this with supplies with a simmilar voltage with something called an ideal diode.

The ideal diode will use the current highest of the two voltage sources, so it's best to use voltages that are similar.

Its also good to have some kind of regulator between the battery and the blue pill.

Another option is to get a circuit that will do both charge controlling and solar in the same chip which are available.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.