The connections from P2.6 and P2.7 to IN3 and IN4 are made only when you want to operate another motor through the output OUT3 and OUT4 of L293D. Connect P2.0 and P2.1 of 8051 to IN1 and IN2 of the L293D motor driver. Step 5: Now, to make the RESET circuit, connect Pin 9 (RST) to +5V through a capacitor of 10♟ and connect the same pin to +0V (GND) through a 10kΩ resistor or a potentiometer.Step 4: Set Pin 31, i.e., EA pin to HIGH by connecting it to the +5V DC source.Step 3: Connect two capacitors of 22pF, with one terminal on either side of the oscillator and the other terminal to ground, as shown below.Step 2: Connect a 12 MHz oscillator between pin 18 and 19.
Now, let’s look at the circuit diagram and thereon learn how to write the embedded C code to implement it. In this way, we can interface the DC motor with 8051.
If you’re not familiar with the interfacing of a push-button with 8051 microcontrollers, feel free to check out this brief tutorial: Switch interfacing with 8051. Here we’re going to use push-buttons to control the direction of the DC Motor. This motor driver is designed to drive inductive loads such as relays, solenoids, DC motors, and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications.
When the enable input is LOW, the drivers are disabled, and their outputs are OFF and are in the high-impedance state. The enable pin enables the drivers in pairs, i.e., when EN1 is set HIGH, IN1 and IN2 are active and take the inputs from the microcontroller and give the outputs to the motor connected to OUT1 and OUT2. Every output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Hence, it is not wise to connect a DC motor directly to the microcontroller. Moreover, the voltage spikes produced while reversing the direction of rotation can easily damage the microcontroller. Most DC motors have power requirements well out of the reach of a microcontroller. However, reversing the connections of these terminals will change the direction of rotation of the motor. How does a DC Motor work?Ī DC motor consists of two terminals, and some of the modules available in the market do not indicate the polarity. This stator and rotor move relative to each other for Electro-Mechanical Energy Conversion.Such a magnetic system with alternate N and S poles is called a heteropolar system. N and S poles are produced on both stator and rotor. This flux crosses the air gap from one core to the other. When windings are excited, a common flux is set up.Cores are laminated and made up of ferromagnetic materials to give optimum electric and magnetic characteristics. Both stator and rotor carry concentric cylindrical cores.
The rotor is mounted on the shaft and bearings where the bearings are fixed to the stator frame.The clearance between the stator and rotor is called the air gap.An outer stationary member called the stator.The DC motor consists of the following components. DC motors can vary in size and power from small motors in toys and appliances to large mechanisms that power vehicles, pull elevators and hoists, and drive steel rolling mills, etc. 8051 microcontroller – AT89C51/AT89S51/52 or similar variants.Ī DC motor is a rotatory instrument that works on DC power to convert electrical energy into mechanical energy.Using PWM technique to control the speed of the DC Motor.Using push-button switches to control the direction of rotation.