Speed control of DC motor using microcontroller part 2

Before continuing with second part of speed control of DC motor article , I recommend you to go through speed control of DC motor first article so that you can get basic idea about how to control speed of DC motor and which factor is common in all types of DC motors to control speed. To read first tutorial comment on link blow:

Speed control of DC motor using microcontroller part 1

I have already mentioned there are two methods to make pulse width modulator.These are Analog Electronics method and digital Electronics method using Microcontrollers. There are dedicated PWM controller IC’s are also available in market like SG3525, UC3842, SG2525 and many others. These PWM controller IC’s also use analog electronics method. Because their internal circuitry consists of operational amplifiers , resistors and capacitors.I will write also write article on PWM controllers for those who hate programming and don’t know about use of Microcontrollers. But there are few issues with these ready to use PWM controller IC’s. Most important issue are:

  1. you will require many extra components to make them ready to use.
  2. Exact frequency is not achievable. 1-2% error
  3. There is also a frequency limitation which in some cases generate audible in motors.

But there is no such issues with pulse width modulators of digital electronics type.

Components List:

  1. 7805 voltage regulator
  2. resistors
  4. IRL1004 FET
  5. UF4007 DIODE
  7. 1K Variable resistor
  8. 22pF capacitors

I have used PIC16F876 microcontroller to generate PWM and to change duty cycle by reading analog value of voltage across variable resistor. you can use any microcontroller you want. But logic will remain same.

Circuit diagram of speed control of DC motor

Circuit diagram of speed control of DC motor\

In above circuit diagram 12v is used as a power source.7805 voltage regulator is used to give 5 volt to variable resistor and supply to microcontroller. There is no need to give supply 5 volt in Proteus to microcontroller. Because by default 5 volt  and ground has been supplied to microcontroller in Proteus.Variable resistor is used to change duty cycle of PWM. By moving the knob of variable resistor you can change the duty cycle which is directly related with speed of DC motor. So you can adjust the speed of DC motor by adjusting variable resistor knob according to your speed requirement.

Circuit diagram of speed control of DC motor

Circuit diagram of speed control of DC motor

Video lecture on dc motor speed control

The PWM frequency is about 8Khz which will not make any audible noise.You can adjust it according to your motor specifications. IRL1004 is used as a switch. IRL1004 FET require only 5 volt logic level driver to operate FET and negligible amount of current.Therefore there is no need of any driver to drive IRL1004 FET. It can handle more than one ampere current very easily as it is mentioned in its data sheet. Diode 1N4007 is used as a free wheeling  fast recovery diode.Because motor is a inductive load and its back emf may damage circuit.Free wheel diode will provide flow path to back emf current and avoid sparking across motor terminals.

If you want to learn programming of PWM and ADC (analog to digital converter) using PIC Microcontrollers. Check PIC mircontrollers tutorails.

PIC Microcontrollers Tutorials 

If you want complete simulation and code of this project.Comment on this post with your email address and if you have any issue while making this project, feel free to comment on this post.

Future Recommendations :

  1. Feedback control mechanism to ensure constant speed
  2. Direction control of DC motor using H bridge
  3. Try to control more than one motors.
  4. Final year projects: Speed control of DC motor through wireless communication like GSM, GPRS, Bluetooth, ZigBee and many others wireless communication techniques.

I will also write on above articles soon. But to enhance your technical skills you should try it yourself.If you feel any problem.I will love to hear your problems and try to solve them.


  1. Idris December 22, 2014
  2. Namratha January 6, 2015
  3. wajee February 23, 2015
  4. Raju February 24, 2015
  5. Tebogo April 9, 2015
  6. Tebogo April 9, 2015
  7. Raju Bose June 4, 2015
  8. jasmin July 1, 2015
  9. Aditya Ingawale September 24, 2015
  10. terefe October 19, 2015
  11. ahmad zeb December 7, 2015
  12. ahmad zeb December 7, 2015
  13. Khaulah Zia December 22, 2015
    • BILAL Malik December 23, 2015
      • Bashir Abdullah AK May 21, 2016
      • Eze March 24, 2017
      • Douglas Tetteh Ayitey May 9, 2017
  14. ayesha February 3, 2016
  15. sherif February 7, 2016
  16. azoule March 16, 2016
  17. Akinlade Afees March 25, 2016
  18. Akinlade Afees March 25, 2016
  19. krishna April 11, 2016
  20. Moemen Wagdy April 26, 2016
  21. Moemen Wagdy April 26, 2016
  22. salah May 6, 2016
  23. fzz May 10, 2016
  24. atomatics July 26, 2016
  25. manqoba August 6, 2016
  26. hlehle August 14, 2016
  27. Wendy August 21, 2016
  28. Victor September 1, 2016
  29. Fatin October 11, 2016
  30. Victor October 20, 2016
  31. Melanie November 3, 2016
  32. Hassan Khattab November 17, 2016
  33. rodenz December 9, 2016
  34. rodenz December 9, 2016
  35. ibtisam January 24, 2017
  36. darpan shah February 18, 2017
  37. Azam khan February 19, 2017
  38. Samir Shrivastava March 11, 2017
  39. Mu March 18, 2017
  40. mohammed rafi March 18, 2017
  41. Akintade S.A March 24, 2017
  42. Aizaz Ullah Khan April 1, 2017
  43. shamika April 15, 2017
  44. cephatech June 9, 2017
  45. zain aijaz November 10, 2017
  46. sai December 29, 2017
  47. phal` January 1, 2018
  48. swap January 15, 2018
  49. Wilson January 25, 2018
  50. Ahmed salek January 31, 2018
  51. Ahmed salek January 31, 2018
  52. Md Habib April 2, 2018
  53. samri May 31, 2018
  54. Abhineet June 11, 2018

Add Comment