NPEDUCATIONS, Electronic circuits development, electronics tutorials, microcontroller tutorials and projects, advanced microcontroller (ARM) based tutorials and projects, Embedded c development, Embedded c for ARM cortex M, Intel IoT based projects, IoT projects, CC3200 launch pad projects, MSP430 Launchpad tutorials and projects, Tiva C launch pad tutorials and projects, 8051 tutorials and projects, sensor interfacing with microcontroller tutorials, data communications and networking tutorials, peripheral interfacing with microcontroller, led message scrolling display, arduino based tutorials and projects, intel galileo based tutorials and project, ADC interfacing tutorials, LED Blinking, LCD interfacing, Embedded System tutorials and projects, projects, projects, online Embedded C training

What is DC Motor? Interfacing DC motor with 8051 microcontroller using Relay and ULN2003

What is a DC Motor?

A DC motor runs with the help of Direct Current. It produces torque by using both electricity and magnetic fields. The common term used to refer both fields is Electromagnetism. When a current carrying conductor is placed in the external magnetic field, then it will experience a force proportional to the current in the conductor and strength of the external magnetic field.
                        F = B*L*I
Where F is force in dynes.
            B is flux density in lines per square centimetres.
            L is length of the conductor
            I  is current in the conductor.

The same principle is used in the DC motor. The DC motor has rotor, stator, field magnet, brushes, shaft, commutator. The DC motor requires more current to produce initial torque than in running state.

Interfacing DC motor with 8051 microcontroller using Relay and ULN2003

Interfacing the DC motor directly to 8051 microcontroller is not possible. Because the DC motor uses large current (200-300mA in small DC motors) to run. When this current flow into the 8051 microcontroller, the IC will get burn out. Therefore we need a driving circuit. In this tutorial, we are using DC motor driving circuit using relay and ULN2003/ULN2803.

Figure 1.1 Interfacing DC motor to 8051 Microcontroller using relay and ULN

A very simple driver circuit for the DC motor is by using Relay driver circuit is shown in figure 1.1. One wire of the DC motor is connected to the swing terminal of the relay and other wire is grounded as shown in figure. Initially the relay swing terminal is at normally closed connection. Connect the DC motor supply positive at NO. Whenever the relay coil is exited the swing terminal is attracted towards the coil and connected to the NO terminal of the relay. Now the current flows through the DC motor winding and starts rotating.

Whenever the current flowing through the coil is off the swing terminal is again comes back to its original position. The flywheel diode protects the ULN driver circuit from large negative potential developed across the coil when the current in it is off.

In the above circuit, upon reset the microcontroller the relay is switched ON and drives the motor. This happens only during the reset button is pressed, because upon reset all the microcontroller port pins acts as input pins. By default input pins are at logic HIGH, therefore this logic High at the port pin causes the Relay to be ON via ULN driver.

To avoid this situation, build a simple circuit using BC547 transistor. This circuit acts as a not gate (transistor as a switch). To make the transistor as a switch, it should operate in between two regions (cut-off and saturation) don’t try to operate in active region which will show undesired results. For this purpose a Base resistance of 330Ohms is connected to transistor (BC547) base to make the transistor completely ON (saturation region) and again 330 Ohms resistor is connected at collector. A Led show the ON or OFF operations of the transistor. The circuit diagram is shown in figure 1.2

Figure 1.2 DC motor interface to 8051 MCU with a Not gate to avoid reseting condition

Important Note:

1.       The speed of the DC motor is proportional to the current flowing in it.
2.       The Direction of the DC motor shaft rotation is depending upon the currents flowing in its winding.
3.       Provide separate power supply to DC motor. If we connect the circuit power supply to DC motor, the motor takes large current to produce initial torque in it. This sudden large current may damage circuit components. If your circuit has an LED and LCD, you will find dimness of both during motor start.
4.       Some DC motor comes with a capacitor connected along the two terminals. This capacitor by pass any AC noises in the power supply.

1 comment :

  1. how to connect 4 uln2003a with microcontroller for controlling 32 relay on single port of 8051


Thanks for visiting NPEDUCATIONS. We will contact you soon


anup panchal said...

how to connect 4 uln2003a with microcontroller for controlling 32 relay on single port of 8051

Post a Comment

Thanks for visiting NPEDUCATIONS. We will contact you soon

If you really like this tutorial, Don't forget to give the comment or please subscribe to the RSS feed by submitting your E-mail or like our Facebook page.

Powered by Blogger