Just to give you some back ground I've just started playing with arduinos in the last couple of weeks and so far really enjoying it!
currently I'm using an UNO R3 to log and maintain two long term pressure test we have in our workshop so we can minimise travel back and forth daily during this troubling period.
the uno is taking in pressure readings, logging them and it is also attached to a relay which actuates a solenoid when a certain pressure value is reached which vents off any excess pressure in the system (all of this is working great)
the issue I'm having is coding my sensor output values correctly,
I'm using a 1-5V 0-10 bar pressure sensor but at 0 volts it's reading 0 BAR when it should be reading -2ish bar
could someone please advise on the correct calcs required for this
sensor data sheet attached (please note I'm using these sensors as they tie in really nicely and simply to the test system
Please attach your code here. This is required for any kind of help...
I also think, you are multiplying the analogRead() result with a certain number and that results with 0... Therefore I guess your problem is more an arithmetical than software development kind. Still, I might be wrong and for that, we have to take a peek at your code
Btw, how do you expect a 0-10 bar pressure sensor to return a -2 as pressure value?
And last of all... did you read the datasheet yourself? It says the initial value is 0 bar. So everything is working properly...
for reference I'm a mechanical engineer, so forgive me if i come across as completely electrically inept!!!
I did read the data sheet, the sensor has a 1-5v output signal so at 1v it reads 0bar and at 5 v it reads 10bar if the sensor breaks or becomes disconnected from the circuit a negative value is displayed on the log or readout as there is no voltage going to the analog input, in larger systems it's a way of easily identifying a instrument issue opposed to a mechanical issue if that makes sense!
ah as I'm new i may have posted this in the wrong place....
initially i was using a map to scale the sensor readings correctly but that wasn't displaying the fractional values so now I'm using the following:
float sensorValue = (analogRead(A1) / 1024);
// map it to the range of the analog out:
float outputValue = (analogRead(A1) / 1024.0 * 10.0);