 # Pressure sensor

Hi there! This is my very first post, so please, dont roast me too much!

I’ve been playing with arduinos and sensor for a little while, just for fun tho, but found out it could be useful for my job, so i decided to give it a try and make something useful. So far, ive done easy projects which had tutorials and stuff, but this new thing does not. Done with the introduction here goes my problem!

I would like to measure small pressure inside a bottle, for this purpouse im using this sensor; ABPDLNN100MG2A3, the datasheet is attached. At the end, if i want to get the pressure, ive got to put the % of the output in a lineal regression, the equation is inside the datasheet, thing is, how do i get that % of the output, as far as i know, the resolution is 14 bit, so i guess the value the sensor gives me are 14 bits, with a crappy (really crappy) code, i get the 14 bits and turn them to decimal, im sure its wrong, as the range of the sensor is 0 to 10000 Pa, and , with a few Pa (20 or so, measured with the tool we use in the lab.) it gives me the higher value (2^14), also, im not pretty sure, but its gauge sensor, so it makes the difference between the atmospheric pressure and the pressure its measuring, and i think, if theres no pressure applied , the output should be close to 0, which is not.

Heres the code (please dont laugh), ive seen other posts, with similar stuff, but i dont really understand how i can apply that here.

#include <Wire.h>

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

void loop() {

delay(1000);
Serial.print(b1);Serial.print(b2);Serial.print(b3);Serial.print(b4);Serial.print(b5);Serial.print(b6);Serial.print(b7);Serial.print(b8);Serial.print(b9);Serial.print(b10);Serial.print(b11);Serial.print(b12);Serial.print(b13);Serial.println(b4);
Serial.println(c);
delay(5000);

}
Wire.write(0);
Wire.endTransmission();
while(Wire.available() == 0);
return c;
}

Couldnt attach the file, heres the link.

Before you get too roasted. Take a read through the sticky post and particular the section on posting code and using the code tags, then edit your first post.

I think you’ve missed a mark. The bottom of page three tells you what you need to know. The value is returned in counts between 0 and 16383. Take you reading divide by 16383 and multiply by 100 to get percent.

You don’t need all that bit stuff. Also the read is for one byte (8 bits). I think it needs to read 2 bytes Wire.requestFrom(address, 2). You will need to then combine the two bytes into one integer.

How did you wire the sensor? According to the part number you have a 3.3V sensor, so connecting 5V I2C signals might damage it.

According to the I2C interface manual (seems to be identical for all Honeywell pressure sensors) you don’t have to address any register but simply read the first 4 bytes:

``````int read_pres(byte address){