What to do with Arduino floating pins?

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.


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.

Tags:

Pins

Atmega328