2

Altough having found a lot of documentation concerning wiring of I²C buses, I'm still not sure about the following question:

If both devices use separate power sources, is it a good idea to connect VCC/GND of those two devices?

I have two lines for SCL and SDA, connected to SCL/SDA pins on both devices A and B. The master device's VCC is connected to both lines using a pull-up resistor. Now as far as I understood, VCC/GND of the two devices should not be disconnected but I'm afraid I'd damage something if I'd connect them. As two separate power sources will never provide exactly the same voltage that would result in high currents, won't it? Or should I just connect them using some resistor to avoid high currents but provide the same voltage level?

3

The VCC lines aren't directly connected - you just have a shared data line with some voltage on it, which is always lower than VCC because of the resistor. Each device "talks" to the I2C bus by briefly connecting those lines to GND, which is common between both devices. Current is limited by the pull-up resistor, so it never gets too high. This makes it safe to directly link devices running at slightly different voltages.

  • Ok, only connecting GND sounds better to me. Tried it but it did not work yet (as in I don't receive anything). Potential difference at the pull-up resistor (1k) is only 2V - I'm wondering where the remaining 3V would go? I would have expected that there's no notable resistance on the pins in TWI-mode? Might that be a problem? – user1034081 Jun 2 '14 at 23:03
  • I2C switches the pins between GND and "high Z" which resembles being disconnected. They only affect the shared data lines when they want to send a "0" by grounding the line, otherwise they just let the pull-ups do their job. – sburlappp Jun 2 '14 at 23:14
  • Note: One device needs to be in I2C slave mode. You may find it simpler to switch to serial communications instead. – sburlappp Jun 2 '14 at 23:17
  • @sburlappp Some devices require I2C. – Anonymous Penguin Jun 2 '14 at 23:21
  • True, but he was linking two Arduinos. He may have more flexibility. – sburlappp Jun 2 '14 at 23:32
3

Here's what you need to do:

  • Leave the VINs disconnected. I'm not sure that it's a bad idea, but it is pretty much pointless. Like sburlappp said, the resistors lower the voltage between them (and reduce the current). With a resistor, it wouldn't hurt it, but there's really no need.
  • Connect the grounds directly. Here's the problem: voltage is relative; it is measured very much like gravitational potential energy. It's the difference between the amount of electricity in both parts that determines the voltage. I'm pretty sure that if you don't, with the extra power, it could fry a component. That would happen when there is a lower concentration of electrons in "ground" on one of the boards than the other. That could result in many volts being passed along to the board. I haven't had this happen to me, nor have I really heard about this happening, but I guess it is a possibility.
  • I'm not sure if I understood you correctly, but are you suggesting connecting grounds but also mentioning that that could fry a component? Or do you mean something different by connecting grounds, e.g. using one common power source? – user1034081 Jun 3 '14 at 5:14
  • 2
    @user1034081 I saying that if you don't connect the grounds there might be a possibility of something getting fried. Also, with the different voltage levels, the signals often act weird, thus it won't work if they aren't connected. There's no risk with connecting the grounds. – Anonymous Penguin Jun 3 '14 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.