The shipping fee depends on your address
Standard: 9-15 business days,fee is down to $3.99
Express: 4-7 business days,fee is down to $5.99
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
If you're looking for a custom product, we can help. Kindly contact us via email support@keszoox.com and send us the details for your need, then we'll let you know how we can deliver the right solution.We make into production usually Within 1 - 3 Bussiness Days.
Expect customization orders.General purpose driver handles 4.5 – 36V @ 600mA
The L293D Dual H-Bridge Motor Driver is a general purpose high voltage / high current driver that can handle 4.5 – 36V @ 600mA continuous per channel
The L293D is a general purpose high voltage / high current driver that can handle up to 600mA per channel (1.2A peak non-repetitive) and can operate over the range of 4.5 – 36V. The chip includes built-in kick-back diodes to prevent damage when the motor is de-energized.
These devices are most often used to drive motors, but they can also be used to drive any inductive load such as relay solenoids or used to drive large switching power transistors.
The chip contains four half H-Bridges that can be operated that way or can also be operated as two full H-Bridges. They are capable of driving up to 4 solenoids, 4 uni-directional DC motors, 2 bi-directional DC motors or 1 stepper motor.
A half H-Bridge configuration allows a motor to be operated in one direction. the Enable pins allow the motor to be turned ON/OFF or speed regulated by applying a PWM signal to these pins. The Enable pins are shared between channels 1&2 and 3&4 which limits the usefulness of this mode.
A full H-Bridge configuration allows a DC motor to be run in both directions by reversing the current flow through the motor. The Enable pins allow the motors to be turned ON/OFF or speed regulated by applying a PWM signal to these pins. This is the most common mode of operation.
If higher output current is required, the outputs can be run in parallel to get drive currents of up to 1.2A. When paralleling outputs, channel 1 & 4 should be paralleled and channel 2 & 3 should be paralleled. It is also possible to piggy-back a second chip on top of the first and solder the pins together to maintain full two H-Bridge functionality while also doubling the current handling to 1.2A.
This table covers 1 of the 4 half H-Bridges in the device. 1A channel is shown but all 4 channels (1A/2A/3A/4A) behave the same. Note that the EN pins are shared between Channels 1&2 and 3&4.
Also, note that is in this half bridge configuration, one side of the motor will be connected directly to power or ground, so the direction control pins (1A in this case) will have the opposite effect depending on how the motor is wired.
EN | 1A | Function (Motor connected to VCC2) | Function (Motor connected to Ground) |
H | L | Motor Run | Fast Motor Stop |
H | H | Fast Motor Stop | Motor Run |
L | X | Free-running Motor Stop | Free-running Motor Stop |
This truth table covers the left half of the chip which forms one full H-Bridge. The right side is a duplicate with 1A and 2A replaced with 3A and 4A.
EN | 1A | 2A | Function |
H | L | H | Motor Turn Right |
H | H | L | Motor Turn Left |
H | L | L | Fast Motor Stop |
H | H | H | Fast Motor Stop |
L | X | X | Free-Running Motor Stop |
Take note that there are two power pins which are marked various ways depending on what datasheet you are looking at. The important thing to remember is that pin 16 is the logic power and needs to be connected to 5V which can come from the uC or separate power supply. Pin 8 is the motor power and can vary between 4.5 and 36V.
The IC package has 4 ground pins. These are all connected internally and are used to help heat sink the chip when soldered to a PCB ground plane and handle the current under high load conditions. For experimenting under light loads, only one needs to be connected.
These are old school devices, but they are easy to use, inexpensive, robust and get the job done when working with motors that don’t require a lot of current.
To get a feel for how the IC works in the full H-Bridge arrangement that allows for DC motor operation in both directions, do the following exercise:
To take our simple setup to the next level, the program below automates the control of the basic setup above using an Arduino or similar uC and gives you control of the motor through the Arduino IDE Serial Monitor window by entering commands. Your just need to connect the 1A/2A and EN control pins on the IC to pins 9, 8 and 10 on an uC. You can use other digital pins, just make sure that you redefine them in the program. The EN pin does need to be connected to a PWM capable pin.
The valid commands to type into the Serial Monitor Window include:
F = Motor FORWARD
R = Motor REVERSE
S = Motor STOP
P = Short for PWM, it sets or gets the motor speed. P by itself does nothing.
P? = Get the current speed setting from the uC
P1 –P255 = Sets the PWM value which controls the speed of the motor. This needs to all be typed on the same line before hitting ‘Send’ or the RETURN key to transmit the command to the uC.
Note that at low value speed settings like P5, the motor will not turn because it is not getting enough power, but you may hear it whining a bit. This varies by motor and the voltage that your are driving it at. If 5V is too low for your motor, you can change the voltage on pin 8 to a higher value or just stick with higher PWM values. You may have to use values in the range of P25-50 to get things moving.
The directions of ‘F‘orward and ‘R‘everse are relative to how the motor is wired to the L293D. The wires to the motor can be swapped if it is desired to reverse the direction relative to the commands being given.
The program is somewhat simplistic to keep it reasonably short. If the PWM value is zero, it assumes this is because the number given could not be converted to an integer and ignores it. This means you can’t send the command ‘P0‘ to stop the motor because it will be ignored. Use the ‘S‘ command instead.
Usually the Serial Monitor window is used only for displaying returned characters from the Arduino. Since we are using it also for input, it is worth noting a few things.
When using the Serial Monitor window for input, the commands need to be typed into the small top window, not the main window. A carriage return or hitting the ‘Send‘ button sends the command typed into this window to the Arduino.
The program echos the command (like ‘R‘) back to the main window. This is confirmation that the command was received by the Arduino. It then sends a string of what it is doing with that command (like ‘Motor Reverse‘) as confirmation that it not only received the command but also understood and executed the command.
Make sure the baud rate is set to the rate you have set in the program. Program sets it to a default of 9600.
On my setup I find that if the default ‘Both NL & CR‘ setting is used at the bottom of the Serial Monitor window, the window tends to hang intermittently. Commands are still be sent and acted on by the Arduino, but the output from the Arduino stops being shown. Closing and reopening the windows temporarily clears the problem. Using ‘Carriage return‘ seems to work fine. I am not sure why that is.
/* Exercise L293 Motor Driver IC Uses Serial Monitor window to issue commands for controlling a DC motor connected to channels 1 & 2 on an L293D chip. */ const int EN_PIN = 10; // Must be PWM pin. Connect to Pin 1 on L293 const int A1_PIN = 9; // Can by any digital pin. Connect to pin 2 on L293 const int A2_PIN = 8; // Can by any digital pin. Connect to pin 7 on L293 char readString[4]; // String array to hold PWM value typed in on keyboard int PWM_Value = 0; // Our current PWM motor speed value //=============================================================================== // Initialization //=============================================================================== void setup() { pinMode(EN_PIN, OUTPUT); // Initialize output pins pinMode(A1_PIN, OUTPUT); pinMode(A2_PIN, OUTPUT); Serial.begin(9600); // Initialize serial monitor } //=============================================================================== // Main //=============================================================================== void loop() { // Basically just loop while monitoring the serial port and then jump to DoSerial to // handle incoming characters and act on them if (Serial.available()) DoSerial(); } //=============================================================================== // Subroutine to handle characters typed via Serial Monitor Window //=============================================================================== void DoSerial() { int index = 0; int PWM_Test_Value = 0; char ch = Serial.read(); // Read the character we know we have Serial.println(ch); // Echo character typed to show we got it // Use Switch/Case statement to handle the different commands switch (ch) { case 'f': // Motor FORWARD command case 'F': // This fall-through case statement accepts upper and lower case digitalWrite (A1_PIN, LOW); digitalWrite (A2_PIN, HIGH); Serial.println("Motor Forward"); break; case 'r': // Motor REVERSE command case 'R': digitalWrite (A1_PIN, HIGH); digitalWrite (A2_PIN, LOW); Serial.println("Motor Reverse"); break; case 's': // Motor STOP command case 'S': //digitalWrite(EN_PIN, LOW); digitalWrite (A1_PIN, LOW); digitalWrite (A2_PIN, LOW); Serial.println("Motor Stop"); break; case 'p': // Motor SPEED command case 'P': // This command is a little trickier. We are looking for a number from 0-255 // to follow this command so we can set the PWM speed. If we see a '?' // we will report our current speed setting, otherwise we start collecting chars // into the readString array. delay(2); // Give time for more characters to arrive. for (int i; i<4; i++) readString[i] = ' '; // Clear buffer while (Serial.available()) // Read what we get and put into the string array { char c = Serial.read(); readString[index] = c; index++; delay(2); } readString[3] = ''; // Append null to end of string array to make it a valid string index = 0; // Reset our index back to the start of the string if (readString[index] == '?') // ? means report our current speed setting and exit. { Serial.print("Current PWM Setting: "); Serial.println(PWM_Value); break; } PWM_Test_Value = atoi(readString); // Try to convert string into integer // We assume a 0 value is because of a non-valid input and ignore the command if(PWM_Test_Value!=0) { if (PWM_Test_Value > 255) PWM_Value = 255; // Cap WPM setting at 255 else PWM_Value = PWM_Test_Value; Serial.println(PWM_Value); // Echo what we end up with to confirm we got it analogWrite(EN_PIN, PWM_Value); // Set new speed on PWM pin. } break; default: break; } delay(10); }
Notes:
Operational Ratings | Vcc2 (Motor) | 4.5-36V |
Vcc1 (Internal Logic) | 5V | |
Max Current | 600mA (per channel) | |
Max Current (non-repetitive) | 1.2A (per Channel) | |
Vcc1 Max Current | 60mA | |
Package | DIP-16 | |
Package Type | Plastic, thru-hole | |
Mfr | TI / ST | |
Datasheet | L293D |
WE'RE READY TO BUILD A CUSTOM PRODUCT FOR YOU.
All orders are dispatched from our warehouse. The shipments are fully tracked—from our door to yours. Please allow 3-5 business days for your order to be processed in addition to the shipping times below.
Standard: 9-15 business days. Express: 4-7 business days.
Please note that shipping providers are extremely busy during this time, and some orders might experience a delay on top of usual delivery times. If your order is late, please allow 5-10 days more than indicated in standard shipping times before contacting our customer service. Thank you for your understanding.
All orders are 100% tracked. You’ll receive an email with a tracking number and a link to track your parcel once your order leaves our warehouse. Please allow 24-48 hours for the tracking link to start showing shipping information.
Receive our latest updates about our products & promotions.
Thanks for subscribing!
This email has been registered!