So what I am trying to do is to get the motor to spin but I want to raspberry pi between the motor so I can spin it clockwise for 5 seconds and then spin it anti-clockwise for 5 seconds. But initially, I just want to make sure it works.
Here is my circuit: enter image description here
And here is the code I am running, should this code should output some voltage if I have a volt meter on the aout pins?
import RPi.GPIO as GPIO # Declare the GPIO settings GPIO.setmode(GPIO.BOARD) # set up GPIO pins GPIO.setup(19, GPIO.OUT) # Connected to AIN2 GPIO.setup(26, GPIO.OUT) # Connected to AIN1 # Drive the motor clockwise GPIO.output(26, GPIO.HIGH) # Set AIN1 GPIO.output(19, GPIO.LOW) # Set AIN2 # Wait 5 seconds time.sleep(5) GPIO.output(12, GPIO.LOW) # Set AIN1 GPIO.output(11, GPIO.LOW) # Set AIN2
So I have simplified my circuit to just test out an LED. Here is what it looks like now:
I have soldered the pins into the holes. What I am wondering now is should I have left the one that were N.C. unsoldered?
Also you can see the wiring setup I have the results I get on the multimeter.
(1) My understanding was that the pins 2 and 4 would output 5v AC?
(2) Seems from the multimeter it is 10v AC but I mean I could be reading the multimeter wrong?
(3) I was using a wire that isn't connected to anything as an earth also, I don't know if this makes sense or not?
- Here you can see what I mean in the above questions.
- Here I am touching the earth wire and the slp pin
- Here I am testing the ain1 pin to see if it has 5v