calculate RPM of a DC motor

Status
Not open for further replies.

ChArLyZzZ

New Member
hey guys
I'm using PIC16F877a...i'm connecting a DC motor on pin RC2/CCP1 (PWM) and getting the speed back from an optical interrupter on pin RC1/CCP2 (capture mode)...I'm using a 4 MHz crystal
I'm letting CCP2 generating an interrupt every 16th rising edge, then i display the values of CCPR1L and CCPR1H on LCD
I want to know how can i calculate this value to be the RPM of the motor??
I know how to calculate the period of the signal,but what next??
Thank you guys for ur help
 
It's simple maths, dividing 1 by the time taken per revolution gives you revs per second, you then multiply that by 60 to give RPM. I've shown that as two steps, but in practice you would do it in a single step.

Presume one revolution takes 10mS (0.01 seconds), you simply divide 60 by 0.01 to give 6000 RPM.

If you have more than one pulse per revolution, you just alter the top value accordingly - so if you had two pulses per revolution then you would divide into 30 instead of 60.
 
requse for the rpm programm

hey bro i have to write the same programm using the 16f877a and the opto interrupter. can u please send me this programm on my e mail opr post it here .jaksaranjeet@hotmail.com


thankx.
 
Nigel i never knew that. Thanks for the code even tho it wasnt for me heh...

Ill make sure i save this page.
 
sir! i have to write the same programm using the 16f877a and the opto interrupter. can u please send me this programm on my e mail or post it here
my email is , I would be very thankful to you if u send me the code

Moderation.

Members email deleted in order to prevent spamming
 
Last edited by a moderator:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…