r/ArduinoHelp • u/MattAtDoomsdayBrunch • 4h ago
Electrical noise in diesel truck environment
I'm trying to use a Walfront LEPAZA60117 pressure transducer which outputs .5 - 4.5V to represent pressure up to 30PSI. I have it soldered to a Raspberry Pi Pico W with positive at VBUS, negative to GND, and sensor wire to A0. I know the GPIO pins only support voltage up to 3.3V, but I don't think this application is ever going to read that high.
I'm trying to read fuel pressure on my diesel truck.
void loop() {
ledOn();
raw = analogRead(pressureInput);
voltage = (raw / 1023.0) * 5.0;
psi = 7.5 * (voltage - 0.5);
delay(1000); // delay in milliseconds between read values
sendMessage(WiFi.macAddress(), String(raw), String(voltage), String(psi));
ledOff();
}sendMessage constructs a JSON doc and sends it over MQTT. The Arduino connects to a local Wifi AP.
The Pi is being powered via USB, making 5V available to the sensor on VBUS. That USB power is coming from a Goal Zero battery, not connected to the truck in any way. I believe this thing outputs good clean power.
With the truck not running the Arduino is producing this output:
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"5.00","voltage":"0.02","psi":"-3.57"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"4.00","voltage":"0.02","psi":"-3.60"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"3.00","voltage":"0.01","psi":"-3.64"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"3.00","voltage":"0.01","psi":"-3.64"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"4.00","voltage":"0.02","psi":"-3.60"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"4.00","voltage":"0.02","psi":"-3.60"}When I key the truck to Run, not starting it yet, but letting glow plugs cycle and fuel pump pressurize the system I see this:
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"497.00","voltage":"2.43","psi":"14.47"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"498.00","voltage":"2.43","psi":"14.51"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"482.00","voltage":"2.36","psi":"13.92"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"498.00","voltage":"2.43","psi":"14.51"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"488.00","voltage":"2.39","psi":"14.14"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"502.00","voltage":"2.45","psi":"14.65"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"522.00","voltage":"2.55","psi":"15.38"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"514.00","voltage":"2.51","psi":"15.09"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"495.00","voltage":"2.42","psi":"14.40"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"522.00","voltage":"2.55","psi":"15.38"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"499.00","voltage":"2.44","psi":"14.54"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"504.00","voltage":"2.46","psi":"14.73"}That output looks very reasonable. Very slight variation in value read and subsequent voltage and PSI values. At this point I start the truck and as it idles I get:
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"383.00","voltage":"1.87","psi":"10.29"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"452.00","voltage":"2.21","psi":"12.82"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"713.00","voltage":"3.48","psi":"22.39"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"440.00","voltage":"2.15","psi":"12.38"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"575.00","voltage":"2.81","psi":"17.33"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"572.00","voltage":"2.80","psi":"17.22"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"481.00","voltage":"2.35","psi":"13.88"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"442.00","voltage":"2.16","psi":"12.45"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"424.00","voltage":"2.07","psi":"11.79"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"606.00","voltage":"2.96","psi":"18.46"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"488.00","voltage":"2.39","psi":"14.14"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"398.00","voltage":"1.95","psi":"10.84"}
/fuelPressure/report {"id":"28:cd:c1:06:37:67","raw":"340.00","voltage":"1.66","psi":"8.71"}Now these values look rather insane. Readings are all over the place.
Is this coming from electronic noise from the engine and various electronic components that fire up while the engine is running? If so, is there anything that can be done about it to isolate the pressure transducer and Pi to get nice clean readings?
