I2C protocol - Common power supply mandatory?

Hello,

I'm using a I2C protocol between 2 boards. The power supply to be used is not clear in many websites, Arduino website included. Sometimes we can see a wire between the GNB pins and nothing more. Sometimes, we can see that the power supply must be common.

So, what is the truth? Why the power supply must be common?

You don't need a common power supply, but you certainly do need to have a common GND.

The GND is what provides the reference point for each board to determine whether signals are at zero or one (or any other level) - without a common reference, that won't work.

But the power supplies can be different - just beware of leakage if one is turned off while another is still on ...

Addenda

Sometimes you might appear to get away without a specific GND link - but it needs to be provided somehow; eg,

1 Like

and not just I2C - any single-ended signal needs a common reference; eg, UART, SPI, etc ...

1 Like

Thanks for your quick, and very useful, reply.

1 Like

Is it the same if I2C is used with 2 boards without USB, not a board and a sensor?

See Post #4 - it applies to any single-ended signal needs a common reference

1 Like

A simple example: Connect a light bulb to a battery, with only one wire. Does it lit? There's your answer.

1 Like

We can power 2 boards with, for each one, 2 independant wires, 2 independant power supplies.

To add confusion: It's possible to not have any electrical connection whatsoever - with optocouplers / fiber, i.e light used as the signal.

I forgot radio.

Yes. But for the i2c communication to work, both Arduinos GND must be tied together = Common GND.

1 Like

Analogy:

You have two batteries, and one voltmeter.

To measure the voltage of one of the batteries, you have to connect both of the meter leads to both of the battery terminals.

If you connect the meter's black lead to the - of one battery, and the meter's red lead to the + of the other battery - your meter will read nothing!

However, if you link the - terminals of the two batteries together, then you can put the meter's black lead on this common "reference" connection - and use the red lead to measure either battery's + voltage.

So, when you said 'A simple example: Connect a light bulb to a battery, with only one wire. Does it lit? There's your answer.', that was a bad scorn.

So, the true answer is 'But for the i2c communication to work, both Arduinos GND must be tied together'. And it seems that's absolutely mandatory.

No, it wasn't - it is exactly the same situation!

Electricity needs a complete ciruit to flow.

EDIT

See my analogy in post #12 - @ledsyn is just using a bulb in place of the meter.

The fundamental concept is:
Higher Potential Point and Lower Potential Point.

Current always flows from higher potential point to lower potential point.

The higher potential point is usually marked as + (as you can see in Battery, Fig-1 below) and the lower potential point is marked as - (negative).

In a PCB, there is usually some flat conductive copper area which is connected with the chassis of the enclosure box, which (in turn) is connected with "earthing wire/rod" of the house/office. This flat conductive copper area of the PCB is marked as GND.

The negative side of the power supply (say: a Battery or a adopter, Fig-1 below) is usually tied/soldered with this GND-point.

If you send a signal (sending current as well) from Board-1 to Board-2, the current must return to GND-point of Board-1. This is only possible if you connect together the GND-pins of both Boards.
powerSS
Figure-1:

How do you explain that the I2C protocol is working well sometimes in my case without a common GNB? Sometimes that's work, sometimes no.

Are your both boards powered by the USB ports of PC? If yes, then the common GND is found through the GND-pin of the USB connector. In this case, the source current from Board-1 goes to PC via USB connector of Board-2 and then returns to Borad-1's GND via its USB connector. Electrically, it is a long way to trave and not a good conductive path? You need to provide a low impedance path for the current , which is done by connecting the GND-pins of the two boards together.

There are times when it can work, but you wrote it yourself Sometimes that's work, sometimes no.

if that's how you want it to work, none is stopping you.

Note that it's GND - not GNB

There must be a common connection somewhere

As I said in post #2:

Another example might be if you're using power supplies which happen to have their 0V terminals grounded via the mains lead.

Or if you're using multiple probes on a scope, the ground clips would be connected.

etc, etc, ...

1 Like

Ok, I think that I understand better from now on. I tried some configurations and it seems that's working normally when usb are connected or when GND pins are connected. So that was a little bit difficult to know what happened with several different connections.

Thanks for all the replies!

1 Like

This is why we often use the GND symbol:

image

It indicates that the things share a common connection - without implying that there is a direct wire between the two.

Addendum:

(Not I2C but, as already noted, it applies generally)

2 Likes