user57281: I have some unused pins, should I connect them together and to the ground or leave them floating?


user63344: I saw instability with a kiosk audio player I built years ago, when I left the unused pins floating.  Once I grounded them through a 10k resistor, all was OK.  This was in a very dry environment so I suspect static was the problem.

user4143: The simplest thing to do is set them to INPUT_PULLUP.  If you want a purely hardware solution then you could connect them to GND through some resistors (10kΩ or whatever you have in that kind of order of magnitude will do).
You don't want to just tie them directly to ground, and you don't want to link them directly together - that could lead to short circuits and dead IO ports if any of the pins happened to get set as output and HIGH in software.

57281: <p>I have some unused pins, should I connect them together and to the ground or leave them floating?</p>

<p><a href="https://i.stack.imgur.com/g9Cyj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/g9Cyj.png" alt=""></a></p>
 63344: <p>I saw instability with a kiosk audio player I built years ago, when I left the unused pins floating.  Once I grounded them through a 10k resistor, all was OK.  This was in a very dry environment so I suspect static was the problem.</p>
 4143: <p>The simplest thing to do is set them to INPUT_PULLUP.  If you want a purely hardware solution then you could connect them to GND through some resistors (10kΩ or whatever you have in that kind of order of magnitude will do).</p>

<p>You don't want to just tie them directly to ground, and you don't want to link them directly together - that could lead to short circuits and dead IO ports if any of the pins happened to get set as output and HIGH in software.</p>
