# understanding the datasheet

Model number : SSCSNBN005PDAC5

Link to the sensor and datasheet

From the data sheet i got that the output is between 5-85% of the voltage( 5V). Also, is the sensor range form - 5psi to + 5psi or 0- 5 psi. The website says 0 - 5 psi, but if i use the sensor model number it corresponds to - 5 psi to + 5 psi

U're right. Its differential +/- 5psi.
Hope its linear. Then its easy : Analog reading 102 for -5psi and 869(870) for +5psi
Since the map-function uses long.. scale up by 100, the divide result by 100.

what is the map function used for? Im new to arduino. Thx This is how ive implemented it in my source code

int nozzle1 = A0; // select the input pin for the potentiometer
int nozzle2 = A1; // select the input pin for the potentiometer

#define Vsupply 5.0
#define _10bit 1024.0
#define maxpressure 5.0
#define Pmax 5.0
#define Pmin 0.0
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}

void loop() {
// read the input on analog pin 0:
if(sensorport1>=0 && sensorport1<=51)
{
sensorport1= 51;
}
else if(sensorport1>=870 && sensorport1<=1023)
{
sensorport1= 870;
}
// read the input on analog pin 1:
if(sensorport2>=0 && sensorport2<=51)
{
sensorport2= 51;
}
else if(sensorport2>=870 && sensorport2<=1023)
{
sensorport2= 870;
}
/* Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V): for a 10 bit resolution. The pressure is in terms of psi of range 0 - 5 psi
The sensor displays output for 15-85% of the supply voltage. Relating the ADC value to the voltage:*/
float voltage = (sensorport1-sensorport2) * (Vsupply / _10bit);
// print out the value you read:

//The sensor displays output for 15-85% of the supply voltage. Relating the ADC value to the voltage:

delay( 1000);

//voltage= (0.8Vsupply)/(Pmax-Pmin)(pressure-Pmin)+ 0.10Vsupply;
float pressure = (voltage/Vsupply - 0.1)
((Pmax - Pmin)/0.8) + Pmin;

Serial.println(pressure);
}

Thesis.ino (2.76 KB)

..You got a start.
The sensor does not give you two values, but one.. Which represente the difference of the two.

Take a peek at the MAP-function
You'll fine that it takes care ot the math you need done.

If we use the same datasheet, then this could work

``````int Psensor = A0;    // select the input pin for the potentiometer

#define Pmax 500.0 // scaled up 100 times
#define Pmin -500.0

float pressure;

void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.print(" Pressure difference is ");
Serial.print (pressure,1);
Serial.println(" Pascal");
}
``````

knut_ny:
U're right. Its differential +/- 5psi.
Hope its linear. Then its easy : Analog reading 102 for -5psi and 869(870) for +5psi
Since the map-function uses long.. scale up by 100, the divide result by 100.

I got 0.85* 1024= 870 bits (5 psi)

and 0.05*1024 = 51 bits. (-5psi)

How did you get 102 bits for -5psi?