Struggling with I2C Signal Integrity on ESP32 (AquaSense IoT Node) over 3m Cable Runs

Hi everyone,

I’m currently developing a project called the AquaSense IoT Node, which uses an ESP32 to monitor data from an I2C sensor. Everything works perfectly on the bench with short jumper wires, but I’ve hit a makor roadblock now that the sensor is mounted about 2–3 meters away..

I’m starting to see sporadic data corruption and occasional bus hangups where the ESP32 stops receiving any data at all. I’m powering the sensor from a stable 3.3V rail and using standard 4.7k pull-up resistors, but the increased cable capacitance seems to be destroying the signal integrity.

I’d really appreciate some help from the experts here before I consider a complete hardware redesign or switching to a different protocol like RS-485:

  1. Pull-up Values: Is 4.7k too weak for a 3-meter run? Should I try dropping down to 2.2k or even 1k to counteract the bus capacitance, or is that pushing the ESP32's sink current limits too far?

  2. Cabling: Would using shielded twisted pair (STP) help, or would the extra capacitance of the shield actually make things worse for I2C?

  3. Firmware Tweaks: Are there any "quick wins" in the ESP-IDF or Arduino core—like lowering the I2C frequency to 50kHz or enabling clock stretching—that could help with these hangups?

  4. Hardware Buffers: Has anyone here had success with I2C bus extenders/buffers like the P82B715 for these "middle-distance" runs??

I’ve spent way too many hours debugging this on the oscilloscope :/  and it feels like I'm chasing ghosts. Any pointers or real-world experiences with long-run I2C would be a huge help to get this project back on track