Finding the Counts of an analog pressure sensor and calculating the pressure

Hey,
I am working on a project involves an analog pressure sensor connected to an Arduino through Breadboard. There is a LCD connected with the Breadboard and Arduino as well. The pressure sensor takes the pressure from the surroundings and the results are displayed on the screen.

These are the details of the pressure sensor:
Company Name: Mouser Electronics
Mouser P/N: 785-NSCDRRN005PDUNV
Description: DIP, Dual Rad Barbed Honeywell Board Mount Pressure Sensor

The Arduino Board I am using is Arduino UNO R3 Compatible Atmega328P Board.

The LCD model is 1602 16x2 Character LCD Display Module HD44780 Controller Blue/Green screen blacklight LCD1602 LCD monitor 1602 5V.

The code being used right now is as follows:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3,POSITIVE);

void setup() 
{
//analogWrite(BACKLIGHT_PIN, 255 );
lcd.begin(16,2);//Defining 16 columns and 2 rows of lcd display
lcd.backlight();//To Power ON the back light
lcd.clear();
Serial.begin(115200);
Wire.begin();
}

void loop(){

lcd.setCursor(0,0); //Defining positon to write from first row,first column.
lcd.print("Pressure: ");

//while(millis() < 25,000){
float sensorValue1 = analogRead(A0); //Read the analog port A0 and store the value in sensorValue1
//or float new_sensorValue1 = (float) sensorValue1*5.0/1023.0
float map_sensorValue1 = map(sensorValue1, 0.0, 1023.0, -150.0, 150.0);
//float constrain_sensorValue1 = constrain(map_sensorValue1, 0.0, 10.0);

//analogWrite(analogOutPin, outputValue);
analogWrite(A1, map_sensorValue1);
Serial.println(map_sensorValue1);
lcd.print(map_sensorValue1);

delay(1000);//Delay used to give a dynamic effect
//}
}

Could anyone help me with how to calculate the counts of my sensor? I tried looking it up in the data sheet but couldn’t find it anywhere. I need this for map function above. And also how do you convert that reading in counts to actual pressure readings to be displayed on the screen?

Thank you!

gohar1999:
I tried looking it up in the data sheet but couldn't find it anywhere. I need this for map function above.

BUT but... the data is there! see here:

Hey,

Thank you for your prompt response. I did look over this part of the data sheet which you sent. But this part of the data sheet does not give the counts for the pressure sensor as well as the way of calculating the pressure from the given readings. I heard every sensor has their own formula and way of calculating pressure. I would greatly appreciate if you could guide me a bit. Thank you!

gohar1999:
Hey,

Thank you for your prompt response. I did look over this part of the data sheet which you sent. But this part of the data sheet does not give the counts for the pressure sensor as well as the way of calculating the pressure from the given readings. I heard every sensor has their own formula and way of calculating pressure. I would greatly appreciate if you could guide me a bit. Thank you!

again from datasheet:

Have you ever heard of sensor 'characterization', 'experimentation' or 'calibration'?
(that's what I'm suggesting you do btw to get a formula ESPECIALLY if "every sensor has their own formula!)

Hey,
Thank you once again. I have never heard of sensor 'characterization', 'experimentation' or 'calibration'. Could you help me a bit in this regard by telling me how to do this sensor experimentation?

Sorry for the inconvenience and thank you!

gohar1999:
Hey,
Thank you once again. I have never heard of sensor 'characterization', 'experimentation' or 'calibration'. Could you help me a bit in this regard by telling me how to do this sensor experimentation?

Sorry for the inconvenience and thank you!

REALLY!!!!!

you NEVER did an EXPERIMENT at school to determine.... I don't know... the "resistance of a wire" by applying a known voltage and measuring the corresponding current for example.

you get values, plot a graph and if there is no known formula find a trend to get one!
(Excel does that for you and spits out the formula of said trendline btw!)

Same principle applies here...

plug the sensor to one of the ADC pin on your arduino and put known pressures through it and see what you get as output and plot a graph. (again from the datasheet, if seems that the formula could be as simple as y=mx+c!)

Hey,
I have done similar experiments before but never with Arduino. Thank you for such a detailed response!

The sensor has 4 ports. One port connects to the ground, one to the power supply i.e. 3.3V, one to Vout+ and one to Vout-. So where should I connect Vout+ and Vout-? Which one should be connected to the analog input pin and which one should be connected to the ADC pin?

Thank you!

gohar1999:
Hey,
I have done similar experiments before but never with Arduino. Thank you for such a detailed response!

The sensor has 4 ports. One port connects to the ground, one to the power supply i.e. 3.3V, one to Vout+ and one to Vout-. So where should I connect Vout+ and Vout-? Which one should be connected to the analog input pin and which one should be connected to the ADC pin?

Thank you!

the datasheet (again!) proposes some circuits IF you want to follow it.

OR

not sure this will work... connect each pin to an analog input (with a resistor to GND) and then subtract the 2 readings to get you Vout

OR

you could set up the ADC inputs as differential inputs (not your standard analogread)

Good luck!

Hey,
I have never set up the ADC inputs as differential inputs before. Can you explain it a bit more, if possible or refer me any useful links where I can study this from?

Thank you!

gohar1999:
Hey,
I have never set up the ADC inputs as differential inputs before. Can you explain it a bit more, if possible or refer me any useful links where I can study this from?

Thank you!

have a look at this post: