Touching the board is causing interrupt?

I started using my Uno a few weeks ago and everything has been working great (I'm new to the Arduino products and I love this thing). I don't have all of the parts in yet that I need for my project, but I've been testing the Uno with some of the simpler example programs and utilizing some of the parts that I do have (like a serial LCD and some LEDs).

One of the first example programs that I loaded was the interrupt program that turned on the pin 13 LED. It worked great at the time, and I even modified it to to use other pins so I could use my own LEDs and everything worked as plans. I moved on to trying other things like using the serial LCD display, and that worked fine too.

But then I tried to implement both: the interrupt AND the LCD. This is where the board started to act up. At first I thought there was just something wrong with my code, because the Uno was virtually constantly transmitting data to the display before I would even put a signal into the interrupt pin. But after closer inspection, and even loading the previously working interrupt example onto the board, it seems like something is loose, fried, short circuited, or all of the above.

It is acting as if the interrupt pin is ridiculously (and I stress ridiculously) sensitive. If I just touch the board pretty much anywhere (or sometimes just put my finger close), the pin 13 LED turns on meaning it detected an interrupt (right? :-/). It seems like something with the actual ATMEGA chip is my problem as touching anywhere near the top right of it turns the LED on every time.

I have tried both the 0 and 1 interrupt pins (pins 2 and 3), and also changing the CHANGE to RISING with no luck now. I tried to be careful to make sure I never shorted anything or let things make contact with each other that weren't supposed to. Maybe it it got fried without my noticing, but every other part of the board seems to still be working correctly, except when I try to run the interrupt program.

Does anybody have any ides? Has anybody seen anything like this?

I'll appreciate any help or comments.

Just for quicker reference.. Here's the example interrupt program that is currently on my Uno

int pin = 13; volatile int state = LOW;

void setup() { pinMode(pin, OUTPUT); attachInterrupt(0, blink, CHANGE); }

void loop() { digitalWrite(pin, state); }

void blink() { state = !state; }

Make sure you enable the pullup resistor on the interrupt pin else it will “float” and be very sensitive to noise:

digitalWrite(2, HIGH); // Enable pullup on digital pin 2, interrupt pin 0

Put the above in setup()

The Quick Shield: breakout all 28 pins to quick-connect terminals

Wow. Thank you RuggedCircuits. That did it. I forgot about those good ol' pull-up resistors. I had to switch some stuff to active-low because of the pull-up, but that's ok with me.

So does this mean that it probably shouldn't have worked when I ran the interrupt program a couple weeks ago without the pull-up resistor?

Thanks again ( I thought I was going to have to order a new chip )

You always need to connect an input to something otherwise the results will be unpredictable. I have just put up a tutorial on line about this:-

So does this mean that it probably shouldn’t have worked when I ran the interrupt program a couple weeks ago without the pull-up resistor?

You never know with floating inputs…sometimes the pin right next to it is enough to keep it high or low (or make it change values), sometimes it’s just the humidity in the air.

For a nice demonstration of this effect, do an analogRead() on channel 1 with nothing connected to it, then start applying different analog values to channel 0. You’ll see channel 1 start to change towards the same value as what you apply to channel 0!

The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons

I say this is an abstraction because actually 8 inputs are read at the same time in the form of a bye

Excellent. Thanks guys for the all the help. That seems to have fixed my problem. I now have a different one, but I think it's code related so I posted in under the software section.

  • Thanks again