Difference between revisions of "Motorshield"
From SB-Components Wiki
Line 64: | Line 64: | ||
* Go to directory 'MotorShield' and open 'Test_Motor.py'. | * 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. | * 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'. | + | * For interfacing Stepper Motor use example code 'Stepper_Test.py'. |
+ | |||
+ | ==== GUI of Motor Shield for Raspberry Pi ==== | ||
+ | ''' GUI Features: ''' | ||
+ | * GUI for Controlling Motors using Motor Shield | ||
+ | * Control 4 DC motors with Direction controlling | ||
+ | * User can also control Speed of each Motor | ||
== Resources == | == Resources == |
Revision as of 08:56, 4 September 2021
Raspberry Pi Motor Driver HAT
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.
Features
- 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
Specifications
- 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.
Pinout
MotorShield | RPi BOARD Numbering |
---|---|
VCC | 5V |
GND | GND |
M1 EN | 11 |
M1 IN1 | 13 |
M1 IN2 | 15 |
M2 EN | 22 |
M2 IN1 | 18 |
M2 IN2 | 16 |
M3 EN | 19 |
M3 IN1 | 21 |
M3 IN2 | 23 |
M4 EN | 32 |
M4 IN1 | 24 |
M4 IN2 | 26 |
Forward Arrow | 37 |
Backward Arrow | 33 |
Left Arrow | 36 |
Right Arrow | 35 |
Ultrasonic TRIG | 29 |
Ultrasonic ECHO | 31 |
IR1 and IR2 | 7, 12 |
Installation
- 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 Features:
- GUI for Controlling Motors using Motor Shield
- Control 4 DC motors with Direction controlling
- User can also control Speed of each Motor
Resources
Github
Datasheet