Pull up Resistors value for Multiple devices in Custom PCB board with ESp32

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.

I would appreciate your suggestion on using a 4.7kΩ pull-up resistor for both the SDA and SCL lines. Is this value seems suitable since we have the flexibility to design the PCB board to accommodate it.Or We should use separate pull-up resistors for all devices, which may result in decreasing total resistance because they will be in parallel.

There should only be one set of pullup resistors on the an I2C bus.
You may need to use a buffer for the off board components.

1 Like

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.

Hi, @leansolution

Yes just one set, look at it this way, to simplify it there will only be ONE device at a time using the I2C bus.

Tom.... :smiley: :+1: :coffee: :australia:

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.

Yes but now you have to consider the off board modules. How many will there be? How long will the wires be?

Two offboard modules can be connected. How much distance is not sure, but we will try to use the minimum . One sensor could be SHt20

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.

1 Like

As I said you might consider using an I2C bus buffer for the off board components.

1 Like

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

1 Like

You can have as many sets as you like. Just make sure that the total resistance is high enough for weakest device to pull the lines to ground.

With long lines it's actually better to have resistors at both end of the lines.
They then act as termination resistors, lowering standing waves.

Read the docs of all your I2C devices. Some are standard I2C (100KHz/3mA/400pF), some are FastMode(+) or higher (400KHz/30mA/4000pF).
Leo..

2 Likes

What's the point? You only need one. Putting several on a PCB like the OP is designing makes no sense.

Standard is 100kHz
Fast is 400kHz
Fast Mode plus is up to 1MHz