I was testing this basic switch circuit where there is a large common contact and five smaller contacts hovering above it. The large contact is connected to one of the voltage supply pins on the arduino uno, and the smaller contacts go off to analog pins. I was reading the voltage of each pin and writing to serial once a second to see what happened when I pushed the contacts together. It was obvious when there was a connection, as the voltage reading would be either 3.28 - 3.3 or 4.9 - 5 depending on which supply I used, but when a contact wasn't down, the voltage listed would range from 0.2 to 2.1. I decided to read the value of the unused analog pin and it was listing the same voltages as others. I was expecting near 0 readings. What is the reason for this? Is this to be expected, or am I wiring things incorrectly? This may be an already answered question or an overly simple question, in which case I apologize, as I was not able to find a reason for this in the forums.
Is this to be expected,
Yes, it's normal. To measure 0 you need pull-down resistor between analog input and ground. Otherwise pin called "floating " and could return any value.
Ah, thank you.