Thursday, March 28, 2024

AT89C51 Based DC Motor Controller

This is a circuit for an AT89C51-based DC motor controller that can regulate the speed, direction of rotation, and the running mode of motor. It then displays the corresponding messages on an LCD.

Motion control plays a vital role in industrial automation. Manufacturing plants in industries like chemical, pharmaceutical, plastic and textile, all require motion control. And it may be a flat-belt application, flow control application or mixing of substances. Different types of motors—AC, DC, servo or stepper—are used depending upon the application. Of these, DC motors are widely used because controlling a DC motor is somewhat easier than other kinds of motors.

The motion of a DC motor is controlled using a DC drive. DC drive changes the speed and direction of motion of the motor. Some of the DC drives are just a rectifier with a series resistor that converts standard AC supply into DC and gives it to the motor through a switch and a series resistor to change the speed and direction of rotation of the motor. But many of the DC drives have an inbuilt microcontroller that provides programmable facilities, message display on LCD, precise control and also protection for motors. Using the DC drive you can program the motion of the motor, i.e., how it should rotate.

Here are some of the features of this DC motor controller:

  1. Controlled through microcontroller AT89C51
  2. Message displayed on the LCD module
  3. Start, stop and change of direction of the motor controlled by pushbutton switches and indicated by LED
  4. Changes the running mode of the motor to continuous, reversible or jogging
  5. Changes the speed of the motor
  6. Time settings are possible for forward and reverse running of the motor

(Click to rotate Fig.1)

- Advertisement -

Circuit description

67F_parts-listFig. 1 shows the circuit of the microcontroller-based DC motor controller. At the heart of the DC motor controller is microcontroller AT89C51. Port pins P0.0 through P0.7 of the microcontroller are interfaced with data pins D0 through D7 of the LCD module, respectively. Port pins P3.0, P3.1 and P3.2 control the LCD operation through enable (E), register-select (RS) and read/write (R/W) pins, respectively. Contrast of the LCD is set by preset VR1. Port pins P1.0 through P1.7 are connected to switches S1 through S8 for performing the various operations.

Power-on reset signal for the microcontroller is generated by the combination of capacitor C1 and resistor R1. Switch S9 provides manual reset to the microcontroller. A 12MHz crystal provides the basic clock frequency to the microcontroller. Capacitors C2 and C3 provide stability to the oscillator. EA pin (pin 31) of the microcontroller is connected to 5V to enable internal access. Port pins P2.0 through P2.3 of the microcontroller are used for LED indication of run, stop, clockwise and anti-clockwise rotation. Port pins P2.4 through P2.6 are connected to the inputs of inverters N3, N2 and N1 of 74LS04 (IC2). The output of inverter N3 is used to trigger pin 2 of NE555 timer.

- Advertisement -

Timer NE555 is configured as a monostable and its time period is decided by preset VR2 and capacitor C4. When pin 2 of NE555 go e s l ow, output pin 3 becomes high for the predetermined period.

The output of NE555 is connected to pole P of relay RL1. Normally-open (N/O) contacts of relay RL1 are connected to N/O1 and N/ C2 contacts of relay RL2. N/C1 and N/ O2 contacts of RL2 are connected to ground. The outputs of inverters N2 and N1 drive relays RL1 and RL2 with the help of transistors T1 and T2, respectively. D1 and D2 act as free-wheeling diodes. Poles P1 and P2 of RL2 are connected to IN1 and IN2 pins of motor driver L293D. OUT1 and OUT2 of L293D drive motor M.

E87_fig-2

Fig. 2 shows the power supply circuit. The 230V AC mains is stepped down by transformer X1 to deliver the secondary output of 9V, 500 mA. The transformer output is rectified by a full-wave bridge rectifier comprising diodes D3 through D6, filtered by capacitor C6 and then regulated by ICs 7805 (IC5) and 7806 (IC6). Capacitors C7 and C8 bypass the ripples present in the regulated 5V and 6V power supplies. LED5 acts as a power-‘on’ indicator and resistor R10 limits the current through LED5.

196_fig-3

The proposed panel arrangement for the microcontroller-based DC motor controller is shown in Fig. 3. An actual-size, single-side PCB for the microcontroller-based DC motor controller is shown in Fig. 4 (View as PDF) and its component layout in Fig. 5 (View as PDF).

Operation

The eight pushbutton switches are connected for eight different functions as shown in the table.

84B_function-of-diffrent-switches

When S1 is pressed, the microcontroller sends low logic to port pin P2.5. The high output of inverter N2 drives transistor T1 into saturation and relay RL1 energises. So the output of NE555 is fed to inputs IN1 and IN2 of L293D through both the contacts of relay RL2. Now at the same time, after RL1 energises, the microcontroller starts generating PWM signal on port pin P2.4, which is fed to trigger pin 2 of NE555 through inverter N3. The base frequency of the generated PWM signal is 500 Hz, which means the time period is 2 ms (2000μs). The output pulse width varies from 500 μs to 1500 μs. The R-C time constant of the monostable multivibrator is kept slightly less then 500 μs to generate exactly the same inverted PWM as is generated by the microcontroller.

4 COMMENTS

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components

Calculators