Hello, I am working on a project where I am using HDC1080DMBR RH&T sensor integrated on a custom board.
I have some trouble getting it to work. The schematics of the circuit will be attached at the bottom of this post. Vcc is 3.3V. So I came across some "I2C scanners" which I tried but it failed to detect any device every time. The code is shown bellow.
/*
* Wire - I2C Scanner
*
* for example the WeMos D1 Mini I2C bus uses pins:
* D1 = SCL
* D2 = SDA
*/
#include <Wire.h>
const int SCLpin = 22;
const int SDApin = 21;
void setup()
{
Serial.begin(115200);
Serial.println("I2C Scanner");
Serial.println("SDA Pin = "+String(SDA));
Serial.println("SCL Pin = "+String(SCL));
Wire.begin(SDApin, SCLpin);
}
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 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(2000);
}
I set the SDA pin to 21 and SCL to 22 as shown in ESP32 datasheet. The output on serial monitor reads no devices found. I tried to setting the pin 5 to output and HIGH to pull up the resistors but it did not have any effect. Now whenever I tried to use a library to get some data, the report would be max values for RH (100) and T (125) so I am assuming all the bits are = 1.
Anyone has any idea what could be wrong here? Thanks!