I wonder if I have one I2C device, I need two pull up resistors on I2C lines. But if I have, say six I2C devices? Do I have to put pull up resistors on every single device I2C line, or one pair would be enough?
One pair of pull-up resistors is usually enough especially when you use external pull-ups because you can change the value depending your application e.g. distance, trace capacitance. When you use internal pull-ups, they might not be strong enough in corner cases. When you have too many pull-ups on the bus the driving transistor might get very hot.
When in doubt use an oscilloscope and look at the signal. The signal should have nice transitions and reach both high and low signal voltage.
Thank you for the explanation.
In my specific case, there will be:
It will not be used all at the same time. My guess is 10K. But, as I am here to learn... I am all ears.
It will not be used all at the same time.
Well, they are all connected at the same time.
My guess is 10K. But, as I am here to learn... I am all ears.
That is a good starting point. It will likely be fine.
The theory is simple. The pull-up and all the pin and trace capacitance create a RC circuit. More devices on the bus increase the capacitance. This makes the voltage rise slower. A smaller resistor will make the voltage rise faster.
In practice you want to find a good compromise. You need fast rise for good signals on one side but making the signal rise too fast costs energy and creates electromagnetic radiation (traces and wires are antenna). For your hobby project this does not matter too much but it could for a commercial product.
Can you give a link to all the modules that you have connected to the I2C bus ?
They have probably already pullup resistors on each module, so you might have too much pullup.
Here are nice pictures what the pullup resistors do: Gammon Forum : Electronics : Microprocessors : I2C - Two-Wire Peripheral Interface - for Arduino.