SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By edwardwg
#198493
Hello.
I have just finished building my scoreboard using an arduino uno. It is controlled by 3 buttons up,down and reset. The button box controller is linked to the scoreboard with a 25 pin D printer cable 3 metres long. My problem I am having is. when I press the up button singularly to increase the score it will go up nicely and then randomly go back to zero. If I press and hold the button down it works fine. I connected the button box directly to the scoreboard so no cables are connected and it works fine. To me it looks like its the cable but do not understand how it works with the cable and the button pressed and held down. The project was modelled on the sparkfun large digit project. I have been told that it needs a external pullup resister, but I don't know how to fit it. Any ideas what is wrong and how to fit this resister.
By paulvha
#198497
I don't understand what the real problem is, but indeed for an input signal it is always important to use pull-up and not have a floating input. In your code you set the input for button with a command like : pinMode(pin, INPUT). Change that to a command like pinMode(pin, INPUT_PULLUP). Then (most of the time) you do not need an external resistor.
By lyndon
#198498
For a 3-meter cable, I would add an external pullup resistor. The AVR internal pullups are around 100k and I'd consider that too little current for such a long cable. Try a 10k pullup to the Arduino +5V.