mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

L298N motor drive not working when using battery power src

Fri Jan 16, 2015 5:19 pm

Hi everyone...
I have finish building my robot car... but seems that there is problem in power supply and I am seeking for your help.
I am now using this model. Image

At the moment, My car can work if I supply power from RPi 5V power pin... (But the power is so weak, the motor turn so slow)... here is the schematics.
Image

So, I have change the design to supply power to the L298N by 4x1.5V battery... schematics:
Image
However, the motor won't even move. I am getting very confuse!!!!!!

Anyone can help me to solve the problem?
btw... My circuit design is quite similar to this video:
https://www.youtube.com/watch?v=b4uhh_j8uR0 (I am not using the battery to supply power to the Pi, I use micro USB to supply power the Pi)

gordon77
Posts: 3355
Joined: Sun Aug 05, 2012 3:12 pm

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 5:30 pm

I would suggest connecting the pwr gnd to battery -ve and the pi gnd, l think they did that in the video.

mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 5:42 pm

gordon77 wrote:I would suggest connecting the pwr gnd to battery -ve and the pi gnd, l think they did that in the video.
I am not able to test it now. I will try it after an hour later. May I know how come you said that?
btw... the 298N showing me a green light... seems there is a problem in power supply

gordon77
Posts: 3355
Joined: Sun Aug 05, 2012 3:12 pm

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 5:51 pm

And 5v from the Pi to 5v terminal, as in the video

And the 5v enable link isn't fitted in the video.

mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:07 pm

gordon77 wrote:And 5v from the Pi to 5v terminal, as in the video

And the 5v enable link isn't fitted in the video.
Seems that he wants to supply power to Pi by battery cells so he connect in this form

gordon77
Posts: 3355
Joined: Sun Aug 05, 2012 3:12 pm

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:14 pm

I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.

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

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:36 pm

gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
If the L298N motor board 5V jumper is in place then the logic 5V required is derived from the motor supply and 5V must NOT be supplied by the Pi.

mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:40 pm

gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
Seems I find the problem, but I dont know the soulution... I place the jumper to enableA. Acually, there are two pin for enableA, what is the mean of each?

gordon77
Posts: 3355
Joined: Sun Aug 05, 2012 3:12 pm

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:48 pm

joan wrote:
gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
If the L298N motor board 5V jumper is in place then the logic 5V required is derived from the motor supply and 5V must NOT be supplied by the Pi.
Thanks. Datasheet anywhere?

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

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:51 pm

mannok wrote:
gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
Seems I find the problem, but I dont know the soulution... I place the jumper to enableA. Acually, there are two pin for enableA, what is the mean of each?
There is one enable pin for each motor. I suggest you leave them jumpered so both A and B outputs are enabled.

Motor A has two inputs, IN1 and IN2. Connect IN1 and IN2 to gpios (through a resistor if you prefer). Set one gpio high and the other low, the motor will move in one direction. Change to one gpio low, the other high to change direction. If both gpios are high or both gpios are low the motor will stop.

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

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 6:52 pm

gordon77 wrote:
joan wrote:
gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
If the L298N motor board 5V jumper is in place then the logic 5V required is derived from the motor supply and 5V must NOT be supplied by the Pi.
Thanks. Datasheet anywhere?
I'm not aware of one. I think people look at the chips and then follow the tracks to work out what is going on.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 7:08 pm

The 5v produced by the on board voltage regulator is not stable enough to run a pi (it fluctuates when the motors are driven) so should not be used (as you don't want two seperate 5v supplies to the same device, especially if one of them is fluctuating).

If the jumper is removed then the pi can supply the 5v to the board.
Doug.
Building Management Systems Engineer.

mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 7:55 pm

joan wrote:
mannok wrote:
gordon77 wrote:I dont think so, his pi is powered by the micro usb plug.

Isnt it a 5v input to the 298n? I cant find a datasheet for this board.
Seems I find the problem, but I dont know the soulution... I place the jumper to enableA. Acually, there are two pin for enableA, what is the mean of each?
There is one enable pin for each motor. I suggest you leave them jumpered so both A and B outputs are enabled.

Motor A has two inputs, IN1 and IN2. Connect IN1 and IN2 to gpios (through a resistor if you prefer). Set one gpio high and the other low, the motor will move in one direction. Change to one gpio low, the other high to change direction. If both gpios are high or both gpios are low the motor will stop.
There are two pins for enableA and other two pins for enableB :(
as in the picture: http://i1.minus.com/ibch7xnAhDDkoT.jpg
You can see both enableA and enableB have two pins. both pair of them are jumpered

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

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 8:07 pm

Enable A is next to IN1. Enable B is next to IN4. The pin behind each enable pin is connected to 5V. The jumper connects 5V to the enable pin.

mannok
Posts: 26
Joined: Sun Jan 11, 2015 11:19 am

Re: L298N motor drive not working when using battery power s

Fri Jan 16, 2015 9:03 pm

joan wrote:Enable A is next to IN1. Enable B is next to IN4. The pin behind each enable pin is connected to 5V. The jumper connects 5V to the enable pin.
SOLVED!!! thanks!!!!

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: No registered users and 15 guests