Fernando said:
Dear friends,
I am wanting to project a Tachometer for my motorcycle using the part
mechanics (pointer) of an industrial Tachometer. I have a problem in the
slow rotation because as it is a motor of 2 cylinders 4 strokes, and I will
be receiving
sign of a cylinder only, I have: 2 RPM = 1 Pulse. This makes the pointer to
be
oscillating (balancing) I am wanting to avoid that. If somebody has a
suggestion
I thank.
I have done this two ways.
Hang a scope across the primary of the ignition coil while
the engine is running. Do whatever it takes to condition
this awful looking 200V pulse into a CMOS logic level. I used
a ~20K series resistor, a shunt capacitor, a clamp diode
to prevent negative swings, and a 4.7V zener to clamp positive
swings.
1. Use the Conditioned pulse to trigger a CMOS 4538 non-retrig
one-shot. Set the period of the one-shot so as to get about a
25% on-duty-cycle out of the one-shot when the enging is running
at the fastest RPM you intend to display on your meter. Use a
series resistor between the one-shot output and the meter
movement(turns the meter into a voltmeter). Choose the series
resistor to cause the meter to read full scale on the highest
RPM. If the meter damping is not sufficient to keep a steady
needle at idle, shunt the meter movement with 10 to 1000uF
capacitor.
2. Use the conditioned pulse (see above) to generate interupts
to a PIC using the INT0 pin. Write an Interupt service routine
which uses a Timer to measure the Period between coil firings. The
clock source for the timer can be something derived off the
instruction clock. Run the PIC's instruction clock from a
4-20Mhz crystal. Set up the clock divisor to the timer register
so that it wont overflow at low RPM and still gives resonable
granularity at high RPM.
The main PIC program takes the measured Period
and divides it into an apropriate constant numerator such that
the dividend is proportional to RPM. You can now convert this to
BCD and display it digitally, or use it to drive one of the PIC's
PWM generators such that it deflects an analog meter movement
proportional to RPM. The update rate is once per coil firing, but
the PWM can run at a much higher rate so the meter needle wont
flicker.
MIkeM