KrisKasprzak
Well-known member
All,
I'm trying to read data from a pressure differential sensor I2C-based. My I2C scanner sees the device, but any public library cannot read any data. I've tried using bare minimum code to read the device ID and it returns 0. Maybe it is, but I cannot ready any other register. The datasheet as "some" c code and it appears to be pretty straight forward in reading register data. I bought 2 sensors and both do not return data, It's very possible the sensor are defective.
Datasheet
Sensor
Hardware:
Using Teensy 3.2 (it can read other I2C devices such as an accelerometer)
Using 4K7 pullups, but tried 2K2, 10K even nothing
Powering from USB and I measure 3.2 volts at the sensor
SDA on pin A4, SCL on pin A5
Serial monitor Results
Sensor initialization OK
Reading register (0): 0
My goals are to connect this to a pitot tube to read air velocity.
Anyone have any thoughts?
Thanks in advance.
I'm trying to read data from a pressure differential sensor I2C-based. My I2C scanner sees the device, but any public library cannot read any data. I've tried using bare minimum code to read the device ID and it returns 0. Maybe it is, but I cannot ready any other register. The datasheet as "some" c code and it appears to be pretty straight forward in reading register data. I bought 2 sensors and both do not return data, It's very possible the sensor are defective.
Datasheet
Sensor
Hardware:
Using Teensy 3.2 (it can read other I2C devices such as an accelerometer)
Using 4K7 pullups, but tried 2K2, 10K even nothing
Powering from USB and I measure 3.2 volts at the sensor
SDA on pin A4, SCL on pin A5
Serial monitor Results
Sensor initialization OK
Reading register (0): 0
Code:
#include <Wire.h>
// i2c scanner shows this is the device address
#define SENSOR_ADDR 0x76
#define WIRE Wire
uint8_t reg = 0x00;
void setup() {
WIRE.begin();
Serial.begin(115200);
while (!Serial) {}
Serial.println("Reading sensor ID...");
WIRE.beginTransmission(SENSOR_ADDR);
WIRE.write(reg);
uint8_t error = WIRE.endTransmission(false);
if (error == 0) {
Serial.println("Sensor initialization OK");
} else {
Serial.println("Sensor initialization failed");
}
// all OK up to here
delay(500);
}
void loop() {
// get the device ID, heck try to read anything....
WIRE.beginTransmission(SENSOR_ADDR);
WIRE.write(reg);
WIRE.endTransmission(false);
WIRE.requestFrom(SENSOR_ADDR, (uint8_t)1);
uint8_t data = WIRE.read();
Serial.print("Reading register (");
Serial.print(reg);
Serial.print("): ");
Serial.println(data, HEX);
delay(5000);
}
My goals are to connect this to a pitot tube to read air velocity.
Anyone have any thoughts?
Thanks in advance.