HoneyWell ABP2 Sensor is not responding

My idea is that like in the scanner sketch it worked if you first send a wrong address then the correct address.
So if you first send the wrong address in setup(), hopefully the code in loop() will work.

Otherwise I'm stumped.

I did this, is that what you meant?


#include <Arduino.h>
#include <Wire.h>


byte id = 0x28;          // I2C address
uint8_t data[7];            // Sensor output
uint8_t cmd[3] = { 0xAA, 0x00, 0x00};

double press_counts = 0;
double temp_counts = 0;
double pressure = 0;
double temperature = 0;

double outputmax = 15099494;
double outputmin = 1677722;
double pmax = 20;
double pmin = 0;

double percentage = 0;

char printBuffer[200];

void setup() {
  Serial.begin(115200);

  
  // Allow time for USB Serial but don't block forever
  unsigned long start = millis();
  while (!Serial && millis() - start < 2000);
  Wire.setClock(400000);
  Wire.begin();

  Wire.beginTransmission(0x20);
  Wire.write(cmd, 3);
  Wire.endTransmission(true);

  Serial.println(
    "\nStatus | Raw Data | Counts | %FS | Pressure | Temp"
  );
}

void loop() {

  // Send command
  Wire.beginTransmission(id);
  Wire.write(cmd, 3);
  int tmp = 10;
  tmp = Wire.endTransmission(true);
  
  delay(500);

  // Request 7 bytes
  Wire.requestFrom(id, (uint8_t)7);

  int i = 0;
  while (Wire.available() && i < 7) {
    data[i++] = Wire.read();
  }

  // Combine bytes (24‑bit values)
  press_counts = (double)(
      (uint32_t)data[3] +
      (uint32_t)data[2] * 256 +
      (uint32_t)data[1] * 65536
  );

  temp_counts = (double)(
      (uint32_t)data[6] +
      (uint32_t)data[5] * 256 +
      (uint32_t)data[4] * 65536
  );

  // Calculations
  temperature = (temp_counts * 200.0 / 16777215.0) - 50.0;
  percentage  = (press_counts / 16777215.0) * 100.0;

  pressure = ((press_counts - outputmin) * (pmax - pmin)) /
             (outputmax - outputmin) + pmin;

  // Use snprintf (works on SAMD21)
  snprintf(printBuffer, sizeof(printBuffer),
    "%02X | %02X %02X %02X | %.1f | %.3f | %.3f | %.3f %01X \n",
    data[0],
    data[1], data[2], data[3],
    press_counts,
    percentage,
    pressure,
    temperature,
    tmp
  );

  Serial.print(printBuffer);

  delay(150);
}

Without the Wire.write(cmd, 3) otherwise yes.

Nothing changed... thanks for the suggestion! Maybe its the batch of sensor I ordered :smiley:

Yes, I think you tried everything you could possibly try.

Think it is not the issue but the datasheet stated

so trying to add a delay(5) in setup() before sending anything to the device?
(as said I do not expect this to be the issue, but to test is to know)

This did sadly not help. Thanks!


This was in the box, do you think this might be critical?

Only if you have soldered to the leads.

Ok, no, thats good! My last resort is to try it in SPI instead of I2C as the DigiKey page says SPI... even though the serial number says otherwise!

Digi-Key is very often wrong, not like it used to be.
If it was SPI then you would not have got an address from the I2C scanner.

Yes, that's fair :confused: Thanks, I think I will order more and see...

If that is a genuine Honeywell part it should have the part number stamped on top.

Digi-Key used to be a dependable source of genunie parts but over the past 10-12 years or so they have gone down hill. I have received the wrong part even though the label on the bag was correct and they often post the wrong datasheets.

I would order from Mouser if they have them.

So I checked and it does have the writing... And it is the right one. I will try to order from somewhere else and I will write the conclusion here for general knowledge. This situation is quite a mystery!

modified code from post nr 1.

Could you try this snippet?

void loop()
{
// Send command
  Wire.beginTransmission(0x28);
  Wire.write(cmd, 3);
  int tmp =  Wire.endTransmission(false);  //  <<<<<<<<<<<<<<<  false iso true
  
  delay(10);  //  <<<<<<<<<<<<<< extra 5 millis...

  // Request 7 bytes
  Wire.requestFrom((uint8_t)0x28, (uint8_t)7);

  int i = 0;
  while (Wire.available() && i < 7) {
    data[i++] = Wire.read();
    Serial.println(Wire.available())
  }

...

I have tried this before, and I do get 7bytes. It's just all those bytes are 0x00

Admittedly, I only scanned the datasheet's I2C section, but why are you writing 0xAA? If you're in mode 2 or 3, you should only need to send a Read request.

As far as I read the datasheet there are two commands mentioned

  • 0xF0 == NOP
  • 0xAA == request measurement

I have not seen anything referring to mode 1, 2, or 3, which page did you see that?

@vizbig et al.

As there was no library for the I2C ABP2 sensors, I drafted an initial version based upon the datasheet only. Feel free to test, it should appear within 24 hours in the library manager and PlatformIO.

Note 1: the library is not tested with hardware, see it as work in progress.
Note 2: the library does not support SPI or analog ABP2 sensors.

I misread that! (that's what I get for only scanning quickly). I interpreted the "options" as operational modes. I've been using the Novasensor I2C pressure sensors and they have something similar to that.