The rawReading at 1bar is 99-101 but if I translate this into voltage I get 0.89V which is to much. It should read just a little over 0.5V.
The sensor has 3 wires (+5V, GND and Signal). I connected it to the Arduino UNO: +5v sensor to the 5V arduino pin, GND to GND arduino pin and the signal to the arduino analog pin A1.
I'm not sure if this is an absolute or a differential pressure sensor. I got it basicly for free.
As you have pointed out 100/1023 * 5 = 0.489V ----> this corresponds to 1.019bar of pressure (I checked).
The senor gives an output of 0.5V to 4.5V depending on the pressure. If I use simple math to determine the gain of the sensor I get:
k=((110bar-0bar)/(4.5V-0.5V))=27.5bar/V <---- If I use this koeficient in the pressure equation I get 13.3bar of pressure in my office. That's way to high.
Should I substract the zero pressure voltage from the calculated one? But then the pressure is 0bar which is ok I guess, if it's a differential pressure sensor.
I guess its relative pressure as it has than 'open' top.
analogRead 100 ? => voltage= 0.5 (more or less)
Pressure = (voltage - .5) * 27.5 = 0 (no overpressure.. just as it should be?)
known: 0.5V gives you 100, 4.5V gives 921
then: pressure = map(analogRead(A_input),100,921,0,1600); // an int will do fine
110 bar is a hell of a pressure.. If your practical use is for pressure, say below 20 bar (<300psi),
I suggest adding an amplifier (gain 4) to get better resolution.
I understand what you did with the MAP function, but why did you choose the new range to be from 0 to 1600?
I rewrote the code and now it looks like this:
int Newanalog=map(analogRead(A1),100,921,0,1280); <---- at 110bar the reading is 1280 ( (12805/1600)+0.5V =4.5V )
float voltage=Newanalog(5/1600)+0.5; <----- at atmospheric pressure (reading is 0) U=0.5V
float pressureBar=(voltage-0.5)k; <----- at room conditions the pressure is 0bar (this is realy the differential pressure).
float pressurePa=pressureBar100000;
My measurements will be at around 50bar so I hope it will be fine. I'm building a solid fuel rocket engine as my bachelors thesis and I have to measure pressure, temperature and thrust. Temperature and thrust readings work perfectly. Pressure is the only thing that's bugging me.