Assistance with i2c sensors - i2c scan finds nothing

I recently bought some sensors off Aliexpress and wanted to test them out with ESPHome. I am having no luck though with any of the i2c sensors.

I have 3 i2c sensors: SHT40 temperature/humidity, APDS-9960 gesture, and a VL53L0X time of flight. I have been connecting them to an ESP32-WROOM-32. I’ve tried all 3 sensors now (testing them separately) with various configurations and ESPHome never picks them up. The i2c scan doesn’t show any address. Whenever the scan runs it just comes back with “Found no i2c devices!”. I also tried an Arduino sketch that’s just for i2c scanning, and it wouldn’t pick up the sensors either. I have tested an 2nd ESP32 device of the same model in case the first one was broken, but that did not help either. I’ve used a multimeter to test both voltage and resistance across the connections on each sensor and everything seems correct. I get 3.3V on VCC and seem to get the same in most configurations on sda and scl, although a bit less on those where I’ve added external pull-up resistors.

I also have a TEMT6000 light sensor which does not use the i2c bus and that works perfectly fine. So my issues seem to only be with all of the i2c-based sensors.

At first I figured I got a bad sensor, but after trying all 3, I’m assuming it’s more likely that I’m doing something wrong. I’m not new to electronics and circuitry, but this is my first time in many years working on a project like this. I’m hoping I’ve made a simple mistake and someone can point me in the right direction!


More info on my configuration and pictures of the circuitry below:

In my ESPHome yaml I’ve used this to enable i2c and run a scan. I’ve tried both hardcoding the sda and scl values as well as leaving it to dynamically assign them.

i2c:
#  sda: GPIO21
#  scl: GPIO22
  scan: true

This is the Arduino sketch I used as an i2c scanner as an alternative test on each sensor: ESP32: I2C Scanner (Arduino) | Random Nerd Tutorials

This is the SHT40 temperature sensor hooked up on the breadboard (note that the USB is disconnected just because I moved this to a well lit area for pictures):




This is the product page for that sensor and from what I can tell it does have pull-up resistors on the board. I did also test it with 10k pull-up resistors on both sda and scl just in case I was wrong.
https://vi.aliexpress.com/item/1005006387484957.html

This is the VL53L0X time of flight sensor. The product page for this one is quite good and made it clear that there are pull-up resistors so I never tried this one with external ones connected.


And the product page for this sensor: https://vi.aliexpress.com/item/1005006177829793.html

Lastly, this is the APDS-9960 gesture sensor. This sensor seems a little incomplete. Looking at other versions of this sensor from Adafruit, they close 2 sets of pads on the sensor board by default. These connect the LED to power, and also enable the pull-up resistors. On this chip, these pads don’t seem to be soldered together (despite it actually showing them soldered on the product page). Because of this I started by testing this chip with external pull-up resistors. I used 4.7k resistors for both sda and scl. When this didn’t work I also tried bypassing the resistors I’d added.




And the product page: https://vi.aliexpress.com/item/1005006324270402.html

I’ll also add in a close-up of the ESP32 device I’m using:

Solder your pins.
And after that study what is pull-up.

2 Likes

@chrisjantzen What he said ^^

You won’t be able to get any meaningful connection with those pins loosely placed in the sensors’ through holes. You can literally see the massive gaps here

1 Like

Thank you both of you! I’ll try soldering the pins. I thought the connection would have been good enough for testing, but I will solder the pins then try again. I’ll also look into pull-up resistors. I think I already see the mistake you’re mentioning there.