Hi, I have a SHT31 temp/humidity sensor and want to connect it thru IIC to Lora TTGO ESP32, Somehow the ESP32 fails to read temp and humidity once the OLED is initialised. I am attaching the code which works with SDA/SCL at 21/22 pins and the OLED initialisation commented. Initializing OLED seems to put off the sensor. I guess its about the IIC already used by the OLED. Any leads or examples where SHT31 Lora ESP32 are used or any hint?
No, the entire point of i2c bus is that many devices share the same 2 Arduino pins. The devices must each have a different address on the bus, which in your circuit I'm pretty sure they will.
Please clarify, which pins is the sht31 connected to?
Hi
The SHT31 has 2 I2C addresses.
You select which address to use by its ADDR pin.
I2C address A 0x44 (default) ADDR (pin 2) connected to VSS
I2C address B 0x45 ADDR (pin 2) connected to VDD.
I suggest you run I2CScanner.ino in your project and see what address it will find.
Have you tried any of the example sketches that were installed with the Adafruit_SSD1306 library? If they do not work, disconnect the sht31 and try again.
I tried but it shows a hazy screen on oled and on the serial it shows blank. when i rst the ttgo it gives "Couldn't find SHT31". The same ttgo and i run a short Adafruit program that does not involve oled and with gpio 21 and 22 and i get temperature and humidity on the serial.
Which SHT31 is a direct connect for the Davis Instruments Advantage Pro 2 transmitter. Mine was manufactured in 2020. The humidity and temp sensor went haywire. I purchased an SHT31 board on Amazon. (Not the Davis one) Does not work. It is connected correctly. My older one was the SHT10 of which I just purchased the IC and replaced it. It worked for a few years till transmitter went haywire also.