0
$\begingroup$

I want to turn some motors using my raspberry pi. I am able to turn an LED on and off using the 3.3V GPIO pin. For the motors, I tried using a L293D chip as per the instructions on this link.

What happened is that the very first time I set the circuit up for one motor, it worked perfectly. But then, I moved the pi a little and the motor has since refused to work. I even bought a new pi and still no luck with the circuit. I then bought a L298N board that fits smugly on top of the GPIO pins of the pi and followed the instructions on the this video

Still no luck, the motor just won't run with either pi. I am using four AA batteries to power the motor and a connecting the pi to a power supply from the wall. What could possibly be the problem here?

$\endgroup$
1
  • $\begingroup$ Can you post pictures and/or schematics of how you have this set up? The "moved it a little and then it stopped working" is probably a red herring; probably something else is going on and that's the last time you remember it working. $\endgroup$
    – Chuck
    Commented Nov 11, 2015 at 23:07

5 Answers 5

1
$\begingroup$

If you have changed the Pi and changed the L298N board then I would suspect there is a problem with the motor. Is it possible to drive the motor without the Pi?

You could try replacing the batteries with a second power supply, I'm assuming you have checked the batteries aren't flat :)

$\endgroup$
4
  • $\begingroup$ Sorry - forgot to mention.. I did try connecting the motors directly to the battery as well and they seem to work fine. $\endgroup$ Commented Nov 10, 2015 at 18:53
  • $\begingroup$ Have you checked/changed all the wires? Did you disconnect the wires when you moved the pi? If so its possible the wiring diagram is wrong and you put a wire in the wrong place first time? Have you rubbed the batteries between your hands? :) $\endgroup$ Commented Nov 10, 2015 at 20:02
  • $\begingroup$ Yeah, I checked the wiring diagram multiple times and still no luck :(. Can you recommend a motor shield that worked for you with the RPi? $\endgroup$ Commented Nov 10, 2015 at 20:13
  • $\begingroup$ Sorry, but I've never used a pi and a motor. I have used an Arduino and a motor driver board, the cheep $1 ones of eBay/AliExpress. aliexpress.com/item/… But I'm not sure that will help, because it needs 5V logic. $\endgroup$ Commented Nov 13, 2015 at 12:56
1
$\begingroup$

I know that this is an old post but I found it when searching to understand why my motor wasn't working. I finally found the solution to my problem so I thought that I'd post it in case anyone else runs into it in the future. I lost hours to this issue.

I'd run a very similar program on an arduino and it worked fine - I couldn't work out why it wasn't working on my pi. I had coincidentally used the same tutorial as the author but I didn't even get the motor to run once.

My problem was that I was running the pi from a USB connected to my mac and it wasn't powerful enough to run the pi for the motor, despite having a separate 9v battery for the motor. When I changed to a mains connected power supply the motor ran fine.

$\endgroup$
0
$\begingroup$

run a continuity test on the windings using your voltmeter and let us know what the resistance is compared to what the datasheet on your motor states. That will give you a clue as to whether your motor is ok or not, if you get no reading, then your motor is gone.

$\endgroup$
0
$\begingroup$

The same thing happens to me. When i connect my motor it works for the first time and after that it stop working.

Finally i figured out my breadboard was faulty. It may not be your case but do one thing connect all the wire by hand by pressing your finger tip and see what happens.

$\endgroup$
-1
$\begingroup$

The datasheet of the l298n motor clearly states that you need a minimum of 4.5V of Vss,that is logic supply.Try giving it a higher voltage. 3.3V wont work.

$\endgroup$

Your Answer

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

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