I have a system which includes a Raspberry Pi, 2 a L298N module, 12V Battery source(8x1.5V AA) and a motor (a "PMDC Spur Gear Motor/KGA25RP")
When I connect everything right and run a simple program, only thing I see is a very low buzzing sound from motor while program running. Is my battery too low to move motor?
The code :
import RPi.GPIO as GPIO
from time import sleep
GPIO.setmode(GPIO.BOARD)
Motor1A = 38
Motor1B = 40
Motor1E = 7
GPIO.setup(Motor1A,GPIO.OUT)
GPIO.setup(Motor1B,GPIO.OUT)
GPIO.setup(Motor1E,GPIO.OUT)
print "Going forwards"
GPIO.output(Motor1A,GPIO.HIGH)
GPIO.output(Motor1B,GPIO.LOW)
GPIO.output(Motor1E,GPIO.HIGH)
sleep(2)
print "Going backwards"
GPIO.output(Motor1A,GPIO.LOW)
GPIO.output(Motor1B,GPIO.HIGH)
GPIO.output(Motor1E,GPIO.HIGH)
sleep(2)
print "Now stop"
GPIO.output(Motor1E,GPIO.LOW)
GPIO.cleanup()
Photos : imgur.com/ujjtbIH,Db3ingN,gXR3vjL
I used Raspberry pi's 7(motor 2 enable),38(IN4),40(IN3)pins.
keytosmart.com/wp-content/uploads/2014/07/B_Diagram_large.png (Can't link more than 2 links.)