DC motor and Fan speed control using pic 16f877 Microcontroller
Here is a simple project on how to control fan or dc motor speed uisng pic 16f877 microcontroller. There are numerous ways to control the speed of motor(or fan). Varing current,voltage and resistance etc. But when it comes to controlling the speed using microcontrollers. Then the PWM(Pulse width modulation) technique is used. In Pulse width modulation the digital signal high and low time is chaged. Actually it is made variable. So if the digital signal is high for 70% of the time and low for 30% of the time then the motor rotates more quickly because the signal is high for most of the time. Setting the pwm for different times can make you to control the motor speed.
- PIC 16f877 microcontroller
- L293d Motor driver Ic
- DC Motor or small fan
- Crystal 20MHz
- Push Buttons
- connecting wires
- Bread board or PCB
- Power Supply battery
Their are two pins dadicated for generating pwm output in pic 16f877 microcontroller. These two pins are of port c pin 1 and 2. They are named as CCP1 and CCP2 (CCP stands for Capture,compare and PWM). These two pins can be used in capture, compare and Pwm mode.They can also be used as digital I/O. We first have to configure them whether we want to use them in CCP mode or as digital I/O.
For more detail: DC motor and Fan speed control using pic 16f877 Microcontroller