DC motor speed control using PWM using PIC16F876
If you do not have EAGLE, you can download a full working version from CadSoftUSA http://www.cadsoftusa.com
Here is a zip file with the EAGLE schematics and PCB layout. http://hans-w.com/MotorSpeedEAGLE.zip
New ! Source code available
C source code… requires CCS PCM compiler.
PCM is available from CCS http://www.ccsinfo.com/picc.shtml
//(C)Copyright 2002 Hans Wedemeyer Houston Texas U.S.A
// for use with Fan motor speed control
// see schematic PWM Motor Speed Control
// Aug. 10 / 2002 This matches the new EAGLE schematic and PCB layout.
#byte portA = 0X05
#byte portB = 0X06
#byte portC = 0X07
ADCValue = Read_ADC();
delay_ms(100); // monitor 10 times a second
if ( ADCValue != ADCValueOld )
ADCValueOld = ADCValue;
Source code and Hex files are available here: http://hans-w.com/motorspeed.zip
////////////////////////////////////The original text and pictures://////////////////////////////////////////////////////////////
I tried several ready made PWM speed control circuits. Of the few I tried, there were problems that I did not like.
Here is the schematic.
1) Lots of components.
2) PWM running as a low frequency which became audible as a loud buzzing sound from the motor.
3) I needed to build it now, and did not have all the components.
My solution, although it’s much like cracking nuts with a sledge hammer, solved these problems.
For more detail: DC motor speed control using PWM using PIC16F876
EasyEDA: Ideas for Circuit Design, Innovation for Electronics Access
Free Circuit Design: Schematic – Simulation – PCB Layout – Gerber Viewer
Cheapest PCB Prototype: Only $2 for 10pcs 10×10cm PCBs, 24 hours Quick Turn, DHL Delivery in 3 Days
Current Project / Post can also be found using:
- buck converter design pwm 16f controller code
- pic16f876 DC Motor Speed Control Schematic
- speed control dc motor by pcm
- speed control of dc motor using pwm