Hello
I want to power the stm32 blue pill board with a battery around 4 batteries of 1.2V each in series this will be directly given as 5V in to the blue pill board.
The blue pill board seems to accept a range of +3.6V to +5.5V as input on its 5V power pin.
However I read on
https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill.htmlWarning: The +5V pins on this board are directly connected to the +5V pin of the USB connector. There is no protection in place. Do not power this board through USB and an external power supply at the same time.
The problem is that I want to simultaneously sent serial data over usb from blue pill board to a pc, so I will have a usb cable connected to the pc the same time I power the board with a battery.
Would I need to do some changes to this setup so that nothing blows up, or causes damage to either the pc or the board.
So then you need to either
1 disconnect the 5V from the USB-PC side
2 undersold the on board LDO and power the STM32 directly with an external LDO/SMPS using the 4 AA batteries
3 disable USB power on the PC side not sure if you can do that but there is a chance u can (depends a lon on how the USB is implemented
Something like this. Low gate threshold voltage p-fet, schottky diode.
Thanks @Sniper1 and @DavidAlfa
so in either case I will have cut a copper trace on the board, correct?.
Fine that's not an issue I guess, I will just need to find that USB power trace on the board, hope fully I can get that from the schematics and pcb layout in case they are available.
The STM32 has a 3.3V supply voltage.
You don't need 4 batteries, 3 is enough.
I don't remember the maximum allowable voltage, it seems to be 3.6V, but I would recommend connect Schottky diode with 3 batteries to slow down a little. And this will become a protection against the struggle of power sources.
At the same time, there is no need to cut anything instead, just connect batteries with diode to 3.3V pin.
Or you connect the USB DM, DP and GND to the GPIO pins of the bluepill.
PA11 = DM
PA12 = DP
GND = GND
Cut of one end of a USB cable and figure out which wire is which and stick some dupont connectors on them. No need to cut any traces on the board. When you use the bluepill on a daughter board add a USB connector to is and route the data an ground pins, but don't connect the power supply pin.
@pcprogrammer nice idea!
@S. Petrukin
i was going to use a LDO in between the battery and the blue pill board so chose 4 batteries, 1.2V per battery nominal .
I guess in reality the voltage would probably be higher maybe 1.3 to 1.4V per battery especially a fully charged one. so that would be close to 3.9V.
A schottky perhaps yes, I see in the STM32F103x8 datasheet the absolute max for Vdd is 4V.
Also was going to use the Adc peripheral so not sure what effect A slowing dropping Vdd will have on Vref.
Why don't you get a Li-ion board with a small battery?
Like this one:
www.aliexpress.com/item/1005004616088520.htmlThe module will always output 5V on the VO+/VO- pads. Solder a battery to B+/B-.
Cut the 5V USB trace from the BluePill usb port and connect it to the charger board.
Also was going to use the Adc peripheral so not sure what effect A slowing dropping Vdd will have on Vref.
Similarly, you can connect 4 batteries to 5V pin thrue diode.
For a reliable situation, you need to add another diode to the USB power supply circuit or cut off the track - it is clearly visible on the PCB.
The board already has LOD 5-3.3V. Why add more?
Do not forget that LDO simply drop part of the battery charge into the air.
Vref does not depend from supply voltage, it is stable over the entire range of MC performance.
A single diode would be ok, see below.
The regulator there should work fine from 4V up.
Btw the ADC ref voltage is the Vcc3V3 in case of this stm32 chip..
Btw the ADC ref voltage is the Vcc3V3 in case of this stm32 chip..
This is the pin of the external Vref connected to the VDDA (intermally in package LQFP64), but we have an internal Vrefint = 1.2V, isn't it?
Bluepill 103C8T6 is not in a 64pin package, and there is no 1.2V internal ref, afaik.
There is a special pin for an external Vref on 100+ pins packages only (talking stm32F103xxx).
PS: below v2 - it protects USB against a short in your battery, and it allows a trickle charge of the battery as well..
Bluepill 103C8T6 is not in a 64pin package, and there is no 1.2V internal ref, afaik.
There is a special pin for an external Vref on 100+ pins packages only (talking stm32F103xxx).
PS: below v2 - it protects USB against a short in your battery, and it allows a trickle charge of the battery as well..
It looks like I forgot this old processor and made a mistake - it really doesn't have a built-in reference voltage.
Bluepill 103C8T6 is not in a 64pin package, and there is no 1.2V internal ref, afaik.
There is a special pin for an external Vref on 100+ pins packages only (talking stm32F103xxx).
PS: below v2 - it protects USB against a short in your battery, and it allows a trickle charge of the battery as well..
It looks like I forgot this old processor and made a mistake - it really doesn't have a built-in reference voltage.
It does have an internal reference voltage, but it is on an internal input channel on ADC1. It is not used for the conversion process. It is mentioned in the RM0008 Reference manual for the STM32F10 series. See page 217 for the block diagram of the ADC peripheral and page 219 for more info.
Temperature sensor/V REFINT internal channels
The Temperature sensor is connected to channel ADCx_IN16 and the internal reference voltage V REFINT is connected to ADCx_IN17. These two internal channels can be selected and converted as injected or regular channels.
Note: The sensor and V REFINT are only available on the master ADC1 peripheral.
The value is typical 1.2V. This is mentioned in the datasheet for the STM32F103x8 on page 41.
I made my own version of the Bluepill you can have custom manufactured at JLCPCB. It already has the BOM/CPL done. You could customize it for your needs, add a TP4056 or MT3608 or stuff like that to it to accommodate charging and regulation.
https://github.com/profdc9/STM32surface
A single diode would be ok, see below.
The regulator there should work fine from 4V up.
Btw the ADC ref voltage is the Vcc3V3 in case of this stm32 chip..
Won't this circuit act like a charger to the connected battery.
I was considering connecting the battery to 5V.
so 4 * 1.2 = 4.8 or say worst case 5 to 5.1V.
But the usb supply would be around 4.9 to 5V.
So once the battery drops below 4.9 the usb would try to charge the battery.
Correct me if I'm wrong.