Powering HBridge from 5V pin

Hi,

I am building a hobby car project that uses esp32c3 mini board and HBridge (L289). Previously, I was powering the HBridge board separately from the microcontroller using 4 AA batteries connected in series. The esp32 board was powered with 2AA batteries from another battery box.

This setup worked relatively well, however I was quite upset because of the fact that batteries did not last long :(.

Now I am thinking of trying using a powerbank as a source of supply, that would be connected to the esp32 board directly via the USB inlet. And the question is, can I connect the HBridge from the 5V output, without a risk of damaging the board?

The H-Bridge is going to power two small DC motors, I can't find any marking details about the motor, but it's like this: https://ae-pic-a1.aliexpress-media.com/kf/S12e96948f76944ccabc913e16f250c18U.jpg_960x960q75.jpg_.avif

I am worried that the motors would require high current, and the esp32 board will burn because of it.

can I connect the HBridge from the 5V output, without a risk of damaging the board?

It's questionable if that is a good idea. The ESP32-C3-DevKitM-1 has a diode between the USB input and the 5V output. It may be able to handle the current but will certainly further reduce the voltage to the motors.

Is it a better idea to connect the powerbank to HBridge, and to use it's 5V output to power esp32 board through the 5V leg?

That won't work. The L298 board will only output 5V if the input is between 7V and 12V

FYI: Some power banks will auto turn off if a certain minimum amount of current is not used

If you use two 3.7V Li-ion batteries in series to give you 7.4V and connect that to the L298 input, then you can use the L298 5V output to power the ESP.

Yes, not through the regulator though. Remove the jumper.


And be aware that the motor voltage will be <4V, L289 is not very efficient driver.

so as I understand the idea I am connecting the power bank to H~Bridge and contoller at the same time (e.g. as I am removing the 5V jumpter, I guess it just forwards 5V to controller)?

I moved your topic to a more appropriate forum category @oltarasenko.

The Nano Family > Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, when creating a topic please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

They will last a lot longer if you use a modern MOSFET motor driver, rather than that 1970s dinosaur. The L298 wastes a huge fraction of the battery power as heat.

Pololu has the best selection.

Yes. It equals to powering them separately from 2-port power bank.

Does you power bank have auto shutoff?

I am a bit new to this topic, so I just googled for H_Bridge and got this one. But don't I understand it correctly that most of the power is consumed by motors at the end of the day? What 2-channel Hbridge model should I look for instead?

Yeah, it has. But it has a special feature that allows to be disabled it for small (wearable devices for 2 hours). I am using powerbanks, because I am a bit afraid of 18650-type devices. Mostly scared of possible fires etc. I wonder if there is safe reliable option among these batteries to try?

You should only buy batteries that say they are fully protected.
Does you power bank have overcurrent protection?

What do you imagine is inside many powerbanks ?

I imagine they have some of protection circuits. E.g. short circuit protection, overcharge protection? Isn't it the case?

I don't know how to check it, but the instruction says it can give up to 2A current.

No, not with that H-bridge. Depending on the motor power source voltage and motor current draw, as much as 40% of the battery power is wasted as heat in the H-bridge chip. The L298 or L293 H-bridges are suitable only for very small, low power toy motors.

The 18650 batteries can supply a lot of current even the protected ones. If you are unsure about what you are doing, then use the powerbank.

Yes, I agree. It's a hobby at the end of the day. I want to learn with my son, ideally in the safe way. Maybe in future we will get to real batteries, but I would want to know for sure what I am doing when I start with them. Right now it's more like reading, trying, fixing, reading again! Thanks for wise advise and support!