Electronic – arduino – A 4.8v reading on a loose pin 0

arduinoexpandergpioinput

I have a setup that demands that I use all my I/O's on my Arduino Uno R3 board – including the serial pins 0 and 1.

So I've initialized those pins as inputs, but when I make a reading on pin 0 it reads high although it's not connected to anything. My multimeter tells me 4.8V steadily on the pin all the time.

All my other pins I've not initialized any serial communication, and I've tried running the board on a battery (so no computer connection).

I have Adafruit's Waveshield connected to it, but as far as I'm concerned it shouldn't interfere with pin 0 in any way.

I've made a simple drawing showing the concept of what I'm doing. It's all there is to it, just the size of 12 buttons and 12 lamps. In order to get enough I/O's, I had to implement an IO expander (mcp23016) on the I2C bus, but it's the same principle as on the drawing.

So when I have everything hooked up, all seems to be good except for the pin 0 on the Arduino board. All other readings (both on the Arduino and the expander) works fine.
The weird thing is: when I measure voltage on pin 0, it gives me 4.8V; on pin 1 it gives me 1V and on the other pins it gives me 0V. So something is obviously different from the serial pins.

Are there any internal pull ups or downs on them or could it be the many 10k resistors I use? Do they need to be smaller or bigger perhaps?

Perhaps it's just a bad soldering, but I've been checking for hours and hours and I really can't see any issue on the hardware part.

concept schematic

Best Answer

If it's set as an input pin then trying to measure the voltage on it is largely unproductive unless, of course you believe it may be still set as an output - then you would need to attach a load to it to see if the voltage it is producing is "real" or just some leakage current from an unconnected input making a high impedance voltmeter show something like 4.8V.

Try connecting a 1k resistor to ground from this pin - does it still show logic 1 or perhaps it's now at logic 0.

Some IO pins will default (on some MCUs) to having an inbuilt high resistance pull-up of the order 100k and this may also be happening. This (on some MCUs) can be programmed to be (a) not there at all, (b) pull-up or (c) pull-down. I believe some MCUs can program a lower resistance or a higher resistance. Maybe this is also happening?