From SB-Components Wiki
Motor Shield for Raspberry Pi is created to assist you in building your Raspberry Pi-based Robot. This board has the ability to control both the DC and stepper motors. You may use your IR and Ultrasonic sensors to provide information to your robot about its surroundings. Line Following, Object Following, Wall Following, and Maze-Solver Robots are all simple to create.
- Motor Shield is powered by Dual H-Bridge IC L293D: For controlling up to 4 DC motors or 2 stepper motors.
- Motor Input Supply Range: 6V – 24V
- Single Motor Output Current: 600mA or 1A peak current per channel.
- Programmable onboard LED arrow indicator for motor direction.
- 2 IR sensor Connectors with 3.3V level output protection.
- 1 Ultrasonic Sensor Connector with 3.3V level output protection.
- Male Header and screw terminal for Motor Supply.
- On-board GPIO stacking header
- Motor control : upto 4 DC or 2 Stepper Motor
- Indicator : LED arrow Indicator.
- Sensor Connector : 2 IR sensor, 1 Ultrasonic sensor connector.
- Python Library : Yes.
- GUI : Python-based GUI.
|MotorShield||RPi BOARD Numbering|
|IR1 and IR2||7, 12|
- Stack Motor Shield on Raspberry Pi 40 Pin GPIO header as shown below.
- Open Terminal and download the code by writing:
git clone https://github.com/sbcshop/MotorShield.git
- Your code will be downloaded to '/home/pi' directory. Use 'ls' command to check the list of directories.
- Go to directory 'MotorShield' and open 'Test_Motor.py'.
- Run (Press F5) file 'Test_Motor.py'. This is the example code to run all the motors in 'Forward' and 'Backward' direction.
- For interfacing Stepper Motor use example code 'Stepper_Test.py'.
GUI of Motor Shield for Raspberry Pi
- GUI for Controlling Motors using Motor Shield
- Control 4 DC motors with Direction controlling
- User can also control Speed of each Motor
- You can run GUI by running below command in terminal or by running "GUI_Motor_Shield.py" file on any python supported ide.
- Set the direction (i.e. Forward or Backward) and speed of Motor. Adjust the Speed in percentage i.e. 10 – 100%.
- Click the START button to start the Motor.
- You can ON/OFF the direction LED also as per the direction of Motor or Robot.
- You can set all 4 motors at different speed and direction.