Driver for Arduino SEEED Relay Shield.
Digital connections to Raspberry pi:
* Connect 5v pin to 5v pin from Raspberry pi.
* Connect ground to ground.
* Connect 2 GPIO pins to digital inputs.
* Options: SEEED pins 4 thru 7 operate relays 1 thru 4.
Power connections to motor:
Wire the motor between the common pins on 2 of the relay outputs
Wire the motor power (+) to the normally open pins (NO) of the 2 relays
Wire the motor ground (-) to the normally closed pins (NC) of the 2 relays
Circuit Diagram:
(+PWR)--NC1------NO1----(GND)
|
(Motor)
|
(+PWR)--NC2------NO2----(GND)
Usage:
motor1 = RelayMotor(3, 5)
motor1.forward()
print motor1
time.sleep(1)
motor1.off()
print motor1
time.sleep(1)
motor1.reverse()
print motor1
time.sleep(1)
motor1.off()
Features
- Supports an H-bridge connected relay shield.
- Allows two motors to be driven forward and backward.
- Ideal for differential drive robots.