Arduino based shift light?

Hi everyone, new to the forum, and I’ve yet to actually get an arduino, but plan to in the very near future. Anyway, I am a bit of a ricey car person, and as such, want to incorporate a shift light into my car.
(combo question of both hardware and software, not sure where to put it really…)

So to put it as simply as I can…could I use the tach signal that goes to my instrument cluster to give the arduino a frequency?

Bit more in depth…I want it to give me 3 shift points, for fuel efficiency, normal driving, and redline. I’m not sure of what kind of amperage or voltage the tach line runs, though I assume 12 volts. Would the arduino be able to take this input, or would I have to step in down (if so how?). There would be 3 sets of 3-4 LEDs each for 3 the 3 driving types. I would also like to set which mode I am in, which is probably a pretty simple structure of 3 if statements containing the if statements for the LED outputs…

I’ve taken intro to java, so I am not tooo shaky on the programming front of it…

(The numbers used will likely not be the real frequency I get, but I can find that out for myself I think.)
with one input and 3 outs looking like
tachIn   //input from the tach line
fuel out    //output to power the first set of LEDs
normal out   //second set
redline out  //third set

and in the loop

if (mode == fuel)
{   //begin fuel mode
if (tachhIn > 2300 || tachIn < 2500)
      {
         blink fuel out
      }
if (tachIn >2500 || tachIn < 2600)
      {
         fuel out solid
      }
}   //end fuel mode


if (mode == normal)
{   //begin normal mode
if (tachhIn > 2800 || tachIn < 3000)
      {
         normal fuel out
      }
if (tachIn >3000 || tachIn < 3100)
      {
         normal out solid
      }
}   //end normal mode



if (mode == redline)
{   //begin redline mode
if (tachhIn > 5700 || tachIn < 5900)
      {
         blink redline out
      }
if (tachIn >5900)
      {
         redline out solid
      }
}   //end redline mode

Please edit your post and mark all your code, then press :)

Would the arduino be able to take this input, or would I have to step in down (if so how?).

No. 5V is the maximum. However, a "voltage divider" (hint, hint) will step the voltage down to a usable level.

could I use the tach signal that goes to my instrument cluster to give the arduino a frequency?

Depends on what that signal consists of. If it is a pulse every so often, and the tach counts pulses and computes rpm, that's one thing. It that counting and computation is done elsewhere, and the tach gets a constant voltage between 0 and some upper limit, then, you can't use that to give the Arduino a frequency. You could still use that signal.

I would also like to set which mode I am in, which is probably a pretty simple structure of 3 if statements containing the if statements for the LED outputs...

It's a bit more than that. You need a way of setting the mode (a momentary contact switch, for instance) and some code to read the switch and a counter to keep track of the number of times the switch has been pressed, to define the current mode. Once you know the mode, you use if/else if/else to choose which set of LEDs to manipulate.

Thanks for so much info paul! I do believe that the tach signal wire does run a frequency, it's a pretty old car, so there are no fancy computer in there...

And on the touch switch, yeah, I know I would need a way to set it, was just thinking ahead of myself with the coding lol. Again, thanks a lot -James

hokay, I've been told that there may be a line that runs voltage instead of freq. If this is true I'll respond back, but how could I detect different voltages with the arduino seeing as how it's a 5V max input?

If this is important to you to learn arduino, best of luck and I hope you get help ( I'm a newb who cant help much.) I'm also a car guy. If you just want a shift indicator light just go to summitracing.com and buy a tach with a shift indicator light. You can get a 4/8cyl tachometer with a shift indicator (then use 2 worm clamps to clamp it to your steering wheel right in front of your gauges) for about the cost of arduino. They even carry simple shift indicator lights that run from your stock tach if you already have one. So thats the answer if you want a shift indicator light. If you want to do it with arduino, I can't help ya much.

how could I detect different voltages with the arduino seeing as how it's a 5V max input?

Using a voltage divider.

+12V -- -/\/\/\/- + -- -/\/\/\/ -- Gnd | analog pin

The two resistors should add up to about 10K. The ratio should be 7/12. You want to drop 7 volts through the first resistor.

Since the +12 on the car is not regulated, and can go as high as 14.5 volts or more, I'd go with more like a 10/15 ratio, to be safe.

So, the first resistor would be about 6600 and the second about 3300.

Absolute values are not too critical, so use the closest standard resistor to 6600 or 3300.

lol, thanks reboticon, but I'd like to do this project, I like being able to have a nice one-off in my car, and I can make it look hella better than some lame LED screwed onto my dash =D.

And paul, I found my tach signal, so I have a big question for you... It turns out that it is just run on voltage alone. at idle (around 700 RPMs) it is near 5.5V AC. Yes alternating current. I assume I can put a rectifier on that to sort that out, but it climbs in voltage rather quickly. nearly 1 volts per hundred RPM, so when I hit ranges at redline (6800 RPM) I can only imagine there will be some rather ridiculous voltages. May I bother you for some idea of how I could actually get this info to the arduino, and how I could read it...

Possibly a voltage / freq. converter then a divider? Or might the voltage climb to high for one of those? Any help I can get to make this easier is hugely appreciated! -Solar

You'll need to measure the maximum voltage that gets sent to the tachometer. Then, use a rectifier to chop the negative voltages. Then, a voltage divider to get the voltage down to a level that the Arduino can handle.

At that point, you'll need to determine if there is a correlation between voltage and RPM or if there is a correlation between frequency (look at pulseIn) and RPM.

Once you know whether it is voltage or frequency that correlates, you can map the measured value to the correct RPM.

Alright Paul, thank so much. I know now that it is voltage that corresponds to rpm. So I'll use the idea of a rectifier followed by the divider. Now let's say I get to the point where 6800 rpm gives me 5v. Can I attach this to a digital pin to see the voltage? Could I perchance see some example code?

-solar

I got off my ass and looked up a basic arduino voltmeter lol. So i could use a divider to get it to 5 volts, and read that on an analog pin that will come back as 1023, right? So I can change the 'tachin' from frequency to the number returned by the analog pin. Just find what is returned by the pin when I get it going at the lower voltages and set those as my normal and fuel modes. This idea is working, not too poorly, just differently than i thought it would lol.

  • solar