I am currently doing a project that involved taking pressure readings from four 30psi pressure transducers.
These pressures are to be read from 4 different sections of my circuit to measure fluid dynamics of the system.
Could you please help with the code.
I would also like the code to log the data into the computer from all four sensors simultanesouly.
Thank you very much
The details of my sensors are Output: Linear voltage output 0.5V ~ 4.5V. Output 0 psi 0.5V, output 15psi 2.5V, output 30psi 4.5V.
int rawValue; // A/D readings
int offset = 51; // ~0.5volt zero pressure adjust (~30-72)
int fullScale = 819; // ~4.5volt max pressure (span) adjust (~798-840)
float pressure; // final pressure in psi
Which Arduino? For a UNO, 0.5 volts reads about 102 not 51 and full scale should be close to 920. Add a Serial.println(rawValue); after reading analog pin and increase that delay from 2 to 500 so you can see what raw value you get at zero pressure.
What are you logging to?
ezekieldinama:
int offset = 51; // ~0.5volt zero pressure adjust (~30-72)
int fullScale = 819; // ~4.5volt max pressure (span) adjust (~798-840)
How did you obtain these numbers?
though I get some readings, I doubt thier accuracy...[/quote]
Why?
[url=https://forum.arduino.cc/index.php?topic=628084.msg4252648#msg4252648]Also posted in G&C[/url].
JCA34F:
Which Arduino? For a UNO, 0.5 volts reads about 102 not 51 and full scale should be close to 920. Add a Serial.println(rawValue); after reading analog pin and increase that delay from 2 to 500 so you can see what raw value you get at zero pressure.
What are you logging to?
Thank you, it is Arduino UNO R3.
I'm logging into my computer
If zero pressure = 0.5 volts, then ADC value should be near (0.5 * 1023 / 5) = 102.
If full scale pressure = 4.5 V, (4.5 * 1023 / 5) = 920 and span (difference between full scale and zero) = 920 - 102 = 818, so: pressure = 30.0 * (rawValue - offset) / (fullScale - offset);
Never done much logging, so can't help there.