The way I read that datasheet is that to get the pressure byte back from the sensor, you need to send a READ request, which is a 1 after the address. You're sending 0.
Wire.beginTransmission(addrs);
Wire.write(0); // move your register pointer back to 0
Wire.endTransmission();
Change the second line to Wire.write(1); and see what happens.
Found that in the Addressing section on page 3.
Hope this helps.
I appreciate everyone's responses !!
I have modified the code as follows and getting nothing on the Serial Monitor..
#include "Wire.h"
#define addrs 0x78 // I2C bus address
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
byte firstbyte;
byte secbyte;
Wire.beginTransmission(addrs);
Wire.write(1); // move your register pointer back to 0
Wire.endTransmission();
Wire.requestFrom(addrs, 2); // contents of your first two registers
while (Wire.available() < 2)
{}
firstbyte = Wire.read(); // Read press high byte
secbyte = Wire.read(); // Read press low byte
Serial.print("first byte ");
Serial.print(firstbyte, BIN);
Serial.print(" sec byte ");
Serial.println(secbyte, BIN);
delay(500);
}
If i change the while loop to the following below, i get this on the serial monitor " first byte 11111111 sec byte 11111111", which still isn't right ?
Wire.requestFrom(addrs, 2); // contents of your first two registers
while (Wire.available() )
{}
firstbyte = Wire.read(); // Read press high byte
secbyte = Wire.read(); // Read press low byte
I ran the below sketch Rob and it gave me nothing on the serial monitor, but i ran a newer version of the scanner dated June2012 i found on the Arduino resource page and it gave me this..
I2C Scanner
Scanning...
I2C device found at address 0x78 !
done
sparkfun or farnell sell 5V - 3.3V convertors for I2C. That should be the first step.
Then you can see if the I2C scanner on the playground sees it address.
Third step is checking if you can read the config registers.
(I have no time to dive into the datasheet now, sorry)
check the datasheet for timing (5 seconds), humidity readers need multiple seconds between readings. (DHT series have 2 seconds, but seem not as accurate)
Thanks for the advice Robert, I purchased the logic level converter and finally got it connected earlier today. I ran the I2C scanner tool on the sensor and got a hit at 0X10 address.
When i run the below code, i get the values 87,232,103,29 on the serial monitor. What i find strange is blowing gently on the sensor does not cause any data value variation, which leads me to believe its bogus data, is that a correct assumption ?