08 March 2015

Revealing of Digital RPM meter Technique


The digital RPM meter calculates Revolution of piston or flywheel. The technique behind this is CCP (Capture and Compare) and Pulse width.
This is give away of "MMD ramper" secrets ;-)

INPUT:

  • All motorbike or Car engine is provided with fry-wheel with pulsar coil to activate spark plugs. these pulses can be taken for RPM reading.
  • The spark plug sensor can also be applied, but the problem is unwanted high level spike and distortions, and also not that accurate as previous method

CCP: 

This includes 3 modules in microcontrollers they are, Capture and compare/ PWM/PPM, we need only Capture and compare here.
Capture and compare the name itself says capturing pulse and comparing them, This module takes pulses as input. If one pulse occurs, the timer will starts for either rising edge of pulse or falling edge (whatever programmer specified) and waits for another pulse to occur, after second pulses specified edge it gives the timer outputs in form of bits ( say timer of 16 bits it gives output like 65535-lapsed bits). That means you got period (1/frequency) of pulse.

Conversion:

Got pulse frequency in bits form for calculations

Actual formula

f = clock(32MHZ)/(8(prescaler)*(65536-timer value))

My formula by trial and error:




Pulse:

I have differentiated pulse pattrns for motorbike and car,
  • For motorbike
    • 4 stroke: you will get 1 pulse per 2 rotation of fly-wheel 
    • 2 stroke: 1 pulse per 1 rotation
  • But car having 2 to 4 pistons (cylinders), 
    • Car with 2 cylinders (cylinders) gives pulses same as 4 stroke motorbike.
    • Car with 4 cylinders will give 2 pulses per 1 rotation.

Sensor circuit




Output

You can get output in forms of 7 segment, Alphanumeric LCD or even led graph.

My suggestion:
PIC18F26k22 (40 pin)
2 - 7 segment display (not multiplexed) with 13 LED bargraph.


RPM meter working video


Happy Programming,

Correct me if i'm wrong,

sources:
  • http://www.microcontrollerboard.com/pic-timer1-tutorial.html
  • http://www.mikroe.com/chapters/view/53/chapter-5-input-capture/
  • http://www.mikroe.com/chapters/view/6/chapter-5-ccp-modules/




0 comments:

Post a Comment