PCM Diagnostics & Tuning HP Tuners | Holley | Diablo
Sponsored by:
Sponsored by:

Read and convert RPM with Arduino... how do I interpret the RPM?

Thread Tools
 
Search this Thread
 
Old 01-14-2018, 07:33 PM
  #21  
On The Tree
Thread Starter
iTrader: (1)
 
MEAN GTO's Avatar
 
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes on 0 Posts

Default

Haha thanks G Atsma, appreciate the confirmation. I'm a nerd, so I know I can rely on the character map with Windows. It is currently 22° Fahrenheit outside
Old 01-14-2018, 08:15 PM
  #22  
TECH Senior Member
 
G Atsma's Avatar
 
Join Date: Jun 2016
Location: Central Cal.
Posts: 21,225
Received 3,153 Likes on 2,460 Posts
Default

No problem man! lol I figured a little humor would help the situation! Stay warm...
Old 01-14-2018, 08:55 PM
  #23  
On The Tree
Thread Starter
iTrader: (1)
 
MEAN GTO's Avatar
 
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes on 0 Posts

Default

Originally Posted by G Atsma
No problem man! lol I figured a little humor would help the situation! Stay warm...
Haha it sure did, thanks again. And stay warm wherever you're at too!
Old 01-16-2018, 08:50 AM
  #24  
TECH Junkie
iTrader: (1)
 
Pop N Wood's Avatar
 
Join Date: May 2006
Posts: 3,402
Likes: 0
Received 7 Likes on 7 Posts

Default

By the way easiest way to convert pulses to RPM is compare the pulse count to a known good tach. It will be off by an integer multiplier at best.

Optoisolators are a good way to protect against all sorts of voltage transient and grounding issues. Shouldn't be hard to find example circuits using then.

I've been trying to use an arduino to replace the guts of my stock tach because the 50 year old analog stuff is intermittent. Got me some stepper motors, just need to make myself do it.

Oh, and the keyboard shortcut for the degree symbol is Alt-0176.

Yeah, I'm bored at work as well.
Old 01-17-2018, 05:43 AM
  #25  
On The Tree
Thread Starter
iTrader: (1)
 
MEAN GTO's Avatar
 
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes on 0 Posts

Default

Originally Posted by Pop N Wood
By the way easiest way to convert pulses to RPM is compare the pulse count to a known good tach. It will be off by an integer multiplier at best.

Optoisolators are a good way to protect against all sorts of voltage transient and grounding issues. Shouldn't be hard to find example circuits using then.

I've been trying to use an arduino to replace the guts of my stock tach because the 50 year old analog stuff is intermittent. Got me some stepper motors, just need to make myself do it.

Oh, and the keyboard shortcut for the degree symbol is Alt-0176.

Yeah, I'm bored at work as well.
Thanks Sir! Yeah I figured just count the pulses and divide by 2 (pulses\2) to get the actual RPM, since I now know the coils fire 4 times every 2 revolutions, or ~2 times per 1 revolution.

