4-Kanal L293D - ENG
4-Kanal L293D - ENG
Thank you very much for purchasing our AZ-Delivery 4-channel L293D
motor shield for ATmega328p, Mega2560 R3 and Nano V3.0. On the
following pages, we will introduce you to how to use and setup this handy
device.
Have fun!
The 4-channel L293D motor driver shield is simply plugged onto an
microcontroller board and allows up to 4 DC motors, 2 stepper motors or 2
servo motors to be controlled. The powerful and reliable L293D chip that
distributes the load serves as an H-bridge. This allows you to easily use DC
motors and power supplies up to 36V.
Programming interfaces
» Arduino-IDE: https://www.arduino.cc/en/Main/Software »
Web-Editor: https://create.arduino.cc/editor
» Extension for SublimeText: https://github.com/Robot-Will/Stino
» Extension "VisualMicro" for Atmel Studio or Microsoft Visual Studio:
http://www.visualmicro.com/page/Arduino-for-Atmel-Studio.aspx
The shield uses the standard PWM pins of the microcontroller board to
control the connected motors and servos. The Shield is compatible with
every microcontroller board (e.g. ATmega328p, Nano V3.0, Mega 2560 R3).
One microcontroller board can use only Motor Shield at a time.
Used pins of the microcontroller
PINs 4, 7, 8 and 12 are used to control the DC / stepper motors via the
74HC595.
The six analog inputs (PINs 14 to 19) and the digital inputs (PIN 2 and 13)
are not used.
Selection of motors; hardware
Motor voltage
Most motors require voltages from 6V to 12V. These can
be operated with the microcontroller shield.
Motors with voltages from 1.5V to 3V cannot b operated.
Hardware motor voltage
Most motors require voltages from 6V to 12V. These can be operated with
the motor shield. Motors with voltages from 1.5V to 3V can not be used.
Current range
The shield is designed for 0.6 A per motor. Тhe peak value may behe peak
value may be up to 1.2 A for a short time. If a large amount of current is
required, the ICs used become so hot and must be cooled.
NiMH batteries are the best power supply. An operation on e.g. 9V battery
blocks is not recommended. It is best to disconnect the power supply of the
motors from the power supply of the microcontroller board(2 power
supplies).
If jumper is not removed, power for motors and driver, will be used from
board (microcontroller board and motor shield have the same power
supply).
DC motors must be supplied with their own power supply, as some of them
draw high currents. They must not be connected to the 5V pins of the
microcontroller board. This could destroy the microcontroller board or the
USB port.
There are two possibilities for connection:
1. The DC plug (power supply) on the board.
There is a protective diode on the plug. This protects the microcontroller
board against incorrect voltage.
2. The 2-pole screw terminal PWR on the Motor Shield.
There is also a protective circuit on the screw terminal which prevents
damage to the motor shield.
IMPORTANT: The jumper Power selection jumper must be plugged into the
motor shield! This can lead to interference, as the voltage can fluctuate,
depending on the current consumption of the motors. This operating mode
is only recommended if a strong battery pack is used.
The microcontroller board is supplied either via the USB cable or via the
power connector. An additional power supply is connected to the screw
terminals of the Motor Shield.
IMPORTANT: The jumper Power selection jumper on the Motor Shield must
not be plugged in! This is the recommended method when motors or larger
loads are used. Logic voltage and load voltage are decoupled.
The connectors of the microcontroller Shields are designed for small model
servos. They are powered directly by the 5V of the microcontroller board. If
larger servos are used (more power), then the tracks have to be
disconnected from the servo connections to the pin header and cables have
to be soldered to the external 5V supply for servo motors.
PIN Assignment
Pin 9 PWM Servo 1
Pin 10 PWM Servo 2
4 bidirectional DC motors can be connected: M1, M2, M3, M4. The speed
can be changed in steps of 0.5%. The motors can run in both directions
depending on the control.
The Motor Shield does not have a heat sink. It is not designed for a
constant motor current of 0,6 A. For larger motors or long running times it is
recommended to glue a heat sink onto the driver IC.
The direction of rotation can be changed by exchanging the wires. (e.g. all
motors should run in the same direction.)
Connection of stepper motors
New window will open and in the search box type "adafruit motor"
#include <AFMotor.h>
#include <Servo.h>
Servo servo1; // DC hobby servo
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps Serial.println("Servo Test!");
servo1.attach(9); // servo switch on
}
int i;
void loop() {
for(i = 0; i < 255; i++) {
servo1.write(i);
delay(3);
}
for(i = 255; i != 0; i--) {
servo1.write(i-255);
delay(3);
}
}
Functions for the control of a DC motor
#include <AFMotor.h>
MOTOR12_8KHZ,
MOTOR12_2KHZ or
MOTOR12_1KHZ.
Hints: High speeds e.g. 64KHz are not used. The choice of a low speed
e.g. 1KHz leads to a lower energy consumption.
» speed - is integer number which limits are from 0 (motor stop) to 255
(maximum speed).
To move the motor we use:
motor.run(direction)
The directions "forwards" and "backwards" are not fixed. They depend on
the wiring of the individual motors. They can be changed by simply
exchanging the connections.
An object with the name "motor" is created. All commands refer to <motor>.
The sketch is taken from the examples of the "Adafruit Motor shield library".
#include <AFMotor.h>
By default, the motor keeps its position active after the step is completed.
(high power consumption). If you want the motor to move freely (low power
consumption), you must order it separately.
motor.release()
Program flow
The step commands BLOCK the program flow, they are not executed in the
background. Program flow waits until the motor movement is completed.
(There is no multitasking!)
An object with the name "motor" is created. All commands refer to <motor>.
The sketch is taken from the examples of the "Adafruit Motor shield library".
You've done it, you can now use your module for your
projects.
Now it is time to learn and make the Projects on your own. You can do that
with the help of many example scripts and other tutorials, which you can
find on the internet.
https://az-delivery.de
Have Fun!
Impressum
https://az-delivery.de/pages/about-us