Orange Pi DC motor Driver at Leenabot
In this article, I am explaining how to drive 5V DC Motor using
Orange Pi and Dual Chanel Motor driver L9110.
This is the GPIO PIN
diagram for Orange Pi. Orange Pi has 40 GPIO PINs which can be used for
Embedded programming.
I am using GPIO PIN PA7 and PA8(PIN 29 & 31) for this demo
to send control signal to Motor driver L9110.
L9110 can be used to
drive two motors, DC or stepper Motors. In this demo I am using 5V DC motor.
The green socket in this picture is connected to DC motor two-wire
each. L9110 has four input PINs, as shown in picture Motor A and Motor B input
signal can be given to control two Motors. In this Demo, pins are connected as
below
1. Motor A 1A is
connected to GPIO PIN PA7 from Orange PI
2. Motor A 1B is
connected to GPIO PIN PA8 from Orange PI
3. Ground from the external power supply
4. VCC 5V from the external power supply
5. Motor B 2A is
not used in this demo
6. Motor B 2B is not
used in this demo
The connection is as shown
in the below picture, I am using power bank with two 5V power supply one for Orange
PI and other for driving Motor. power supply from Orange PI GPIO PIN is not
recommended.
Once the connection is done as explained above, write this simple
python code in vi Editor( vi Motor.py). In this code first i setup PA7 &
PA8 using setcfg and then I send high & low to move Motor in an anticlockwise
direction.
sleep for 5min and send
LOW & HIGH signal for clockwise direction. Run the code with below command.
Motor will rotate for 5sec, stop, clockwise rotation for 5sec and stop.
Check Demo video in
youtube and subscribe my channel for more robotic video. Please check other
Blog post in this website.
If you like it please
comment below, share and like in FaceBook. Thank you for reading.
and
Comments
Post a Comment