Xavaum
Posts: 1
Joined: Wed Sep 28, 2016 7:31 pm

Powering H Bridge L298N with RPI

Thu Sep 29, 2016 10:34 pm

Hi, I am currently building a robot that will use two 5V DC motors with a H Bridge L298N. Exactly like this one:
Image
As I'll be using a 5V 2.1A 10000mAh power bank to power the RPI, I was wondering if I can power the L298N with the 5V GPIO pin. I am afraid to fry my board or something. Thanks!

User avatar
mikronauts
Posts: 2822
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Powering H Bridge L298N with RPI

Thu Sep 29, 2016 10:52 pm

NOT SAFE

Use a separate battery to power the motors, I suggest 4x-6x NimH AA cells.
Xavaum wrote:Hi, I am currently building a robot that will use two 5V DC motors with a H Bridge L298N. Exactly like this one:
Image
As I'll be using a 5V 2.1A 10000mAh power bank to power the RPI, I was wondering if I can power the L298N with the 5V GPIO pin. I am afraid to fry my board or something. Thanks!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
Gavinmc42
Posts: 5694
Joined: Wed Aug 28, 2013 3:31 am

Re: Powering H Bridge L298N with RPI

Fri Sep 30, 2016 3:43 am

Yep ditto that, use higher voltage battery for the motor.

The power bank is actually a 3.7 Li-Ion battery that has a swichmode regulator to increase the voltage to 5v USB.
You can use a cigarette USB charger($2) to power the Pi from the motor battery or another smaller USB power bank.

Higher voltage motors use less current for the same power output.
Less current means better efficiency usually, longer battery life/run time.
12-24v would be best, 18V drill battery?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Sun Apr 16, 2017 11:50 am

I am also building a robot car with 4 DC motors.
I have an extra Power Bank, 10,000 mA, can i use that to supply power to the L298H bridge instead of using 4AA batteries.

User avatar
Gavinmc42
Posts: 5694
Joined: Wed Aug 28, 2013 3:31 am

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 3:07 am

Do the motors stall currents total less than 2.1Amp?
Without motor specs who can tell?
But toy robot motors, especially low voltage ones may have over 1Amp stall current each.
L298 can provide 4 amps, if you use four of them that 16Amps.

I suspect the answer will be NO, not unless you paid $60+ for each low current Maxon motor.

Power banks are not designed to power high current motors, they are for recharging phones at 1-2amps
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 5:58 am

Gavinmc42 wrote:Do the motors stall currents total less than 2.1Amp?
Without motor specs who can tell?
But toy robot motors, especially low voltage ones may have over 1Amp stall current each.
L298 can provide 4 amps, if you use four of them that 16Amps.

I suspect the answer will be NO, not unless you paid $60+ for each low current Maxon motor.

Power banks are not designed to power high current motors, they are for recharging phones at 1-2amps
I am using a 4WD car kit that comes with Four Dual Shaft Motors with two on either side.
here is the image of it:
http://ecx.images-amazon.com/images/I/6 ... L1000_.jpg

I think this is the specs for these motors:
Working voltage : 3V to 9V
No-load current = 60 mA, Stall current = 700 mA.

User avatar
Gavinmc42
Posts: 5694
Joined: Wed Aug 28, 2013 3:31 am

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 7:15 am

Stall 2.8Amps total. Is it a 2.1amp output powerbank?
Better off with 6xAA NiMH cells, but you might get away with it on a flat surface.

Maybe PWM the drivers so you give them a slow start, instead of full power.
Don't try powering the Pi from the same power bank as voltage will probably drop when starting the motors and reset the Pi.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 7:57 am

Gavinmc42 wrote:Stall 2.8Amps total. Is it a 2.1amp output powerbank?
Better off with 6xAA NiMH cells, but you might get away with it on a flat surface.

Maybe PWM the drivers so you give them a slow start, instead of full power.
Don't try powering the Pi from the same power bank as voltage will probably drop when starting the motors and reset the Pi.
Yes the power bank has output of 5v, 2.1A
And currently in the car kit I had received 4AA battery pack and when I test the performance(speed), the car runs better with the power bank rather than the 4AA batteries.

Although there is a problem, that the power bank keeps turning off automatically, i guess thats the inbuild mechanism in it when connected to something that does not charge.

User avatar
joan
Posts: 15623
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 8:41 am

ibshar wrote: ...
Although there is a problem, that the power bank keeps turning off automatically, i guess thats the inbuild mechanism in it when connected to something that does not charge.
I expect they will automatically switch off if the cell voltage drops too low. Lithium battery cells lifetime will be reduced if the voltage is allowed to drop much below 3V.

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 11:27 am

ok... So any suggestions what I could use as a power source for the L298N with 4 DC motors?
I am looking for a reusable power source, that can be recharged and how much power is required ideally.

Moe
Posts: 230
Joined: Sun Jan 25, 2015 2:44 pm

Re: Powering H Bridge L298N with RPI

Mon Apr 17, 2017 8:17 pm

Options:
1. A bigger power bank. I have an EasyAcc one with three outputs that'll provide 4.8A overall.
2. 6V sealed lead-acid battery.
3. 12V lead-acid battery with cheap automotive 12V-5V buck module.
Option 3 could also power the Pi.
Submarine communication systems engineer and amateur robot enthusiast.

User avatar
Gavinmc42
Posts: 5694
Joined: Wed Aug 28, 2013 3:31 am

Re: Powering H Bridge L298N with RPI

Tue Apr 18, 2017 12:27 am

If those motors are rated to 9V then use 6 or 8xAA NiMH.
You could use 2 or 3 x LiFePO4 cells in series, these are lighter.
Duracell have a range of LiFePO4 cells as replacements for solar light, from hardware stores.

Sticking a big heavy lead acid battery on will slow the car down.

Hobby King have RC LiPo packs, a 2S (2 in series pack) is 7.4-8.4V.
Get fire safety bag too.

L298 are bipolar transistor drivers so expect voltage loss, about 1.2V?
5 -1.2 = 3.8V to motors.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Tue Apr 18, 2017 4:46 am

joan wrote:
ibshar wrote: ...
Although there is a problem, that the power bank keeps turning off automatically, i guess thats the inbuild mechanism in it when connected to something that does not charge.
I expect they will automatically switch off if the cell voltage drops too low. Lithium battery cells lifetime will be reduced if the voltage is allowed to drop much below 3V.
Sorry my mistake, the power bank works just fine powering the L298N driver and motors. It just turns off automatically when the car is idle, i guess coz it does not draw any power.

User avatar
Gavinmc42
Posts: 5694
Joined: Wed Aug 28, 2013 3:31 am

Re: Powering H Bridge L298N with RPI

Tue Apr 18, 2017 6:10 am

Sorry my mistake, the power bank works just fine powering the L298N driver and motors. It just turns off automatically when the car is idle, i guess coz it does not draw any power.
I guess that is to save power, once a phone is charged it does not draw much power.
Figure what this threshold is, 100ma? Put something in circuit that draws that amount.
Really bright head light LEDs.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
ibshar
Posts: 22
Joined: Sun Jul 31, 2016 3:00 pm

Re: Powering H Bridge L298N with RPI

Wed Apr 19, 2017 5:51 am

Yes, thanks.

Return to “Automation, sensing and robotics”