RPM vs. RGB LED

I am wanting to have my arduino read my engine RPM using the low voltage input (12V) on the coil. I would like to have colors fade on an RBG LED in response to engine RPM. I am not asking anybody to write the sketch for me here I have written some but they have been basic. I am hoping somebody here could possibly point me to a document, or something so I can figure out how to write this.

I am wanting to have my arduino read my engine RPM using the low voltage input (12V) on the coil.

The Arduino can not read 12V signals. They must be reduced to 5V for an Arduino to read. Fortunately, this is very easy with a voltage divider (that's a google term). Unfortunately, the 12V input to the coil is a constant, not related to engine RPM. So, reading it wouldn't tell you anything.

Even if you found something that did relate to RPM, you have not defined any relationship between RPM and color. How do you want to represent 1000RPM? 2000RPM? 12000RPM? 36000RPM? (See, one of the issues is that you have not even defined a range of values.)

Your right the + side of the coil would be useless I was half asleep when I posted this however the - side of the coil is pulsed to ground which in turn would provide in my case 1/2 engine RPM (2 cyl V-twin) my RPM range is 900 - 7800 RPM, pretty low certainly well within the range of the Arduino. I am aware the Arduino cannot handle 12v stepping it down to 5v is not a big deal.

maxxheadroom:
I am wanting to have my arduino read my engine RPM using the low voltage input (12V) on the coil. I would like to have colors fade on an RBG LED in response to engine RPM. I am not asking anybody to write the sketch for me here I have written some but they have been basic. I am hoping somebody here could possibly point me to a document, or something so I can figure out how to write this.

Sounds doable.

You will have to be very careful about voltage isolation because even coil -ve on the LT side can see voltage spikes. I'd suggest some sort of crowbar protection. You will also need to be careful how you detect pulses off the coil voltage signal because the signal itself is likely to be very noisy, so you will probably need either hardware filtering or some robust debounce logic in the code to make sure you don't trigger on transients.

Once you have calculated the rpm value from the input frequency you can convert that to RGB brightness values however you want, and the code to do that would be straightforward. However, a human making sense of the LED colour and trying to deduce anything about the RPM would be much harder, and it's hard to imagine it telling you anything you didn't already know from the engine note.

Are shift lights what you really want? In that case, why not just fit some standard shift lights?

I am not after a shift light, just after some custom one off lighting on my bike something that nobody else has and at the same time learning a bit more. I am just not sure where to start.

I am just not sure where to start.

Your project breaks down into two parts - determining RPM and activating lights based on that RPM.

Concentrate on one part at a time.

In my mind, the hardest part is going to be defining what color corresponds to various RPM values.

You can use a potentiometer to represent RPM, to test the color part. Read the potentiometer output, map the 0 to 1023 value to the range of RPM that you want to deal with (0 to ? 8000 RPM?). Then, determine what value in the range 0 to 255 for red, green, and blue is appropriate for that RPM value. Then, apply the r, g, and b values to the appropriate pins.

There is not a universally accepted idea of what constitutes a smooth transition from black (0 RPM) to white (max RPM). You may not even want to use black and white as the ends of the spectrum.

You might want to see if you can rig up a means to determine what gear you are in, and use different colors for each gear.

I am not so concerned about which gear I am in, I don't intend for this to have any practical application other than the "ooooooo pretty" effect :slight_smile: I am still trying to figure out what I need to pick up the pulses, and get them to a clean usable state. I do really appreciate your input!