12v tachometer "fix it" box / signal processing

Hiya-

this is my first arduino project, so please bear with me. Any advice much appreciaved.

I would like to be able to modify the frequency of a square wave output of my motorcycle engine and use it as an input on a tachometer.

  • the engine outputs a 12v square wave signal with a frequency of 33 Hz / 1000rpm. When the engine is spinning at 2000 RPM, the signal is 66 Hz.

  • I would like to be able to modulate that according to a formula of my choosing. Maybe at 1000 RPM, it still outputs 33Hz, but at 2000 RPM, it outputs 99Hz.

  • I would like to use a separate 12V signal to choose whether the frequency is modulated or not. No signal, the frequency comes through unmodulated. If a 12V signal is present, then the frequency is modulated according to the formula mentioned in the second bullet point.

Is an Arduino the right platform for sensing a 12V square wave frequency and outputting a modulated 12V square wave frequency?

What parts / power supply might I need / how long will it take the arduino to "boot" when I turn on the motorcycle, and how tricky will this project be to implement ?

thanks!

Sencing 12 volt cab be done by using a voltage divider. For better noice supression I would use an opto coupler.
To send out 12 volt at least a transistor is needed.

If you have this

the engine outputs a 12v square wave signal with a frequency of 33 Hz / 1000rpm. When the engine is spinning at 2000 RPM, the signal is 66 Hz.

Why do you want to change it to this?

I would like to be able to modulate that according to a formula of my choosing. Maybe at 1000 RPM, it still outputs 33Hz, but at 2000 RPM, it outputs 99Hz.

Also, I don't think the word modulate is being used correctly here. Could you please explain a little clearer on what you mean.

Hi- thanks for your response.

I want to change it so I can calibrate the tachometer.

I am not sure if "modulate" is the correct term here, but i would like to be able to take an input signal of a certain frequency, and then output a different frequency according to a formula, let's say output = 2*input

I would like to know if an arduino is appropriate for this project, and if so, what parts I will need. If not, where I should look. thanks!

Sounds like your engine produces 2 pulses per rev. 1000 RPM = 2000 PPM / 60 = 33.3333 PPS.
If you measure the microsecond interval between pulses, RPM = 30000000 (30 million) / micros per pulse. Is your engine a V twin?

Yes, good guess !

JCA34F:
Sounds like your engine produces 2 pulses per rev. 1000 RPM = 2000 PPM / 60 = 33.3333 PPS.
If you measure the microsecond interval between pulses, RPM = 30000000 (30 million) / micros per pulse. Is your engine a V twin?

that makes sense. Is there a way to measure that with an arduino?

I'm sure it can be done. You can't connect 12V signals to Arduino directly. You could use voltage dividers (essentially a pair of resistors) to reduce the 12V signals down to 5V. But as engine voltages vary significanly and can contain dangerous high voltage spikes, using opto-isolators might be safer. Same for the tach output also.

In terms of modulating the signal, that can all be done in the code: read the input rpm; modify the value as required; output the modified rpm; repeat.

But it sounds like you are trying to cheat some official test?

Hi- yes, I am trying to cheat a test so I can register the bike. It has absurdly long gearing , so it isn't actually loud, but if you rev it up to 5000 rpm it won't pass the test, which is the strictest in europe.

On the input an opto-isolator or over-voltage protection circuit is safer than a voltage divider because there are sometimes voltage spikes (and other variations) in a car/motorcycle electrical system.

On the output side you'll need some kind of 12V driver to "boost" the voltage. Depending on the (unknown) input you're connecting to, you may be able to sue a simple transistor or MOSFET driver. You may need to add a pull-up resistor tp 12V or you may need a different circuit. Presumably, it's a low-current requirement so you just have to boost the voltage (from 5V) and almost any NPN transistor or N-channel MOSFET should work. ...A transistor driver circuit is slightly different (different resistor requirements) so don't just drop a regular transistor into the MOSFET circuit I linked to.

I would like to be able to modulate that according to a formula of my choosing. Maybe at 1000 RPM, it still outputs 33Hz, but at 2000 RPM, it outputs 99Hz.

map().

To generate the frequency you can use tone()

DVDdoug:
On the input an opto-isolator or over-voltage protection circuit is safer than a voltage divider because there are sometimes voltage spikes (and other variations) in a car/motorcycle electrical system.

On the output side you'll need some kind of 12V driver to "boost" the voltage. Depending on the (unknown) input you're connecting to, you may be able to sue a simple transistor or MOSFET driver. You may need to add a pull-up resistor tp 12V or you may need a different circuit. Presumably, it's a low-current requirement so you just have to boost the voltage (from 5V) and almost any NPN transistor or N-channel MOSFET should work. ...A transistor driver circuit is slightly different (different resistor requirements) so don't just drop a regular transistor into the MOSFET circuit I linked to.
map().

To generate the frequency you can use tone()

thanks !

What parts shoudl I start with? Arduino starter kit + transistor + opto isolater ?

mystikalicious:
Hi- yes, I am trying to cheat a test so I can register the bike. It has absurdly long gearing (longest on any bike ducati ever made), so it isn't actually loud, but if you rev it up to 5000 rpm it won't pass the test, which is the strictest in europe.

Sounds like you should talk to the software guys at Volkswagen.

Sounds like you should talk to the software guys at Volkswagen.

:smiley: ;D :smiley: ;D :smiley: ;D :smiling_imp:

Sounds like you are having Brexit problems.

JohnLincoln:
Sounds like you should talk to the software guys at Volkswagen.

Or cadillac, mercedes, bmw, corvette... Everyone cheats on sound tests.

Which Arduino were you thinking of using?

Hi- I'd really like to get started on this project and order supplies, but I have no idea !

a starter kit : https://amzn.to/3kJwuNc
opto isolator (I know this is a board not the chip) SparkFun Opto-isolator Breakout - BOB-09118 - SparkFun Electronics
some sort of way to send a 12V signal out. How does this look? https://www.infineon.com/dgdl/irlz44npbf.pdf?fileId=5546d462533600a40153567217c32725

Or... is there a simpler ardino and little plastic project box I should be working with?

Any advice much appreciated!

Starter kit? Nooooooo! Full of junk no-one else wants.

I already suggested how to send 12V signal out, check my earlier post. No point isolating the inputs if you don't isolate the output.

Nano. Decent sized breadboard. Solid core hookup wire in a few colours including red & black. Some resistors (330R, 1K, 4K7, 10K). Fine nosed electronics pliers & wire cutters/ strippers.

A 12V-5 Dc-Dc converter designed for auto environments.

Search for litterature about Arduinos. There are books for beginners.

I've got something running on a Mega2560 that I think could be ported to a 32U4-based Arduino like the Micro. Check your PMs.

Most stuff fits in a shoe box....