Are the GND pins of an Arduino identical to GND of its power supply? What would happen if I connected a fan as shown in the following picture:


+12V is supplied by the power supply that also powers the Arduino.
GND, however, is connected to a GND pin of the Arduino instead of the power supply.

I guess that would not work? Or are GND from the Arduino and GND from the power supply identical in this case?

If you read the accepted answer, please also note the comments below. The power consumption of the consumer (fan) is important.
&quot;Ground&quot; is just a lump of metal and each ground &quot;pin&quot; is connected to it. That includes the ground connection in the barrel jack. It's all one thing.
Wherever you connect your fan's ground to it's all ground.  That is, as long as all grounds external to the Arduino are connected, ultimately, to the Arudino.