• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Engine RPM Counter/LED Display

Status
Not open for further replies.

minhs

New Member
I am trying to design an LED display for a motorcycle engine RPM counter. I thought of an LED array (say 5 or 6) lighting up gradually depending on the number of engine revs.

Is there a simple way of doing this?
One method i thought about was to get information from the spark plugs as each spark corresponds to one rev.
A few problems arise here as the input will surely be huge.

Another thing is that they may already be a tachometer/sensor device on the engine from where outputs can be taken.
I don't know what kind of output this will be, probably a pulse for every crankshaft/camshaft rotation.

After counting them, how could i make the LEDs light gradually depending on the number of revs?

Any suggestion/help is welcomed.
Thanks
 

phalanx

Member
There are a few things you need to figure out before you start. You basically mentioned them all but there are a few factors to consider with them.

First, if you are using a 4 stroke motorcycle you will only have one spark for every 2 rotations of the engine since 4 strokes have power strokes every other rotation. However, there are a number of motorcycles that fire the plugs every rotation because of the way the coils are wired. This is something you will have to look into on your own. Also, you wouldn't have to deal with the high voltage side of the coils for inputs, you can use the low voltage control side of the coil and isolate it from the rest of your circuit using an optocoupler.

Other possible inputs can be from the ECU of the bike (if its young enough to have one) or from the signals sent to the current tachometer. Both would involve determining the type of signal before you can develop your circuitry and software.

Using LEDs as a bar graph will greatly simplify the coding you will have to do. I would use at least 1 LED for every 1000 RPMs the engine can tolerate. So if you have a 1200 Sportster, use about 5 or 6. If you have a CBR 600rr, you will need around 15.

If your bike has a pulsed output for the tach, you will simply have to count the number of pulses over a specific period of time, relate it to a specific RPM range, and light the appropriate LED. Say for instance you want to update your LED display about 100 times a second. This means you will have to count the number of pulses that come through in that time. I'm not sure about the low end PICs because I rarely use them, but the larger ones have the ability to increment a timer using an external clock. The pulsed tach signal can be used as the clock for that timer. You can then use another timer to keep track of your 1/100th of a second (10ms) interval.

With this setup (assuming 1 pulse per rotation of the crank), you will get 10 pulses for 1000 RPM, 20 for 2000 RPM, 75 for 7500 RPM, etc, etc... Next you compare these values in software. If the counter value falls between 10 and 20, turn on LED 1; between 20 and 30, turn on LED 2. If you want to get fancier and some additional accuracy, you could say: If my counter is between 8 and 12, turn on LED 1. If my counter is between 13 and 17, turn on BOTH LED 1 & 2. If my counter is between 18 and 22, turn on LED 2. This algorithm can be very easily optimized by more advanced programmers but it will work perfectly and is easy to implement by novice programmers. Besides, if it works it works!

Another possibility is that the Tach uses an analog voltage level to determine RPMs. If this is the case, you can use a PIC to sample the voltage using its A/D converter and then apply an algorithm similar to the one above.

I hope that answered some of your questions. Just make sure to understand the system you are trying to interface with before you start building circuits. Also, take some time and read through the datasheets of a few PIC models. This will help you better understand the ways the PIC can utilize external signals.
 

DirtyLude

Well-Known Member
You can use a simple lm2917 frequency to voltage converter with 1 (or 2) lm3914 dot/bar display driver. The datasheets are available on the national semiconductor site. I believe I saw a whole schematic on the net somewhere, but there are some simple schematics on the lm2907/2917 datasheet, and I think there's an app note.

Like mentioned earlier, you'll want to protect the circuit.
 

Roff

Well-Known Member
Phalanx, you might want to rethink the approach you posted. You have fallen into the old "RPM = revolutions per second" trap. 6000 RPM is 100 rev/sec.
 

phalanx

Member
Ron H said:
Phalanx, you might want to rethink the approach you posted. You have fallen into the old "RPM = revolutions per second" trap. 6000 RPM is 100 rev/sec.
You are right. It was late last night when I posted that and I wasn't thinking about the whole picture. My mistake.

Minhs, you will have to adapt the formula to correct for my mistake. The underlying algorithm will still work though.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top