Hi, I need some help to connect a i2c 3.3V digital pressure sensor to the Arduino board.
I am using an Arduino Uno R3 board in order to acquire pressure values from the sensor. I connected the sensor to the board following the information in the datasheet (pag. 24) in the following way:
Arduino GND connected to sensor pin 1
Arduino 3.3V connected to sensor pin 2
Arduino pin A5 to sensor pin 3 (SCL)
Arduino pin A4 to sensor pin 4 (SDA)
This is the datasheet of the HSPPAD143A pressure sensor: https://www.mouser.com/datasheet/2/15/Alps_09242019_HSPPAD143A_data-1651688.pdf
I used a breadboard to implement the circuit shown in datasheet (pag.26):
I put two 3.3kOhm resistors between VDD and SCL and SDA
I put a 0.1uF Bypass capacitor between VDD and GND.
Then I used the attached code to see if the i2c connection works and to find the address of the device. But it returns "Unknown error at address 0x" for all the addresses and seems that the Arduino is not able to connect with the sensor.
Any suggestions to solve the problem?
Thank you very much!
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}