# Button and LED problems

**URL:** <https://forum.arduino.cc/t/button-and-led-problems/136730>\
**Category:** LEDs and Multiplexing\
**Created:** [December 31, 2012, 4:53pm UTC](https://forum.arduino.cc/t/button-and-led-problems/136730 "2012-12-31T16:53:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 31, 2012, 4:53pm UTC](https://forum.arduino.cc/t/button-and-led-problems/136730/1 "2012-12-31T16:53:32Z")

</div>

Hi all, I've been messing around with some examples recently, and I decided to look at the "button" example so I could incorporate it into my AGV. I'm having what appears to be a static electricity problem. Whenever I come within 2 inches of the wire that connects the Arduino to the button, the LED automatically lights up. When I go to press the button, the LED turns off. And here's another weird thing that's happening--When I go to push the button with a solid wooden ruler, the LED stays off when I push the button. I'm 99.99% positive I have the wiring correct. Can anyone help me here?

---

<div class="post-metadata">

**Author:** ![fungus](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@fungus](https://forum.arduino.cc/u/fungus)\
**Post date:** [December 31, 2012, 5:13pm UTC](https://forum.arduino.cc/t/button-and-led-problems/136730/2 "2012-12-31T17:13:00Z")

</div>

> sora628:  
> Hi all, I've been messing around with some examples recently, and I decided to look at the "button" example so I could incorporate it into my AGV. I'm having what appears to be a static electricity problem. Whenever I come within 2 inches of the wire that connects the Arduino to the button, the LED automatically lights up. When I go to press the button, the LED turns off. And here's another weird thing that's happening--When I go to push the button with a solid wooden ruler, the LED stays off when I push the button. I'm 99.99% positive I have the wiring correct. Can anyone help me here?

What's your code?

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [December 31, 2012, 5:13pm UTC](https://forum.arduino.cc/t/button-and-led-problems/136730/3 "2012-12-31T17:13:47Z")

</div>

The "lights when I approach" problem sounds like a floating input. When the button is open the input pin has to be connected to ground or +5V with a resistor. If not, the input will read random static.

Check your wiring again. Compare it to the tutorials.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 31, 2012, 6:23pm UTC](https://forum.arduino.cc/t/button-and-led-problems/136730/4 "2012-12-31T18:23:21Z")

</div>

didn't realize i was missing my ground and resistor to the button....sorry about that!! that was silly of me

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 2:46am UTC](https://forum.arduino.cc/t/button-and-led-problems/136730/5 "2021-05-06T02:46:48Z")

</div>

Closed on May 6, 2021, 2:46am UTC


