Read and convert RPM with Arduino... how do I interpret the RPM?
#22
TECH Senior Member
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
No problem man! lol I figured a little humor would help the situation! Stay warm...
#24
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
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.
#25
On The Tree
Thread Starter
iTrader: (1)
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes
on
0 Posts
![](https://ls1tech.com/forums/images/ranks/ls1tech10year.png)
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
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.
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
![Happy](https://ls1tech.com/forums/images/smilies/LS1Tech/gr_stretch.gif)
#26
Restricted User
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
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.
#27
On The Tree
Thread Starter
iTrader: (1)
Join Date: Jul 2007
Location: Southern MD
Posts: 180
Likes: 0
Received 0 Likes
on
0 Posts
![](https://ls1tech.com/forums/images/ranks/ls1tech10year.png)
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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
![Happy](https://ls1tech.com/forums/images/smilies/LS1Tech/gr_stretch.gif)
#28
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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;
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;
#29
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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
#30
TECH Senior Member
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
Thank you! Good to know! Now if only I can remember that.... lol
#31
Restricted User
#32
TECH Junkie
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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!
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!
#33
Restricted User
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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!
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!
#34
TECH Junkie
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
just using pulsein()?
#35
Restricted User
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
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.
#36
#37
Restricted User
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
#38
Restricted User
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.
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.
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++;
}
{
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++;
}
You'll just need a way to get a pulse.
The following users liked this post:
Rick Marshal (04-25-2021)
#39
![Default](https://ls1tech.com/forums/images/icons/icon1.gif)
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.