Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

Arduino Pin Noise
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Arduino Pin Noise

by jackal858 on Sat Feb 14, 2009 3:11 am

Hi All,

I am very new to the Arduino and electronics in general, but have learned a great deal already. I have run into a problem with my first large scale project, and after delving through the code, it seems that my problem is physical.

It appears that my Arduino is randomly receiving inputs into my input pins from something as simple as me grabbing a wire. I believe the pins are reacting to extremely small fluctuations, or simply noise from other input pins. Is there a standard way to combat this (whether in code or something physical to consider)?

jackal858
 
Posts: 5
Joined: Sat Jan 10, 2009 4:56 am

Re: Arduino Pin Noise

by adafruit on Sat Feb 14, 2009 11:43 am

breadboards are noisy
poorly grounded systems are noisy
sticking your hands that are excellent 60hz conductors into your circuits will make them noisy

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Arduino Pin Noise

by ziplock on Sat Feb 14, 2009 1:40 pm

Ladyada's right. The pins even carry small amounts of voltage if they're being read, as you can see if you build the Arduino Oscilloscope.
ziplock
 
Posts: 41
Joined: Fri Jan 30, 2009 7:03 pm

Re: Arduino Pin Noise

by jackal858 on Sat Feb 14, 2009 1:57 pm

Hmmm... I understand.

I'm getting noise between inputs also though. Basically, I am trying to build a Simon game with four momentary buttons, and sometimes when I push one, it will trigger another input as well. I've tried changing the inputs to various pins without success. I've just about given up on the project as I can't seem to resolve the random inputs (which kills the game obviously).

Any suggestions? Somehow ground the breadboard? Limit jumper length? Etc.?

jackal858
 
Posts: 5
Joined: Sat Jan 10, 2009 4:56 am

Re: Arduino Pin Noise

by mtbf0 on Sat Feb 14, 2009 10:14 pm

you got pull ups, (or pull downs), on those inputs? sounds like they're floating.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: Arduino Pin Noise

by jackal858 on Sun Feb 15, 2009 3:16 am

mtbf0 - I have resistors in line with the buttons which are connected to the input pins.

jackal858
 
Posts: 5
Joined: Sat Jan 10, 2009 4:56 am

Re: Arduino Pin Noise

by trialex on Sun Feb 15, 2009 6:21 am

jackal858 wrote:I have resistors in line with the buttons


Not sure exactly what you mean by this - if you really do have the resistors "in line" with the button, that will not be acting as a pull up/down resistor, and you will still get a floating pin. Or I might be reading you wrong.

Do you have this?

Code: Select all | TOGGLE FULL SIZE
GND (or +5V)  ----> Button -----> resistor ------> input pin


What you need is this

Code: Select all | TOGGLE FULL SIZE
GND  ------> Button --------> resistor --------> input pin
                          |
                          |
      +5V ---> resistor --|


This way when the button is open, the input pin is connected to +5v through the resistor. The input pin "sees" the +5V

When you push the button, there is still the connection to +5V through the resistor, and the pin is also connected to GND with less resistance. Therefore the input pin is "closer" to GND, and that is the signal it sees.

If you don't have the resistor, when the button is open, the pin doesn't "see" either GND or +5V more than the other, so it "floats" between the two. If a pin next to it gets a clear +5V or GND, the input pin can be influenced and read the same (what you might be seeing)

Ladyada's tutorial on this is here:
http://www.ladyada.net/learn/arduino/lesson5.html

If this is what you mean you already have, my apologies.
trialex
 
Posts: 189
Joined: Mon Apr 03, 2006 6:25 pm

Please be positive and constructive with your questions and comments.