Summary of DC motor and Fan speed control using pic 16f877 Microcontroller
This project explains how to control the speed of a fan or DC motor using the PIC16F877 microcontroller and PWM (Pulse Width Modulation) technique. By varying the duty cycle of the PWM signal generated on CCP1 or CCP2 pins, motor speed can be precisely adjusted. The PIC16F877’s 10-bit resolution PWM output is controlled using specific registers (CCPR1H, CCPR1L, CCP1CON, PR2, and Timer2). Since the microcontroller cannot drive motors directly, an L293D motor driver IC or an H-Bridge circuit is used to handle higher current loads safely.
Parts used in the Fan/DC Motor Speed Control Project:
- PIC16F877 microcontroller
- L293D motor driver IC
- DC motor or small fan
- 20MHz crystal oscillator
- Push buttons
- Connecting wires
- Breadboard or PCB
- Power supply (battery)
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.
