Pages: [1]   Go Down
Author Topic: Reading Frequency based RPM data from an Engine Control Unit  (Read 809 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,
Logged

Illinois, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 126
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 21
Posts: 1670
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged


UK
Offline Offline
Shannon Member
****
Karma: 184
Posts: 11196
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Pages: [1]   Go Up
Jump to: