I’m working on a project using a Honeywell ASDXAVX015PG7A5 Pressure Sensor hooked onto the I2C bus. The bus address in hex that the datasheet says to use is 0x78, but I do not get any data from this address, so I did a quick scan to find that the device was on 0x4E.
When I read the first two bytes of the data from the sensor, I get the value 10000000 for byte 1 and 0 for byte 2. According to the data sheet, the two first bytes determine the status, and in my case it reveals that the data is ‘stale’ which means that they haven’t been updated since the last time I called for it. Also, if I let the program run for a while, it gets random fluctuations where the first and second byte both take on the value 11111111, which according to the datasheet means that there is a diagnostic condition. So clearly the data that I am receiving is not the actual pressure reading. If anyone can shed some insight as to how I can get the actual reading out of the sensor it would be very helpful.
I am connected as follows:
- pin 1(SDA) to A4 on Arduino Uno
- pin 2(SCL) to A5 on Arduino Uno
- pin 3(Ground) to GND on Arduino Uno
- pin 6(Vcc) to 5V on Arduino Uno
Here are the technical notes that I am referring to:
And here is the code that I have been using:
#define sensor 0x4E //Unique bus address
Wire.begin();//Wakes up I2C bus
void getdata(byte *a, byte *b)
//Move register pointer back to first register
Wire.requestFrom(sensor,3);//Sends content of first two registers
*a = Wire.read(); //first byte recieved stored here
*b = Wire.read(); //second byte recieved stored here
float pressure =0;
Serial.print("byte 1: ");Serial.println(aa,BIN);
Serial.print("byte 2 ");Serial.println(bb,BIN);
Any help that you guys can provide me with would be greatly appreciated.