Arduino Pin Noise

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jackal858
 
Posts: 5
Joined: Sat Jan 10, 2009 4:56 am

Arduino Pin Noise

Post by jackal858 »

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)?

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

Re: Arduino Pin Noise

Post by adafruit »

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

ziplock
 
Posts: 41
Joined: Fri Jan 30, 2009 7:03 pm

Re: Arduino Pin Noise

Post by ziplock »

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.

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

Re: Arduino Pin Noise

Post by jackal858 »

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.?

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: Arduino Pin Noise

Post by mtbf0 »

you got pull ups, (or pull downs), on those inputs? sounds like they're floating.

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

Re: Arduino Pin Noise

Post by jackal858 »

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

trialex
 
Posts: 189
Joined: Mon Apr 03, 2006 6:25 pm

Re: Arduino Pin Noise

Post by trialex »

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

GND (or +5V)  ----> Button -----> resistor ------> input pin
What you need is this

Code: Select all

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”