I was trying to run stepper motor from my raspberry pi model 3 B. I used the following tutorial -


I have followed various other tutorial also but not succeed in any. My connection are these -

My stepper motor is Nema 17 bipolar stepper -

My battery is Lipo battery of ratings - 11.1V & 2200mAh

Problem- Nothing in stepper motor is showing response, no movement nothing.

Checked- when i give voltage to either coil of stepper motor it shows a little deflection implies stepper is working correctly.

The most basic thing is not working like when i put 5V in IN1/2/3/4 i get 0.1V in all the outputs.

Also, I have connected +12 to driver and GND of battery to driver no +5 or GND from rpi is this ok ?? Circuit of motor driver

Where am i wrong??


If the battery is charged, those 12V will be ok. And yes, its better if you power the H-bridge from an external source rather than from the Raspberry Pi.

"The most basic thing is not working like when i put 5V in IN1/2/3/4 i get 0.1V in all the outputs."

Now, if you are not getting any changes on h-bridge's OUT pins like you explained above, then I guess the problem is either on the hardware (verify all the connections and if everything looks ok then you may need another h-bridge), or in your code, so please share it to be able to give you more specific guidance.

Make sure your setting the GPIO pins correctly. If you're using Python this is an example:

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)   #Set to BOARD mode or BCM, depending on your preferences
GPIO.setup(10, GPIO.OUT)   #Using pin number 10 as an output
GPIO.output(10, GPIO.HIGH) #Set state pin
GPIO.output(10, GPIO.LOW)  

GPIO.cleanup()             #It's a good practice to detach the pins before you leave the program
| improve this answer | |

If you are using external battery power with the Raspberry Pi, they need to share a common ground, which means you need to plug in a second wire running from the l298 board to the external power source. Check out this: https://www.electronicshub.org/raspberry-pi-stepper-motor-control/ and see how the diagram shows the ground wire plugged into both the Raspberry Pi, and the 12V power supply. Hope this helps if you haven't figured it out yet...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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