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

    • Wheel alignment immediately. Not "when I get around to it". And further to what Duncan said - you cannot just put camber arms on and shorten them. You will introduce bump steer far in excess of what the car had with stock arms. You need adjustable tension arms and they need to be shortened also. The simplest approach is to shorten them the same % as the stock ones. This will not be correct or optimal, but it will be better than any other guess. The correct way to set the lengths of both arms is to use a properly built/set up bump steer gauge and trial and error the adjustments until you hit the camber you need and want and have minimum bump steer in the range of motion that the wheel is expected to travel. And what Duncan said about toe is also very true. And you cannot change the camber arm without also affecting toe. So when you have adjustable arms on the back of a Skyline, the car either needs to go to a talented wheel aligner (not your local tyre shop dropout), or you need to be able to do this stuff yourself at home. Guess which approach I have taken? I have built my own gear for camber, toe and bump steer measurement and I do all this on the flattest bit of concrete I have, with some shims under the tyres on one side to level the car.
    • Thought I would get some advice from others on this situation.    Relevant info: R33 GTS25t Link G4x ECU Walbro 255LPH w/ OEM FP Relay (No relay mod) Scenario: I accidentally messed up my old AVS S5 (rev.1) at the start of the year and the cars been immobilised. Also the siren BBU has completely failed; so I decided to upgrade it.  I got a newer AVS S5 (rev.2?) installed on Friday. The guy removed the old one and its immobilisers. Tried to start it; the car cranks but doesnt start.  The new one was installed and all the alarm functions seem to be working as they should; still wouldn't start Went to bed; got up on Friday morning and decided to have a look into the no start problem. Found the car completely dead.  Charged the battery; plugged it back in and found the brake lights were stuck on.  Unplugging the brake pedal switch the lights turn off. Plug it back in and theyre stuck on again. I tested the switch (continuity test and resistance); all looks good (0-1kohm).  On talking to AVS; found its because of the rubber stopper on the brake pedal; sure enough the middle of it is missing so have ordered a new one. One of those wear items; which was confusing what was going on However when I try unplugging the STOP Light fuses (under the dash and under the hood) the brake light still stays on. Should those fuses not cut the brake light circuit?  I then checked the ECU; FP Speed Error.  Testing the pump again; I can hear the relay clicking every time I switch it to ON. I unplugged the pump and put the multimeter across the plug. No continuity; im seeing 0.6V (ECU signal?) and when it switches the relay I think its like 20mA or 200mA). Not seeing 12.4V / 7-9A. As far as I know; the Fuel Pump was wired through one of the immobiliser relays on the old alarm.  He pulled some thick gauged harness out with the old alarm wiring; which looks to me like it was to bridge connections into the immobilisers? Before it got immobilised it was running just fine.  Im at a loss to why the FP is getting no voltage; I thought maybe the FP was faulty (even though I havent even done 50km on the new pump) but no voltage at the harness plug.  Questions: Could it be he didnt reconnect the fuel pump when testing it after the old alarm removal (before installing the new alarm)?  Is this a case of bridging to the brake lights instead of the fuel pump circuit? It's a bit beyond me as I dont do a lot with electrical; so have tried my best to diagnose what I think seems to make sense.  Seeking advice if theres for sure an issue with the alarm install to get him back here; or if I do infact, need an auto electrician to diagnose it. 
    • Then, shorten them by 1cm, drop the car back down and have a visual look (or even better, use a spirit level across the wheel to see if you have less camber than before. You still want something like 1.5 for road use. Alternatively, if you have adjustable rear ride height (I assume you do if you have extreme camber wear), raise the suspension back to standard height until you can get it all aligned properly. Finally, keep in mind that wear on the inside of the tyre can be for incorrect toe, not just camber
    • I know I have to get a wheel alignment but until then I just need to bring the rear tyres in a bit they're wearing to the belt on the inside and brand new on the outside edge. I did shorten the arms a bit but got it wrong now after a few klms the Slip and VDC lights come on. I'd just like to get it to a point where I can drive for another week or two before getting an alignment. I've had to pay a lot of other stuff recently so doing it myself is my only option 
    • You just need a wheel alignment after, so just set them to the same as current and drive to the shop. As there are 2 upper links it may also be worth adding adjustable upper front links at the same time; these reduce bump steer when you move the camber (note that setting those correctly takes a lot longer as you have to recheck the camber at each length of the toe arm, through a range of movement, so you could just ignore that unless the handling becomes unpredictable)
×
×
  • Create New...