Go Down

Topic: Reading Frequency based RPM data from an Engine Control Unit (Read 994 times) previous topic - next topic

sonikin

I'm trying to implement an arduino to control a LED RPM histogram and trigger a shifter relay for automatic upshifting. The engine control unit (ECU) is able to output the RPM data in two forms: PWM or tachometer output. The PWM is configurable to different frequencies (~6Hz-980Hz range, I have it currently set at 189.5Hz) and adjusts the duty cycle based on the RPM. The tachometer output gives a Hz/RPM signal.

So far I haven't had any luck with using the PWM output and using the pulseIn() function to interpret the duty cycles. I haven't gotten around to using filters to smooth out the signal into an analog function.

Any suggestions on how to approach the challenge? Both the arduino and ECU are on the same battery, thus referencing the same ground.

Cheers,

sdturner

You can use an interrupt and capture the time using millis() or micros(). If you only interrupt on one edge you will get frequency and if you interrupt the change in pin state you can measure the pulse width by subtracting the rising edge time from the falling edge time. The PulseIn() function should do it also.

Nick Gammon

I have a sketch here that measures the width of a pulse. If you adapt that a bit you might be able to measure the length of the duty cycle. Since the frequency is known, you only need to know the width of either the on or off pulse.

http://www.gammon.com.au/forum/?id=11504
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

DuaneB

Hi,
   If you have a look at the 'how to read an RC receiver' example on my blog it's basically doing what you want, as is Nicks.

Duane B

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

PeterH

Doing it in the Arduino should be possible and fun to do, but have you considered that you could achieve what you're asking for just using the tacho output and a standard shift light?
I only provide help via the forum - please do not contact me for private consultancy.

Go Up