DC Motor Controlling System using PIC

2. PIC Microcontroller

It is used to control the rotation of the motor. This senses the input and process it using the program burned in it and gives the required PWM output on the required port pins. The program is given later. To control the speed we need to control the duty cycle (‘ON’TIME / PERIOD). That is controlling the ON time. In the program we have used a timer (TIMER0), this timer can be used as variable delay generator to control the ON, OFF times. Also the prescalar can be used to change the varying ON time because it provides internal timing for program execution. We have made use the prescalar to control the PWM output which in turn controls the speed. Initially timer0 is set with some value and some prescalar. When it overflows it generates an Interrupt. This sets TOIF flag in the INTCON register. At the same time the program execution is deviated to the ISR. Here a register is used to control the varying time and to shift alternatively to send high and low as output. This is nothing but the PWM output.

3.Output

The output from the portA is given to the H-bridge. It is the arrangement of four transistors as shown below. Here four power transistors 2N3055 are used (Q1,q2,Q3,Q4). At any time either Q1, Q3 or Q2, Q4 are made ‘ON’, hence current flows from the source (Vdd) to ground (Vss) through the motor. The direction of the  motor is dependent on the polarity of the current. Hence by changing the ‘ON’ transistor pairs we can control the direction of the motor. To ‘ON’ the transistor we need to give high to its base. On controlling output coming out of port we can achieve the control over the motor rotation direction.

H Bridge circuit:

 H Bridge circuit
H Bridge circuit

PIC 16F84A Pin diagram:

PIC 16F84A Pin diagram
PIC 16F84A Pin diagram

Working of the circuit:

Circuit diagram of DC Motor controlling system
Circuit diagram of DC Motor controlling system

The circuit is built around the PIC IC 16F84A. The circuit is built as shown above. The power supply of 5V and ground is given to appropriate pin of the PIC IC and to the H Bridge circuit. A 4M Hz crystal oscillator (S) is connected as shown in the figure. Other type of oscillators can also be used. The crystal oscillator is more stable compare to other types. Oscillator acts as a clock source for the PIC IC operation.

The portB’s four pins are given to the H-Bridge as shown in the figure. These pins are the control lines (PWM output lines) given to H-Bridge to rotate in the desired direction and desired speed.

To change the direction and speed we need two buttons S1, S2. These buttons are one side grounded and the other sides are connected to the pin of the appropriate port of the PIC IC. On pressing the button S2 the speed is shift between minimum and maximum .On pressing the button S1 the direction of rotation is changed either clockwise or anti-clockwise.

Further development:

On varying the prescalar of the PIC we can achieve different speeds. For controlling this speed we need to add extra instruction in the ISR. There are still 3 pins left in the PORTB which can be used for the control of these speeds.

To handle a motor which requires more power, high power transistors or power amplifiers can be used.

This is the method by which we can control the motor direction and speed digitally. This allows us to control the motor without a direct wire connection between control unit and the motor driving circuit. By using appropriate communication method this can be achieved.

Applications:

This project is built with the PIC IC. Hence become more compact. Here the speed and direction are controlled digitally. Hence wireless communication between the controller and the dc driver is possible by adopting suitable methods. This project can be used wherever there is a DC motor. The controlling becomes very easy because a very small circuitry is sufficient.

This can be used in any industrial applications and in electronic devices, where a DC motor control is significant.

Program for the progect is give in the next page.

Editorial Team
Editorial Team

We are a group of young techies trying to provide the best study material for all Electronic and Computer science students. We are publishing Microcontroller projects, Basic Electronics, Digital Electronics, Computer projects and also c/c++, java programs.

17 thoughts on “DC Motor Controlling System using PIC

  1. I am interested to do project on bidirectional 12V dc motor with clock and anti-clockwise Directional rotation.kindly help me by providing source code using PIC16f84A and schematic of the same.

    Thanks & Regards
    Vinoth kumar.G

  2. The solutions to my inquiries have been very easy to take in thanks to this blog. It is certainly worth reading to aid relieve the stress I have been encountering. I suggest this for an award.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest updates on your inbox

Be the first to receive the latest updates from Codesdoc by signing up to our email subscription.

    StudentProjects.in