ESP32 cant connect to wifi if all I2C devices are connected

Hi, I have an ESP32 saola and I cant seem to be able to connect to wifi if all four of my I2C devices ( Adafruit STEMMA Soil Sensor) (Adafruit STEMMA Soil Sensor - I2C Capacitive Moisture Sensor [JST PH 2mm] : ID 4026 : $7.50 : Adafruit Industries, Unique & fun DIY electronics and kits) are connected. Somehow it works fine if its only three devices. Has anyone encountered this issue before?

Thank you!

Welcome, show schematic and code

Most probably a power problem. I'm missing your wiring diagram so we have no clue how you're powering that setup and how the things are connected.

I cannot find any information about the power usage of the soil sensors but I guess they're drawing more than the internal regulator of the Saola can drive.

When all the I2C devices are connected to the ESP32 and after the I2C scanner is run, how many I2C address are reported?


Here's the schematics.
All four devices are seen by the ESP32. it's just the wifi that wont connect if all of them are connected at first. But after the wifi is connected, I can plus all four devices and it works

A typical powering problem. Know that transmitting devices like Wifi needs significantly more power. The ESP is not a 5 volt power station. Give the Wifi a separate 5 volt power.
How is the ESP powered?

Still no answer?

Hi sorry I thought I was more clear, all four of them are showing up

It's currently powered by USB. I will try a separate power supply. Good idea

Could you past a screen shot of the I2C scanner reporting all 4 address?

Did you beef up the power supply as recommended?

Post an image of your project all wired up.

I will do that tomorrow morning yes, thank u all

Do you have pull-up resistors on the i2C line

From what I can understand the sensors already have a pull up resistor included in them

Accoring to the OP the I2C scan reports all 4 I2C devices, see post#9. If that's the case then pull up resistors are not an issue.

I think that pull ups to 5 Volts for an ESP32 could be an issue.

1 Like

Just to make double sure I retested it and it looks fine indeed:

Scanning...
I2C device found at address 0x36 !
I2C device found at address 0x37 !
I2C device found at address 0x38 !
I2C device found at address 0x39 !
done

An Image of the project, the code in code tags.

Thise sensors do not ducement as being capable of 4 I2C address as per the docs.

"
There's also two I2C address jumpers. The default address is 0x36, but you can select between 0x36 and 0x39 inclusive by shorting AD0 (to add 1 to the address) and/or AD1 (to add 2 to the address)
"

The ESP32 has 2 I2C buses, put 2 sensors on one I2C bus and the other 2 sensors on the other I2C bus. Inter-Integrated Circuit (I2C) - ESP32 - — ESP-IDF Programming Guide latest documentation

The 4 10K resistors in parallel from the sensors may be fracking up the data lines.

Especially as you're powering the sensors by 5V so the pull-up is to 5V. That alone may fry your ESP.

1 Like