Jump to content

Cowboy

Unpaid Member
  • Joined

  • Last visited

Everything posted by Cowboy

  1. If you're wanting to get a whole module, rockauto.com has them the cheapest I've seen.
  2. Try this, I think it accomplishes what you're wanting. I tried to simplify it a little. int ReadExhaustPressure(){ const int AverageNum = 5; // how many reads you want to average. int tmp = 0; for(int x = 0; x < AverageNum; x++){ int num = analogRead( ExhaustPressurePin );// reading the value of the sensor num = constrain(num, 83, 920);//constrain it for negative values num = map(num, 83, 920, 0, 100);//converting our readings to psi. num = consrain(num, BoostPressure, (BoostPressure * 3));//making sure the value we received is a plausible reading tmp = tmp + num;//add the current reading to tmp for averaging later. delay(analogDelay);// waiting between readings } return (tmp/AverageNum); // Averaging the values. }
  3. If I'm looking at it correctly, than I think you need to make "int index = 0;" and "int readings[numReadings]; " global, otherwise every time you enter your "readExhaustPressure()" function, it sets it to "0". Also, I'm not sure what you're doing with this: for (int thisReading = 0; thisReading < numReadings; thisReading++) readings[thisReading] = 0; Are you wanting to check the DP once everytime you enter the function, add it to the array, and then average it with the previous times? Or are you trying to get 5 readings all in the same call to the function?
  4. I'll have to look over the code in the morning when I can see what I'm looking at lol. If the value you're trying to constrain is outside of the minimum or maximum border you have set, it will be set to the value of the border it crossed. So; tmp = Constrain(40, 83, 920);//tmp is now 83 tmp = Constrain(1000, 83, 920);//tmp is now 920
  5. Looks good. I forgot to mention that I am averaging 3 reads. What do you have "analogDelay" set to? Here's something that should work the same, but may be a little cleaner. I used to not care about how clean my code was, but after leaving a project for a couple months, and then trying to get back in. Having a cleaner code makes figuring out what you were trying to do so much easier. //Read Sensors //Define the sensor type and range. (Namefromabove, 0v, 5v, 0v=minpos,5v=maxposition) int ReadPotentiometer(){ int tmp = analogRead( PotentiometerPin ); delay(analogDelay); int PotVal = (tmp + analogRead( PotentiometerPin )) / 2; return map(PotVal, 0, 1023, 0, 970); // read the value from the sensor } int ReadBoostPressure(){ int tmp = analogRead( BoostPressurePin ); delay(analogDelay); int BoostVal = (tmp + analogRead( BoostPressurePin )) / 2; BoostVal = constrain(BoostVal, 83, 920); // read the value from the sensor return map( BoostVal, 83, 920, 0, 100); // Last two values are the psi range of the choosen sensor } int ReadExhaustPressure(){ int tmp = constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); tmp += constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); tmp += constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); tmp += constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); tmp += constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); return map(tmp / 5, 83, 920, 0, 100); // Last two values are the psi range of the chosen sensor } int ReadThrottlePosition(){ int tmp = analogRead( ThrottlePositionPin ); delay(analogDelay); int ThrottleVal = (tmp + analogRead( ThrottlePositionPin )) / 2; return map ( ThrottleVal, 103, 920, 0, 100); // read the value from the sensor } Because I have a couple sensor hookups, and do a lot of repetitive stuff with them. I used a lot of "for loops", it makes things simple and clean, but it won't run as fast as the above code. But that is an option in your interested. int ReadExhaustPressure(){ int AverageNum = 5; int tmp = 0; for(int x = 0; x < AverageNum; x++){ tmp += constrain(analogRead( ExhaustPressurePin ), 83, 920); delay(analogDelay); } return map(tmp/AverageNum, 83, 920, 0, 100); // Last two values are the psi range of the chosen sensor }
  6. My Boost sensor was very steady as well when I had it Tee'd into where the wastegate hooks in by the AFC, because there is an orifice right there working as a snubber. I than moved it to the head for reasons, and now it is very spiky. So I'm going to put my own snubber in the line. In both cases, the sensors actual locations didn't move, and had the same 1.5' of 1/4" hose going to it. So maybe your DP spikes is just normal engine operation.
  7. It's rated for 0-100 cause it's not accurate out of that range, it will still read a different voltage.
  8. This is what I'm currently running, and it's working great, and I'm guessing we've got the same $20 pressure transducer. Once thing you'll want to do is be prepared for negative pressures. I posted a couple options earlier in this thread. int PressureRead(byte AnalogPin) { int AverageNum = 3; int Val = 0; for (int i = 0; i < AverageNum; i++) { Val += analogRead(AnalogPin); } Val = constrain((Val / AverageNum), 103, 925); return map(Val, 103, 920, 0, 1000 );//0-1000 so I have 0.1 precision. } I would make sure the sensor is wired correctly, and is receiving good voltage.
  9. Just to clear things up, the OP's truck is indeed a 2nd generation Dodge Ram.
  10. Maybe you can go to ebay and look for a pack of "NOS Toilet Paper"?
  11. I drop the tank. I've done it more times than I can count (12+1). When working with the fill spout, be careful with the metal part, cause it is only mounted to the bed with a wimpy plastic... thing.... that will break. So removing the 3 screws may be a good idea. Sump is a good option, I like mine. If it's removing the bed vs dropping the tank, IMO, dropping the tank wins. However, depending on your setup and what you're trying to do, you may be able to remove the 4 bolts holding the bed on on the drivers side, and then loosen up the 4 passengers side bolts and jack the drivers side of the bed up to gain clearance for what you're trying to do. I have never had to remove the carrier bearing to drop the tank. it took 22 minutes to drop the tank last I timed (assuming it's already under 1/4 tank).
  12. They arn't really. I had and have both.
  13. It's lower then I expected, but the negative voltage isn't a good thing. If it were me I'd use a lm393 and a couple resistors as it's a heck of a lot cheaper then a specialized VR chip.
  14. It depends on your external circuitry. Here's a good read about VR sensors - http://en.wikipedia.org/wiki/Variable_reluctance_sensor. I would recommend some sort of protection via a comparator to protect the micro controller. The guy on CF mentions needing a pull-up resistor, but I'm not sure as to why that is.
  15. Try this. //Globally volatile int TurboRPMPulses = 0; volatile unsigned long TurboRPMTimeLast = 0; unsigned long TurboRPMTimeStart = 0; int TurboRPMUpdateLast = 0; long TurboRPM = 0; const byte TurboRPMPin = 2; //it can be either 2 or 3 on arduino // in Void Setup void RPMSetup(){ pinMode(TurboeRPMPin,INPUT); attachInterrupt(TurboRPMPin, TurboRPMInterrupt, RISING); } void RPMInterrupt(){ TurboRPMTimeLast = micros(); ++TurboRPMPulses; } // in void loop int ReadRPM(){ if (RPMPulses >= 10 && (RPMTimeLast - RPMTimeStart) >= 100000){ noInterrupts(); TurboRPM = ((60000000UL * TurboRPMPulses)/(TurboRPMTimeLast - TurboRPMTimeStart)); TurboRPMPulses = 0; TurboRPMTimeStart = TurboRPMTimeLast; interrupts(); TurboRPMUpdateLast = millis(); } else if ((millis() - RPMUpdateLast) > 1000) {//if the turbo stops spinning, set it to '0' TurboRPM = 0; } }
  16. UPDATE! I got some more sensors hooked up. Just a note, there are spikes in the RPM and MPH readings due to lousy connections, I'll get around to fixing that at some point.
  17. Yes. Which seals are blowing? He can either get one from some other reputable source (rockauto.com migth be able to help with that), or try rebuilding the autozone unit with better seals. Depending on which seals he's having problems with, it could very well be an easy job.
  18. I normally play "ring around the rosie" a dozen times. So yeah, you should be fine.
  19. Even a cheap HF one will do the job, I got one used in a lot of stuff and it reads dead on with my flukes. So I keep it in the glove compartment. Extech was supposed to be a good brand as well, but I'm not impressed and likely won't buy any more meters from them. I've had an INNOVA 3320 one for at least 5 years, besides the buzzer not working, it still works fine. It's been dropped, rained in, disassembled...
  20. The Big fuse connects the battery to the alternator. By removing it you keep any AC signal made from the alt from getting to the battery or any other computers in the truck and causing the issues. Yes, an AC signal coming from the alt is caused by a leaky/defective Diode.
  21. Hot Cocoa! 1 Gallon Whole Milk Shy 1/2 Cup Cocoa Powder, 3/4 Cup Sugar ~1 Tbsp Sea-90 (Sea Salt) ~1/2 Tbsp Vanilla Extract ~1 tsp Maple Extract To Start, Milk Cow (you may substitute store bought "Milk") Pour Milk into large pot Heat to desired Temperature Add Salt & Sugar and Stir Add Cocoa Powder and Stir Add Vanilla & Maple Extract Stir everything together one last time. And then the easiest step, enjoy!
  22. The PS gear uses a tapered bearing, so if the overcenter adjustment isn't correct, then you'll have play in the pitman shaft. Installing a steering box stabilizer will remove that slop, as will adjusting the box like it was. I have mine adjusted correctly, and still opted to install one as I hit some pretty crappy road and a little more than optimal speed. As a side note, adjusting the box also fixed the Pitman shaft leak. My steering wheel locks. EDIT: welllllll, I guess there was more then one page lol
  23. I got the pressures adjusted back down. Still need to adjust the caster and see how it affects the ride quality. I got a spreadsheet attached that uses Mikes formula to calculate tire pressure. Nothing fancy, but it works. Tire Pressure Calculator.xls
  24. Nice video! Do I hear goat? lol sometimes I have issues as well, but if I take off the 's' in "https", that normally fixes it.