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
PIC 16F84A Pin diagram:

PIC 16F84A Pin diagram
Working of the circuit:

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.
Description :
This is the one stop educational site for all Electronic and Computer students. If you want to learn something new then we are here to help. We work on Microcontroller projects, Basic Electronics, Digital electronics, Computer projects and also in basic c/c++ programs.
#Home #Sitemap #Submit #Terms of Use
Copyright©2011 electrofriends.com All Rights Reserved
Contact:info@electrofriends.com | Powered by Dhyeya
January 6th, 2010 at 11:38 pm
i am interested in doin this project…..can u share with me the schemtics and proram code
March 6th, 2010 at 10:11 am
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
July 10th, 2010 at 12:14 pm
your website very impressive.so please send more articles on electronics
August 16th, 2010 at 11:57 pm
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.
September 17th, 2010 at 4:46 pm
Congratulations!Can’t wait to understand a lot more posts…Keep rockin’Have a great day, Jamie
October 16th, 2010 at 9:40 pm
thanks for the article
where do i get the schematic and source
thanks
October 28th, 2010 at 6:08 pm
hello.i would like to know what is the best pic which can go bidirectional.tq
August 30th, 2011 at 7:22 pm
Ciao.This and ‘right on track I used to drive a wiper motor 12 V I will use it ‘for a rotisserie.
Would you be so ‘kind enough to provide the wiring diagram?.
Many thanks (IK1CFJ)
September 17th, 2011 at 5:06 pm
Hi Ranjith, how are you. i’m jeeva.
I’m doing final year project for my course. i’m using PIC 16F877A to control a 12V DC motor driven pump. I’m having difficulty in controlling the pump speed.
I just need the pump to increase the speed in time delay.
For ex: initial 30% speed, aft 2 sec= 50%, aft 5 sec= 100%. In unidirection.
The PIC get input from sensor, when sensor on, pump operation should start in speed variation. I understand this chip have two PWM output at RC1 & RC2.
i’m totaly black out how to use this & do the program or this.
Brother can you please help me…
September 27th, 2011 at 3:24 am
Can you send me the circuit diagram?
December 1st, 2011 at 6:42 pm
hey i want to do a project on remote controlled cars…Using PIC its very good one…In my project Time of operation of motor will be changed according to the interest of the operator…so my problem is how to program that without depending on the time of operation….hope u will help me….
December 29th, 2011 at 2:21 pm
I WANT TO DO THIS PROJECT,PLZ SEND THE CIRCUIT DIAGRAM ,BLOCK DIAGRAM,ABSTRACT & ALL DETAILS RELATED ON THE DC MOTOR SPEED CONTROL USING PIC 89C51 &PIC 16F84 ,HOPE YOU WILL HELP MEE