Electronic – RPM counter using 8051 microcontroller

automationmeasurementmicrocontrollermotorspeed

I am building a RPM measurement unit using 8051 micro controller. I want to measure RPM of AC motor. I have connected proximity sensor to get the pulse for each turn.

I have connected the proximity sensor output to the counter of micro controller. And I am calculating the 1 sec delay using Timer.

For each second I am calculating the RPM = pulse count[counter value] * 60.

Ex: If pulse count = 16, I am getting RPM = 960 r/m
If Pulse count = 17, RPM = 1020 r/m.

Here I am getting difference of 60 r/m.

Using the above method, I can't measure RPM of 1000 r/m. Since pulse count * 60 will not be 1000 at any given point of time.

Please advise me how I can measure RPM in precision manner.

Thanks
Umesh

Best Answer

You would have to measure

  • either the duration between the last pulse and the end of your 1-second measurement period (and calculate that into your formula as a fraction of a pulse)
  • or (preferably) the duration between two pulses (ditching the 1-second period and using the inverse of the pulse duration to calculate the pulse frequency).

To implement this, you just need to reverse your current measuring principle: Instead of counting pulses per second, you would count milli- or microseconds1 per pulse.

1: or whatever fraction of a second you can easily obtain from a timer


Additionally, you might want to compute a sliding window average of your measurements to reduce their fluctuation.