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,
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.
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.
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.
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.