PIC18 Pulse Width Modulation (PWM) DC Motor Speed Controller with the RPM Counter Project
Equipped with sophisticated Enhanced Capture/Compare/PWM (ECCP) peripheral the Microchip PIC18F14K50 microcontroller could produce up to four PWM channels output. The enhanced PWM (Pulse Width Modulation) mode in ECCP peripheral is capable to drive the full bridge DC Motor circuit directly both in forward or reverse direction. It also could generate single PWM output on the selectable PIC18F14K50 pins when it configured in pulse steering mode. In this tutorial we will take advantage of PIC18F14K50 pulse steering mode to drive the DC Motor and at the same time we will build the RPM (Rotation per Minute) counter to observe the PWM effect on the DC Motor speed and display it on the 2×16 LCD.
The PWM and RPM Counter Project
On this project we will use the HITEC C PRO PIC18 MCU Family Version 9.63PL3 and Microchip MPLAB IDE version 8.40 as our development tools platform. This project also serves as the learning tools of how to use many of the Microchip PIC18 advanced peripherals simultaneously to accomplish the project goal. You could see the complete project demonstrated on the video at the end of this tutorial; Ok now let’s list down all the project interesting features:
- Using Advanced 8-bit Microchip PIC18F14K50 microcontroller with PICJazz 20PIN development board
- Driving the HD44780U 2×16 LCD in 4-bit data mode
- Use DC Motor taken from discarded dual shock PS2 Playstation joystick and the Tamiya racing car tire for measuring the DC Motor RPM
- Simple and easy to build RPM sensor with the infra red reflective object sensor
- Use the ADC peripheral to read the trimport value for adjusting the DC Motor Speed and display the PWM duty cycle on the LCD
- Use the PIC18F14K50 external interrupt and 16-bit TIMER0 counter to measure the RPM and display it on the LCD.
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:
- motor control with pic microcontroller