I'm running a sketch that looks for inputs to digital pins 3, 4, 5, 6, and 7. The gist of the sketch is that it's a digitalRead() from 3-7 with a Serial.println() to the monitor. The odd thing is that without any pins connected I'm seeing "0" on some and "1" on others. I there a reason some will be "0" while other are "1" without anything connected? I imagine that all pins should read "0" until voltage is detected.

Based on my limited experience I draw the conclusion that a pull-up resistor will likely resolve my problem. Thoughts?

2 Answers 2


Yep, in fact I would configure them as INPUT_PULLUP (which uses a built-in resistor), unless you are actually wiring pull up resistors of your own to them.

Also the Digital pins Tutorial has a bit more info on the modes possible.


The effect you are seeing is the result of floating pins.

Because the inputs are not at any defined voltage level and will 'follow' the voltage applied. So leaving them unconnected with no defined state will make it look as if its picking up stray signals.

Adding a pull-up resistor, or a pull-down resistor will give you a known state, the value can be anything from 4.7kohms to 100kohms. So your conclusion to use a resistor is correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.