Jump to content
SAU Community

Recommended Posts

I've read a lot of contradicting information about the format of the RPM signal from the R33 ECU etc. I'm looking to build an Arduino project and I need to know the electronic format of the signal from pin #7 on the ECU.

Is it a rising/falling 5/12V square signal?

To complicate things further I'm using the standard ECU and also an RB20 Nistuned ECU (I also have a Z32 one handy). All work fine with the tacho so I'm hoping they all output in an identical fashion.

If anyone can assist that'd be fantastic - or even if you can point me in the direction of someone who will know for sure.

Link to comment
https://www.sau.com.au/forums/topic/448228-r33-s2-gts-t-rpm-signal/
Share on other sites

I'd strongly suggest you put a scope on it and double check - if memory serves there is a pullup resistor in the body harness to 12V. At the very least the R34 workshop manual shows the tacho pulse on the cluster side as being upwards of 10V and I'd imagine the R33 would be similar. The trigger edge varying depending on if it is a DE or DET but if you are just trying to get an RPM reading that won't matter. You may also find the signal isn't quite as clean as you'd expect - on older Nissans it isn't but I haven't scoped an R33 before so your mileage may vary.

Cheers, I had a dig through the service manual and the RB25DET output is shown as a rising edge 5V signal so I'll give it a shot. The signal seems to have a 25ms gap at 1k rpm and a 9ms gap between rises at 2.5k rpm so I'm not sure how well the arduino will pick it up at that speed but we'll see...

Yeah it won't be a problem. Setup your interrupt to store time between interrupts in microseconds and keep your ISR short and you won't have any issues even north of 10,000rpm. The best way to learn is by experimenting (imo) but if you get stuck with the code let me know.

If you get some working code post it up =D

I was looking at something similair a while a go to create a vct controller, but a much easier solution came along in my case so I never bothered.

Edited by nicr4wks

Since a few of you want to see some code I knocked up a basic version of my existing code. I'll test it tomorrow to confirm it works before posting it.

Daniel - Do you want to have a crack at the code before I post mine? I don't mind either way.

Nah go for it! The RPM signal is just a minor part of my project so I have plenty to keep me busy. If it's different to my approach I'll try it anyway and compare methods :)

Finally got around to testing this. Note that I tested on an MCU that's much faster than an Arduino (still waiting on my Uno - I'll test on it once it turns up) but the attached code should compile ok. When run it'll send the current RPM via the serial port at 4Hz but you can update as fast or slow as you want. The code should be fairly self explanatory but obviously you wouldn't use delay in a real program but it'll show the concept. It also has some basic noise rejection in place where pulses shorter than the specified minPulse value are ignored, it's surprisingly effective. Here's a pic showing the output from the code. Worth mentioning there is a bit more to my test hardware than just a straight connection to the MCU so your mileage may vary.

 
#define pinRPM 3 // Define the tacho input pin
#define minPulse 2000 // Reject any pulses shorter than this value in uS. 2000uS = 10,000rpm on a 6 cylinder
#define noPulses 3 // Number of tacho pulses per engine revolution. 3PPR for a six-cylinder 4 stroke.
 
volatile unsigned long rpmTime = 0; // Length of time in microseconds between interrupts
volatile unsigned long rpmLastTime = 0; // Value of micros at previous interrupt
int RPM = 0;
 
void setup()
{
  pinMode(pinRPM, INPUT); // Set pinRPM as an input
  attachInterrupt(pinRPM, rpm_count, RISING); // Enable ISR rpm_count on pinRPM on a rising edge
  Serial.begin(115000);
}
 
void loop()
{
  noInterrupts(); // Disable interrupts whilst doing calcs
  
  if (micros() - rpmLastTime > 500000L){RPM = 0;} // If it has been more than half a second between interrupts then assume engine has stopped
  
  else
  {
    RPM = 60000000L / rpmTime / noPulses;
  }
 
  Serial.print("Current RPM: ");
  Serial.println(RPM);
  interrupts();
  delay(250);
}
 
void rpm_count(){
  if ((micros() - rpmLastTime) < minPulse) {return;} // If the time between interrupts is less than the minimum pulse time then reject it as noise and return  
  rpmTime = micros() - rpmLastTime;
  rpmLastTime = micros();
}

My Uno clone arrived yesterday so I figured I'd bench test this on the Uno for completeness. Due to a misunderstanding on my part as to how Uno interrupt pins are mapped you'll need to change the pinRPM definition in the posted code to either 0 or 1 to use pin 2 or 3 for input respectively. You may also want to change the signed rpm integer variable to unsigned (unsigned int RPM) as that will allow up to a theoretical 65,535 rpm vs 32,767 rpm. Aside from that the code works as intended; bench tested to 60,000rpm on a square wave input (with minPulse adjusted appropriately) with the Uno at 16Mhz. At 9,000rpm using a 1% duty cycle signal I get a jitter of 20rpm which I'd say is down to my basic test rig. Should suffice methinks :yes:

EDIT: I forgot to mention that the previous tests were on a running RB30 - which is why I didn't rev it too hard ;)

Edited by XR Pilot

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

  • Latest Posts

    • Thanks guys,  Yeah I should at least have them dynoed, at least then I know what I've got as a starting point.  The springs on these are hard as rocks. I vaguely remember Russman saying he was going to sell the shocks to me with the rocks fitted, as he was keeping the softer springs for his new setup.  I didn't click at the time but of course that was to let me know the shock/spring wouldn't be matched.  I also remember pricing up new springs around 2014-15, but, house, money etc. it never happened. So that was another reason to have them rebuilt. I have rebuilt the forks on many motorcycles so I think I could handle the seals on these easily enough, but getting the valving right would be a rabbit hole I cbf exploring.  Duncan, interesting to hear RP was tuning these back then. I might give them a call.  In the mean time I have been busy fitting sway bars. The Whiteline rear sway bar I purchased 15 years ago finally got fitted, along with the Whiteline front bar that showed up last week. Just waiting on new links for the front sway bar to finish that off.  And my spare set of advan AVS VS5's should be back from the powder coaters in a Pearl White finish sometime this week, with a set of Hankook RS4's lined up for fitting.  And then I just have all the suspension bushes to do. A comprehensive kit is on the way... Lots to do before the Ararat hill climb. Cheers guys 🍻   
    • Nice car! I’m glad folks in the US have gotten past the FnF and are buying real cool cars like the 260RS I was with a bunch of mates in Portland about a year ago and spotted a green Stagea (just a regular 2.5T AWD) parked about 2 blocks away and they were like “a what?” So I made a bet with them for a round of beers and said “ok one of you run down there and tell me if the steering wheel is on the correct side” 5 mins later the American comes trudging back up the hill and goes “he’s right guys. Ok what beer do you want?”
    • Should replace OR drop the tank, give it's good clean. Might be worth replacing that entire fuel level/pump/cradle thing with this: https://frenchysperformancegarage.com/products/fpg-s13-180sx-r32gtst-single-pump-hanger-kit-billet-hat-6-v3-fpg-089?gQT=2  
    • Thank you so much for the help
    • Yes it is ATF. I quote @Duncan "it takes a good synthentic auto trans fluid like Castrol Transmax Z" It's not a diff. It's a transfer case. Totally different thing. Yes, fluid will come out the sender hole. No you do not really need to drain it. Just pull the old, quickly poke the new, clean up and top up. But realistically, you should probably take the opportunity to change it anyway.
×
×
  • Create New...