Similarly, when we switch on low side left and high side right, the current flows in opposite direction and motor rotates in backward direction. This is the basic working of H-Bridge. We can also make a small truth table according to the switching of H-Bridge explained above.
||Motor runs clockwise
||Motor runs anti-clockwise
||Motor stops or decelerates
||Motor stops or decelerates
So we have seen that using simple switching elements we can make our own H-Bridge. Other option is to use IC based H-bridge driver. Obviously, we will use Driver IC otherwise heat sinks will be used for MOSFETs etc.
L293D for dc motor interfacing with 8051 microcontroller
It is designed to provide bidirectional drive currents of up to 600mA at voltages from 4.5V to 36V. It can drive inductive loads such as solenoids, relays, DC and bipolar stepping motors. It contains internally protection diodes across the motor.
L293D contains four Half H Bridge drivers. We can drive two DC Motors by single driver.
- VSS pin is used to provide input voltage to L293D. For 8051 interface, 5v is given to it.
- The motor supply is given to VS pin of the L293D. It depends upon motor requirement.
- EN1 is used to enable input pair 1 (IN1, IN2, for OUT1, OUT2) and EN2 is used to enable input pair 2 (IN3, IN4, for OUT3, OUT4). EN is connected to 5V for to enable any input.
- Direction of motor 1 is controlled through input pins logic. IN1 and IN2 control motor connected output OUT1 and OUT2.
- Direction of motor 2 is controlled through input pins logic. IN3 and IN4 control motor connected output OUT3 and OUT4.
- All GND pins should be connected to ground.
- P2 of 8051 microcontroller is used as output port and it gives inputs to the motor driver IC. Its lower four pins are connected to drive two DC motors.
- P0 is used as input port. 2 Buttons are connected to its lower two pins so that whenever we can manually start and stop the motors.
- Motor 1 is connected between OUT1 and OUT2 of L293D. Motor 2 is connected between OUT3 and OUT4 of L293D.
- 12V battery is used to give input to the VS for motors.
- 5V battery is used to give input to VSS for motor driver IC.
- AT89C51 microcontroller
- 12 MHz Oscillator.
- 12V DC battery.
- 5V DC battery.
- L293D motor driver
- DC motor – 2.
- 2 Ceramic capacitors – 33pF
- 300Ω resistors – 2
- Push buttons – 2
- Connecting wires.
WORKING of dc motor interfacing with 8051 microcontorller
After loading the program in the controller, the motors will not start turning until the buttons are not pressed. According to my coding:
When I press button 1, motor 1 starts rotate in clockwise direction.
When I leave button 1, motor 1 will stop.
When I press button 2, motor 2 will start rotating in Anti-clockwise direction.
When I leave button 2, motor 2 will stop.
Enabling pin 1, if we give logic as:
|Pin2 = 1, pin7 = 0, motor 1 will start turning clockwise.Pin2 = 0, pin7 = 1, motor 1 will start turning anticlockwise
Pin2 = 1, pin7 = 1, motor 1 will stop
Pin2 = 0, pin7 = 0, motor 1 will stop
Enabling pin 9, if we give logic as:
|Pin10 = 1, pin15 = 0, motor 2 will start turning clockwisePin10 = 0, pin15 = 1, motor 2 will start turning anticlockwise
Pin10 = 1, pin15 = 1, motor 2 will stop
Pin10 = 0, pin15 = 0, motor 2 will stop
Read More Information…
DC MOTOR INTERFACING WITH 8051 MICROCONTROLLER