Go Down

Topic: Honeywell barometric pressure sensor (I2C): diagnostic condition??? (Read 1 time) previous topic - next topic

sokopok

I just got a digital Honeywell barometric pressure sensor, using I2C communication (SSCSRNN1.6BA7A3). When I connect it to my arduino, I can communicate with it, but I always get an error response, although the data seems correct. I can't find any information on how to troubleshoot this, I don't even know what is going wrong.
See attached png/pdf for a wiring schematic and data sheets.
Anyone can shed some light on this?


My sketch:

#include <Wire.h>

#define SSC_PRESSURE(v)     (float(v) * 1.6 / 16383)
#define SSC_TEMPERATURE(v)  ((float(v) / 2047) * 200 - 50)

uint8_t address = 120;

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

void loop() {
 uint32_t result;
 uint8_t v1, v2, status;
 
 Wire.requestFrom(address, (uint8_t) 4);
 if(Wire.available()) {
   v1 = Wire.read();
   v2 = Wire.read();
   status = v1 >> 6;
   
   switch(status) {
   case 0:
     Serial.println("Good data.");
     break;
     
   case 1:
     Serial.println("Command mode.");
     break;
   
   case 2:
     Serial.println("Stale data.");
     break;
     
   default:
     Serial.println("Diagnostic condition encountered.");
     break;
   }

   result = (((uint32_t) (v1 & 0x3f)) << 24) | ((uint32_t) v2 << 16);
   v1 = Wire.read();
   v2 = Wire.read();
   result |= ((((uint16_t) v1) << 8) | v2) >> 5;
   
   Wire.endTransmission();
   
   Serial.print("P: ");
   Serial.println(SSC_PRESSURE(result >> 16));
   Serial.print("T: ");
   Serial.println(SSC_TEMPERATURE(result & 0x0000FFFF));
 }
   
 delay(5000);
}



And it's output:

Diagnostic condition encountered.
P: 0.97
T: 21.13

Docedison

The first link doesn't return me a valid data sheet... So any real advice is there... The device is a 3V3 bus Do you have a level shifter installed between the Arduino and the sensor. It won't work without the translation from 3V3 to 5V. There are many solutions for this issue. NXP (Phillips) has an app note that deals with this subject. I've attached it for your reading. Adafruit has a solution as well as Sparkfun.. But they are about $3.00 - 6.00 Ea this one cost me $.50 to implement (2 2N7000 Mosfets).

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

pylon

In most cases 3V3 I2C devices work well with a 5V Arduino without a level shifter. This is because 3V3 is above the 2V7 that is the (theoretical) minimum for a 5V ATmega to detect a logical high. So with the given circuit it should work, although you should change the pull-ups to 2k7, else you might damage your device or Arduino because in the communication they have to sink to much current.

Quote
Anyone can shed some light on this?


In chapter 2.4 (page 2) of the datasheet the diagnostic condition is defined. It seems that the internal EEPROM has changed for some reason. In the datasheet there's no information about how this can be corrected. You either have to live with this situation or contact Honeywell for more information.

sokopok

Thanks for the reply. I'm quite new to electronics, so basically I'm just messing around, reading datasheets and trying to get things to work from there.

1. I thought that using pullups to 3.3V (instead of 5V) were enough to make this work, as can be seen in the attached schematic. 
2. About the 2K7 resistor: I started out with a 5.xK resistor, with the same results. In the datasheet it said to use 1K resistors... So if I just use higher value resistors, will I damage the chip?
3. I also have 2 other honeywell sensors (humidity, and plain temperature, both also 3.3V), they both work flawlessly, so I suppose the pressure sensor is more sensitive to this...

I reuploaded the datasheet.

pylon

Quote
1. I thought that using pullups to 3.3V (instead of 5V) were enough to make this work, as can be seen in the attached schematic. 


This is a correct assumption in most cases.

Quote
2. About the 2K7 resistor: I started out with a 5.xK resistor, with the same results. In the datasheet it said to use 1K resistors... So if I just use higher value resistors, will I damage the chip?


1k is the absolute minimum resistor value for a 3V system (according to the I2C specification), so it's too small for a 3V3. Although most devices probably work under such circumstances you cannot really expect it.

Are your values correct? Have  you checked that? If you you probably can just ignore the status value of diagnostic condition.

Go Up