I am designing a PCB board with an ESP32 and multiple I2C devices on the same I2C line.
One I2C device is an RTC (Real-Time Clock) chip, which is included in my board design. I will take the chip and design the circuit myself, so it's important to note that I am not using a pre-made module. Therefore, I will add pull-up resistors for this device as needed.
The second device is the ADS115 ADc chip, which I added myself to the board. This is also not a module, and I can add pull-up resistors on my own.
Two additional ports are open to connect external I2C supported sensor modules operating at 3.3V. These modules have built-in pull-up resistors ranging from 4.7k to 10k.
I want to achieve fast communication, and I found a Texas Instruments guide for determining the minimum and maximum resistance values. The rise time should be 300 ns for effective communication, which seems to be a critical factor. However, I’m unsure about the required capacitance (Cb). The sink current should be 3 mA.
No. Check the short circuit currents on SCL and SDA not to exceed the allowed maximum. Best check all modules and remove their pullup resistors if present.
So we should place one set of pull-up resistors near ESP32 SCL and SDA pins. I will connect the RTC and ADS1115 directly to the ESP32's SCL and SDA, ensuring both have the same set of pull-up resistors.
In addition, bear in mind that the I2C bus was never intended to reach “long” distances. While others have reported success at many meters, particularly by reducing I2C clock rates, the original purpose of I2C was communication between devices within the confines of a single(sometimes quite large) PCB.
Think of I2C as an “on board” bus, not an “in the field” bus. For the latter, one would likely choose a communications bus with robust differential drivers, such as RS485.
I am one of those others. I have I2C working over about 30m with no issues. To achieve this I use a low clock rate and lower value pull up resistors. I've not done an detailed research on the limits of this approach, I suggest you experiment. It is true that I2C was not intended for long distances, but with experimentation it can be done. OK for hobby work, not sure if OK for something commercial.
From the data sheet:
2.6 Wiring Considerations and Signal Integrity
Carrying the SCL and SDA signal parallel and in close
proximity (e.g. in wires) for more than 10 cm may result in
cross talk and loss of communication. This may be
resolved by routing VDD and/or VSS between the two
SDA signals and/or using shielded cables. Furthermore,
slowing down SCL frequency will possibly improve signal
integrity. Power supply pins (VDD, VSS) must be
decoupled with a 100 nF capacitor – see next