If we want to control a DC motor using Arduino, we have to go for some kinds of drivers such as ULN2803 or L293DNE. I had already published one blog on controlling a DC motor using L293D and Arduino. Controlling a DC motor using ULN2803 is pretty simple. But the problem is, we cannot change the direction of rotation of motor by this circuit. This project is an extension to two-phase Unipolar Stepper motor interfacing with AT89C51. In the previous project, transistor switches were used to interface the stepper motor with the microcontroller. Here the transistors have been replaced by using a ULN2003 IC to drive the stepper with 8051 microcontroller. Stepper motor is a variable reluctance DC motor.
Relay driver circuit using ULN2003 ULN2003 is a very famous relay driver integrated circuit. Relay driver IC uln2003 is high voltage and high current integrated IC which used Darlington array. Its contains seven Darlington pair of a transistor which have high voltage and high current carrying capability. Aug 10, 2020 ULN2003 Stepper Motor Driver. The 28BYJ-48 Stepper Motor can draw up to 240 mA, considerably more than what an Arduino can deliver through any of its ports. So, you will need some sort of a driver to safely control the stepper motor. There are numerous ways to create a driver starting with a simple transistor for each of the coils.
Comments
- When you need to be able to reverse the DC motor then the complexity of a H-bridge is needed. When all you need to do is control the motor or even PWM it then there's this wonderful 3-pin IC called a 'MOSFET'. Yeah, and what's more, they are usually rated to handle many 10's of amps so that motor stall should never be a problem. You can even drive them from 3.3V with only a single I/O.
Ok, sounds over the top maybe? But it's true and it is exactly what I would use. Why use a space pen when a pencil will do?
Thank you all
Here is the article.
https://electrosome.com/dc-motor-l293d-pic-microcontroller/
You just replace that micro with a Stamp (BS1 to BS2p40) or Propeller.
The article is the level of this forum.
So. That is how to connect Parallax micro to DC motor.
There may still be a Parallax article or Nuts and Volts or Application Note out there somewhere like it.
Happy holiday! 14 days til Christmas!- So you are not really interested in finding out how to do it then?
How hard is it to connect the 2 wires of a DC motor?
I've not seen you follow through on any of your 'problems'.
Maybe you just like creating a stir?
I could be wrong but moderators please take note.
Happy holiday! - edited 2018-12-10 - 04:34:41'When you need to be able to reverse the DC motor then the complexity of a H-bridge is needed'
Thank you for that.
Will connect up some of this stuff.
Using a 4.5 volt 3 AA battery box to power motor.
It's a motor on a Tamiya wheel ratio kit. Turns some different diameter wheels with rubber bands for belts.
No 'belts' on it.
Happy holidays! - For those of you wandering through this thread looking for suggestions and examples of DC motor control using a Basic Stamp or Propeller, do have a look at the Nuts and Volts columns, particularly Vol 1, #23. This is a long-running series of columns in Nuts and Volts magazine most by JonnyMac on a variety of topics, complete with easy to understand discussions and explanations and practical examples.
- microcontrolleruser,
I thought you wanted to know how to connect 2 motors to an L293D and I have seen much better tutorials than the one you linked to.
https://itp.nyu.edu/physcomp/labs/motors-and-transistors/dc-motor-control-using-an-h-bridge/
Mike,
That's a good article and it even has something for Erco (controlling 2 motors with relays through a ULN2003).
Thank you Mike
There we go a Nuts and Volts article on it. Suspected there was one out there.
Probably an application note too.
Thank you Genetix
'I thought you wanted to know how to connect 2 motors to an L293D'
Not me. That would be like saying I wanted to hook up four because I looked at ULN2003 first.
Nope. Just one motor.
I do not think there is an IC for just one motor.
The L293D just throws in a circuit for extra motor. That was a common sense thing to do.
Happy holidays!
Here is the L293D in a nutshell.Control Signals and Motor Status
RB0/IN1 RB2/IN2 Motor Status
LOW LOW Stops
LOW HIGH Anti-Clockwise
HIGH LOW Clockwise
HIGH HIGH Stops
DC Motor Driver Circuit
Motor Drives
Motor drives are circuits used to run a motor. In other words, they are commonly used for motor interfacing. These drive circuits can be easily interfaced with the motor and their selection depends upon the type of motor being used and their ratings (current, voltage).
Major components in Motor Drives
- For DC Motors.
The major motor drive components for DC motors are: a controller, a motor driver IC or a motor driver circuit, the desired DC motor being used, power supply unit and the necessary connections to the motor.
- Controller: The controller can be a microprocessor or a microcontroller.
- Motor Driver IC or Motor Driver Circuits: They are basically current amplifierswhich accept the low current signal from the controller and convert it into a high current signal which helps to drive the motor.
- Motor: Motor is defined as an electric or mechanic device that can create a motion. While interfacing with the controller; some of the motors like DC motor, stepper motor and brushless dc motor may require a driver IC or driver circuit. DC motor is a type of motor that can convert DC into a mechanical power. In a brushless DC motor, it consists of a DC power source, an inverter producing an AC signal to drive the motor. While stepper motor is a brushless DC electric motor that converts electrical pulses into discrete mechanical motions.
- Power Supply Unit: Provides the required power to the motor drive.
- For servo motor
Servo motor is a type of actuator device that consists of a motor and a sensor to control velocity, acceleration etc. The major motor drive components for a servo motor are a controller, power supply unit, servo motor and the necessary connections with the motor.
Commonly, motor drive for a servo motor is also known as Servo motor controller or Servo Motor Driver. Usually, 8051 controllers are used for controlling a servo motor driver with a single servo motor. If there are multiple servo motors; then PIC, ATMEGA etc. can be used.
DC Motor Driver Circuits
Motor Driver circuits are current amplifiers. They act as a bridge between the controller and the motor in a motor drive. Motor drivers are made from discrete components which are integrated inside an IC. The input to the motor driver IC or motor driver circuit is a low current signal. The function of the circuit is to convert the low current signal to a high current signal. This high current signal is then given to the motor. The motor can be a brushless DC motor, brushed DC motor, stepper motor, other DC motors etc.
Features
- High level functionality.
- Better performance.
- Provides high voltage.
- Provides high current drive.
- Includes protection schemes to prevent the failure of motors due to any faults.
Need for Motor Driver Circuits/ICs
In motor interfacing with controllers, primary requirement for the operation of the controller is low voltage and small amount of current. But the motors require a high voltage and current for its operation. In other words we can say the output of the controller or processor is not enough to drive a motor. In such a case direct interfacing of controllers to the motor is not possible. So we use a Motor Driver Circuit or Motor Driver IC.
Not only in the case of controllers, while connecting motors with 555 timer ICs or 74 series ICs; they also cannot provide the large current required by the motor. If direct connection is given, there might be a chance of damage to the IC.
Types of DC Motor Driver Circuits
1. Transistor Based DC Motor Driver Circuit
Transistor based DC motor driver circuit is one of the simple DC motor driver circuit. It uses a power transistor (D880), DC motor and a resistor for its operation. Let IN be the input to the base of the transistor. To the collector of the transistor, the DC motor is connected. Emitter of the transistor is placed to ground. Normal Vcc given to the circuit is 12volt. Here the main point to note is that, check the DC motor being used. While choosing the transistor and the DC motor; the current rating must be noted. Always the current rating of the DC motor must be smaller than that of the transistor being used. Application of this motor driver circuit is for single direction control of the motor; e.g. Line following Robot.
Input (IN) | Motor Action |
0 volt | Motor Stops |
5V | Motor is in Action |
2. H Bridge Circuit
H bridge circuit is one of the other commonly used motor driver circuit. In robotic applications, were the DC motor has to run in backward and forward direction; H bridge circuits play a major role. The name H Bridge is used because of the diagrammatic representation of the circuit.
Usually the H bridge circuit contains 4 switches S1, S2, S3 and S4. These switches can be relays, or P channel and N channel BJTs, MOSFETs, or they can be N channel MOSFETs only. Here a basic H bridge circuit is shown in the figure below were NPN transistors are placed at the high voltage and PNP transistors to the low voltage.
Transistor Based H-Bridge Circuit
- Components
The components used in the circuit are NPN and PNP power transistors, resistors, diodes, a DC motor, and a power supply of about 12V.
- Input
Input 1 and Input 2 are the inputs to the H bridge circuit.
- Operation
IN1 | IN2 | A | B | Motor Action |
0 | 0 | 0 | 0 | Stop |
0 | 1 | 0 | Vcc | Anticlockwise |
1 (5V) | 0 | Vcc | 0 | Clockwise |
1 | 1 | Vcc | Vcc | Brake |
3. Using L293D
Uln2003 Driver Board Schematic
L293D is a dual H bridge motor driver IC. This 16 pin motor driver IC can drive the motors in anti-clockwise and clockwise direction. The connection of the DC motors to L293D IC is given below.
Pin Description of L293D
- 1 and 9 are Enable Pins.
- 2, 7, 10, 15 are Input pins.
- 3,6,11,14 are output pins
- 4, 5, 12, 13 are the Ground pins.
- 8 and 16 pins are for Vcc.
Operation of L293D controlling two DC motors
- Enable pins should be connected to +5v for the motor driver to start its operation. If these pins are connected to GND then the motors will stop its operation. Enable 1, 2 drives the H bridge circuit on the left side while the Enable 3, 4 drives the H Bridge on the right side.
- Consider the motor placed at the left (to pin 3 and 6). The operation is described in the table below. Its enable pin is Pin1. Input pins are pin2 and pin7.
Pin1 | Pin2 | Pin7 | Action of Motor |
+5 volt | 0 volt | 0 volt | Stop |
+5 volt | 0 volt | +5 volt | Clockwise |
+5 volt | +5 volt | 0 volt | Anti-clockwise |
+5 volt | +5 volt | +5 volt | Stop |
0 volt | - | - | - |
- The same operation takes place while controlling the motor placed at the right side (pin11 and 14). Here the enable pin will be pin9; input pins are pin 10 and 15.
Uln2003 Stepper Driver
4. Using ULN2003
Dc Motor Driver Circuit Using Uln2003 System
ULN2003 can be used as a motor driver IC. It contains high current and voltage Darlington arrays. This driver IC can be used for driving stepper motors. This is because stepper motor needs more current for its operation in the motor drives. The circuit below shows the ULN2003 with a stepper motor. The input to ULN2003 are K= {0011, 0110, 1100, 1001}; and L= {1001, 1100, 0110, 0011}. These input sequences will energize the two adjacent phases of the stepper motor.