I just ordered a few optoisolators back on Friday (among several other components I didn't already have a variety of) so going to tinker with them for sure and see how they work out.

I've seen some people use their Arduino to operate their digital tachs, and would definitely be interested in hearing your luck with the getting the analog gauge working with the stepper motors. I'm sure it's not terribly complicated to someone like yourself, but definitely a nifty thing to be able to accomplish.

Good call on the Alt-0176... was not aware that there were hotkey combos for special characters, all these years Thanks again for the assistance!
Old 01-17-2018, 12:16 PM
  #26  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

You got that backwards. It fires 2 times every 4 revolutions, not 4 times every 2 (that would be a batch fire setup, we have full sequential).

Retarding timing is all that hard to do either. Intercept the cam sensor signal. Then delay it so many degrees before feeding it back into the stock PCM.
Old 01-17-2018, 07:37 PM
  #27  
On The Tree
Thread Starter
iTrader: (1)
 
MEAN GTO's Avatar
 
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes on 0 Posts

Default

Thanks Joe! I apparently read that totally wrong somewhere! I'll surely look into retarding the timing and the coding out the launch controller once I get this more basic stuff down and working properly. I already have five of the 5v relays on my through-hole protoboard I'm putting together and I'll probably need to add 2-3 more for the launch controller and other future projects
Old 01-18-2018, 12:38 AM
  #28  
TECH Enthusiast
 
PeteS160's Avatar
 
Join Date: Oct 2017
Posts: 567
Likes: 0
Received 157 Likes on 73 Posts
Default

The easiest way is just pull the RPM value right off the bus and input it to your arduino as serial data.
byte J1850vpw::engineRPM(int &rpm){
byte status;
byte values[2];
status=getBytes("01","41","0C",values,2);
if (status != VPW_Read){
return status;
}
rpm=((values[0]*256)+values[1])/4;
return VPW_Read;
Old 01-18-2018, 06:43 AM
  #29  
TECH Apprentice
 
Krom's Avatar
 
Join Date: Sep 2006
Posts: 328
Received 2 Likes on 2 Posts

Default

Originally Posted by G Atsma
I can speak for him on this- "*" does mean degrees here, because computers don't have the little bitty circle you put above and to the right of the numbers that normally means degrees.

to get the ° symbol on a pc hold down the "alt" key, and type "0176" then let go of the "alt" key.

water boils at 212° F
Old 01-18-2018, 10:09 AM
  #30  
TECH Senior Member
 
G Atsma's Avatar
 
Join Date: Jun 2016
Location: Central Cal.
Posts: 21,225
Received 3,153 Likes on 2,460 Posts
Default

Thank you! Good to know! Now if only I can remember that.... lol
Old 01-18-2018, 11:34 AM
  #31  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

Originally Posted by PeteS160
The easiest way is just pull the RPM value right off the bus and input it to your arduino as serial data.
There isn't any CANBUS data on the older PCMs.
Old 11-12-2019, 04:07 PM
  #32  
TECH Junkie
 
MaroonMonsterLS1's Avatar
 
Join Date: Dec 2012
Location: Iowa
Posts: 3,578
Received 1,261 Likes on 807 Posts

Default

Dredging up an old thread...this is just the most useful thread I've found on this topic and it looks like some of the posters are still active
Did anybody in here end up getting a useful code for measuring rpm? I was thinking that using the rpm output from the pcm (simple square wave signal) would be the easiest way to get a reliable signal?
Any thoughts here? Thanks!
Old 11-12-2019, 05:28 PM
  #33  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

Originally Posted by MaroonMonsterLS1
Dredging up an old thread...this is just the most useful thread I've found on this topic and it looks like some of the posters are still active
Did anybody in here end up getting a useful code for measuring rpm? I was thinking that using the rpm output from the pcm (simple square wave signal) would be the easiest way to get a reliable signal?
Any thoughts here? Thanks!
You can use a gen 3 tach output wire straight into an arduino digital input pin and measure RPM that way.
Old 11-13-2019, 09:22 AM
  #34  
TECH Junkie
 
MaroonMonsterLS1's Avatar
 
Join Date: Dec 2012
Location: Iowa
Posts: 3,578
Received 1,261 Likes on 807 Posts

Default

just using pulsein()?
Old 11-13-2019, 10:32 AM
  #35  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

Originally Posted by MaroonMonsterLS1
just using pulsein()?
That is one way.
On my small engine dyno I read RPM by measuring the microseconds between pulses.
I read the keyway on the crank output with a stock gen 3 LS crank sensor, and then start counting microseconds until the next pulse.
The microseconds gives me the RPM. I usually do an average of between 3 to 5 pulses to clean up the numbers.
Old 11-13-2019, 10:00 PM
  #36  
TECH Resident
 
NSFW's Avatar
 
Join Date: Jan 2018
Posts: 852
Received 135 Likes on 103 Posts
Default

Originally Posted by JoeNova
There isn't any CANBUS data on the older PCMs.
But there is a VPW bus, and the PCM broadcasts RPM periodically. Or so I'm told... I haven't tried that approach myself but I will soon.

You can definitely query for it, I've got that working with a PC app already.
Old 11-19-2019, 08:06 AM
  #37  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

Originally Posted by NSFW
But there is a VPW bus, and the PCM broadcasts RPM periodically. Or so I'm told... I haven't tried that approach myself but I will soon.

You can definitely query for it, I've got that working with a PC app already.
I think at that point, wouldn't it just be easier to get one of the ready-made Arduino OBD adapters from somewhere like Freematics that comes with the sketches to pull any available PID data from the OBD wire and then do whatever you want with it? I was using one as a I/O expander add-on for the stock PCM to do 2nd fuel pump, meth injection, oil pressure/AFR safety shut-down, boost cut, etc.
Old 11-19-2019, 03:38 PM
  #38  
Restricted User
 
JoeNova's Avatar
 
Join Date: Mar 2014
Location: Ohio
Posts: 7,194
Received 107 Likes on 89 Posts
Default

Originally Posted by MaroonMonsterLS1
just using pulsein()?
Ignore this if its the wrong code, but I literally just fired my desktop up again after almost a year.
This is the RPM code (or at least one of them) that I am using on my small engine dyno, reading a single pulse per revolution.

void loop()
{
if (revolutions >= 10) {
detachInterrupt(0);

//RPMCALCULATIONS
rpmlast = rpm;
rpmmicros = micros() - lastmicros;
revs = (60000000 * revolutions);
rpm = revs / rpmmicros;
lastmicros = micros();
revolutions = 0;
}
Serial.println(rpm);
attachInterrupt(0, isr, FALLING); //Restart the interrupt processing
}
}

void isr()
{
if (digitalRead(2) == LOW) {
revolutions++;
}
I may have cut out some stuff trying to remove all of the HP/TQ/AFR calculations and Temp/Humidity/Pressure calculations for the SAE correction, but you should still be able to get the idea.
You'll just need a way to get a pulse.
The following users liked this post:
Rick Marshal (04-25-2021)
Old 04-25-2021, 07:49 PM
  #39  
Registered User
 
Rick Marshal's Avatar
 
Join Date: Apr 2021
Posts: 1
Received 0 Likes on 0 Posts
Default

This thread is a godsend. I'm attempting to grab rpm signal and translate it into voltage for an LED using Arduino. I've heard about the Arduino adapters but hoping I can just use tach signal wire. Not sure, however, if that data is encrypted, or where I could find it. I have 05 Lexus.



Quick Reply: Read and convert RPM with Arduino... how do I interpret the RPM?



All times are GMT -5. The time now is 02:08 PM.