Hello.
I'm a beginner in Arduino, learning for a few months. I'm building a project that if all goes well, will be a big one. I will be monitoring 5 temperatures and 6 pressure points in a big ship engine. With temps I'm good, it's the pressure I'm having problem with.
I have one pressure transducer, sku237545 . It's a common one from internet. Signal output is from 0.5 you 4.5v . I tested it with air compressor it gives most of the times correct readings. Sometimes it gives me wrong reading., output going up and down. Yesterday I connected it to the oil pipe of the engine. The readings without the engine running were going up and down, from 1.2b to 3.0b then to 2.8b. I tried a lot of code blocks all giving the same output. I removed the transducer and measure it with a multimeter, the signal output is.0.544v which is good. I reinstalled it and tested it and the voltage output was 1.1v to 1.3v without any oil pressure an pressure output in a lcd is 1.3bars which is not normal. I reset the Arduino a few times and then all of a sudden the pressure output drops to.0.08bars which is good. After a following reset the pressure goes up to 1.8b.
The supply voltage is a steady 5.07 volts in all sensors.
Like I said I used many code blocks with the same results. So the problem must be in the transducer. Any ideas? If I get it to work I will put 5 more transducers.
One more thing. The location of the oil pipe and the transducer is on the top of the engine so when the engine is not running the oil goes down to the oil tank.
My first guess is that your supply voltage to the transducers is not constant and probably contains electrical noise. I have no real details on the transducer but at that price it is probably minimal in design. I am not sure how long the leads are but at those voltage levels you need to keep the impedance to the sensor reasonably low. Start at about 600 Ohms between the input pin on the arduino and ground. Try bypassing it with a 100nF cap to kill some noise. How clean is the power to the Arduino, If you are not feeding it via the Vin give that a try with 8 to 10 volts applied to the barrel connector. I assume you are using a seperate clean and stable 5V supply for the transducers. The accurcy is 1.5%, that is greater then 50mV. Try this link: https://www.revrobotics.com/content/docs/REV-11-1107-DS.pdf Fron the data sheet:
It tells you CALCULATING PRESSURE, The output voltage of the sensor (VOUT) depends on the supply voltage (VCC) and the pressure (p): = × 0.004 × + 0.1 Given the output voltage, pressure can be calculated as follows: Read the data sheet for more details and best plan on calabrating each one of them and set up some schedule of regular calabration to be sure they are accurate. Your power supply is critical as there is no stablization in it for voltage and your output is dependend on the voltage.
Arduino has an external supply of 7.5v . All sensors and transducer share the same 5v line and the voltage is stable at 5.005v .I will try tomorrow to feed the transducer with a second line. If the signal output is 2.3v, the supply voltage must remain 5v correct?
Can you point me how to use the 100nF cap and tell me what it does?
You didn't say which Arduino. Then we assume Uno.
Those sensors are ratiometric, with an output of 10-90% of their supply (not necessarily 0.5-5volt).
Power AND ground must be connected directly to the Arduino pins, to preserve ratiometric behaviour.
A 100n ceramic capacitor from pin to ground (close to the Arduino) might help to reduce noise.
Maybe you should have used 4-20mA output sensors in a hostile/industrial environment.
Post the code you're using.
Read the guidelines first about code tags.
Post an image of the setup too.
Leo..
What is the analog reading with 0 pressure? Should be about 102.
Hello
The Arduino is Uno with SensorShield v5. I rised power to 9v but the problem remains
PowerLine goes from SensorShield Pin1 to 2 pcb boards 6 meters away.(1 deck below). All sensor cables are 7 meters or less to the boards. Power voltage to all sensors is 5.05v stable. Signal cables go to Shield Pin5 to Pin10 and Pressure to A1.
How i did the checkings:
- and Ground = 5.05v (all of them)
Ground and Signal = 0.544v (pressure)
I think its the correct way for checking.
I removed all temps and left only the pressure, from 0.544v went up to 3.4v with 0 pressure.
I even removed all boards and connected the wires only, nothing happened.
last code block i used is:
void setup() {
Serial.begin(9600);
}
void loop(){
int sensorVal=analogRead(A1);
Serial.print("Sensor Value: ");
Serial.print(sensorVal);
float voltage = (sensorVal*5.0)/1024.0;
Serial.print("Volts: ");
Serial.print(voltage);
float pressure_pascal = (3.0*((float)voltage-0.47))*1000000.0;
float pressure_bar = pressure_pascal/10e5;
Serial.print("Pressure = ");
Serial.print(pressure_bar);
Serial.println(" bars");
Serial.print("Pressure = ");
delay(100);
}
i dont think its a code problem.
Can i go up to 15 sensors connected to the shield?
Can i power the sensors externally?
Your diagram is confusing.
Where does the power for the sensors come from.
I hope not from a different 5volt supply near the sensors.
These pressure sensors are ratiometric, and all three wires must connect directly to the Arduino.
"Volts" is not relevant. You're not making a voltmeter.
Work in A/D values, and convert that directly to pressure.
See this sketch.
Leo..
float sensorType = 12.0; // in bar
const int offset = 102; // zero pressure adjust
const int fullScale = 922; // max pressure adjust
float pressure_bar; // final pressure
void setup() {
Serial.begin(9600);
}
void loop() {
pressure_bar = (analogRead(A1) - offset) * sensorType / (fullScale - offset);
Serial.print("Pressure: ");
Serial.print(pressure);
Serial.println(" Bar");
delay(500);
}
Power to all sensors comes from the Arduino sensor shield. NOT from external source. I removed all temp sensors and left only pressure transducer with same results. Pressure values are not correct on the lcd screen. I think I have already tried the code you gave me but I will try it again tomorrow. On the diagram Red line is Power(5 volts) and Black line is Ground.
Start with a minimal setup.
Does the problem persist if you connect the sensor with short wires directly to the Uno (no shield).
Or if you remove the LCD, and just use the serial monitor, with the Uno powered from the PC/laptop.
Leo..
Made some progress today. I removed the second board and connected the transducer directly with cables to the Sensor Shield. Temp sensors were connected too. Readings now are more stable, only 0.5 bar out but that can be fixed. I will check it later. There must be something wrong with the board.
Can 4-5 pressure transducers share common power lines (+, ground) or each one must have it's own power?
Thank you
There are two variables in my code for calibration of zero pressure and 12bar pressure.
Can use five sets of those variables for the five sensors.
If there is some fluctuation due to pressure variation, then smoothing code (averaging several samples) can be used.
Sharing power/ground of the pressure sensors shouldn't be a problem.
Extra power supply decoupling at the sensor end could reduce noise, as well as decoupling on the Arduino inputs.
A long Ethernet cable works as an aerial. Maybe you should use shielded Cat-6, with the shield grounded only at the Arduino end.
Leo..
Made some tests today with the engine running. Although the correct pressure was 2 bars, the transducer pressure output was going up and down. It started at 0.07b with is fine and went up to 1.8b for a while and then started going up to 5-6b and down to 4b.
Couldn't change the cable because here everything is closed due to Corona virus. I will change it as soon as they open. (And the capacitors too)
Is there something else I could check in the mean time?
Thanks
Today I made some extended tests.
When I opened the system the pressure output was 2.3b going up and down to 3.5 bars. Replaced the cable with another with the same results.
So here is what I did:
- Removed the transducer from the system and moved it next to the Arduino.( used another compatible board) and tested it with short cables. Pressure output to serial was -0. 05 to -0. 10 bars. This is fine.
- Tested again with longer cables (about 20 meters), output was the same
- Removed the shield from the original board and tried again. Output still the same, -0.05 to -0. 10 bars which is fine.
- Placed the transducer in an air compressor with pressure regulator. I used long cable and compatible board and a laptop for serial. Transducer is working fine and following the pressure regulator exactly. Tried up to 6 bars.
So my first thought was that the shield must be faulty. So as a last test I placed everytime back in place as before. Then the pressure output was still the same, -0. 05 to -0. 10 bars.
So the transducer is working, long cable is not a problem, Arduino board and Shield are ok.
Before all tests, I tried with 560Ω connected to input pin and Ground, nothing happened. Still 2b to 3b ups and downs. Tried with 2x560 in series, still the same. Didn't try the 100nF cap because I couldn't find any.
Any more ideas? Thanks
I managed to change the cable. I now use cat5 shielded cable. The shielded wire I connected to the Arduino as ground. Now the readings are stable and correct. It's 0.5bar off but that's steady in different pressure outputs. So the transducer is working fine now. The cable length is about 15 meters.