I'm intending to hook on a BMP180 altimeter print and an AT24C256 EEprom to the I2C line of my Arduino Micro, running on 3,3V.
The EEprom requires 2 pullup resistors on the SDL and SCL line to keep the ports high, when not drawn low, right?
The I2C devices are close to one and other and close to the Arduino.
That raises some questions.
-Can I place the resistors on the Arduino's own SDA and SCL lines?
-Can I rely on the resistors on the BMP180 to do the job, so no extra resistors are necessary?
-If I was to use two or more I2C devices, all with onboard pull-up resistors, doesn't the total of the parallel resistors influence the pull-up current too much?
(I know the range in resistor values for Pullup is wide, but are there maximum ratings? Rhetoric... OF course not 0 or in the MegaOhms. Just wondering.)
The standard is a maximum of 3 mA sink current to pull the signal low. That is for the normal 100 kHz to 400 kHz I2C bus.
Every device may be able to sink more, but a manufacturer of a sensor can build a sensor that can sink only 3 mA to comply with the I2C standard.
The total pullup resistor (the lowest resistor value) can be calculated for a maximum of 3mA.
3.3V / 3mA = 1100Ω
A very high pullup value makes the I2C bus high impedance for when the signal is high. I would recommend at least 4k7 pullup resistors, but many use 10k pullup resistors.
Good: 4k7 pullup resistors at the Arduino board. No pullup resistors on modules.
Just as good: Two modules that happen to have 10k pullup resistors.
Still good: Nine modules and each one has 10k pullup resistors. You do the math
Working, but a little high impedance: Only one module with 10k pullup resistors. Extra 4k7 pullup resistors can be added.
Can you give a link to your BMP180 module, perhaps I can see the value of the pullup resistors.
Does this make sense ? Well, sometimes things are not okay.
Some manufacturers put 1k5 pullup resistors on their module, because they don't care. Some create a I2C bus with two I2C levels shifters in the signal path, that disturbs the signals too much. Some put SDA and SCL next to each other in a flat ribbon cable, never do that, crosstalk is the worst for the I2C bus.
It is possible to measure the actual sink current.
Make a sketch with Wire.begin() in setup() and nothing in the loop(). Start the sketch and measure the shortcut current from SDA to GND and the shortcut current from SCL to GND. Those are the sink currents and should not be larger than 3 mA.
Very well explained!
I’ve looked into it and I think we’re safe.
The BMP180 has internal pullup resistors of 4K7.
The second I2C device is a EEprom memory chip. I’ve intended to use the whole module, but the extra’s on the board are just the pullup resistors (of which I do not know the value).
I’ve also had some of the DIL8 chips without the board so without the pullup resistors.
So I’m planning to use one of those in the I2C line.
The EEprom and the module are on the same board (for what it’s worth), so I think the the 4K7 resistors might do the trick.
Of course, correct me if I’m wrong (of completely off, for that matter )
That should be okay.
Are you sure they are pullup resistors on the EEPROM module ? Can you measure them ? You can always measure the sink current of SDA and SCL of your whole project as I wrote before.
What else will be connected in the future ? Once you add a I2C OLED display, things might go hairy. The OLEDs have the habit to disturb the I2C bus for others. When adding many modules, I start to remove the pullup resistors from the modules. During setup() I first check of all the I2C modules are connected.
The MultiSpeed I2C Scanner is fun: Arduino/sketches/MultiSpeedI2CScanner at master · RobTillaart/Arduino · GitHub.
If 400 kHz (or more) is still good, then you can be sure that 100 kHz is okay.
I don't know if it runs on a Arduino Micro.
I think I'm OK here.
The AT24C256 EEprom is just the chip. No board with prefixt address jumpers or the mentioned Pull-ups.
You might have understood me incorrectly. The BMP180 contains the 4k7 Pull-ups.
So I attached both on a small PCB. I don't think there are going to be any more I2C devices attached to it.
I suppose the yellow and white wire are the I2C bus.
Connected to the SDA and SCL pins are two black smd resistors of “103”. Those are 10k pullup resistors.
That means the schematic is wrong :o
The “103” should be read as “ten three”. A “ten” with “three” zeros. That makes 10k.
Since you have the Arduino Micro running at 3.3V, the I2C bus voltage levels match perfectly with the BMP180. If the only pullup is 10k, it will work just fine. Maybe you could add more pullup, but if everything is close together, then there is no need to.
Did you do the match for 9 modules with 10k pullup each (just for fun) ?
The sink current will be: 2.97 mA
3.3V / 9 times 10k parallel = 3.3 / (1 / (9 * (1 / 10000) - Google Search)).
I've done some math and I got the same result.
The max sink current for Pull up was 3mA, which I recall you mentioning.
So I guess your point would be that the max of devices containing 10K pull-up resistors would be 9.
In my case, it is somewhat the other way around. I have more devices, namely 2, but only one contains the pull-up resistors.
Seriously, it might be 10K, but it is well within the specs of the max pull-up current.
Thanks for helping me out here... I have zero experience with digging into I2C stuff.