Very very confused...

Hi, I've got an Atmega168 on a breadboard connected to power with only one LED attached to pin 5 (digital pin 3). I also have a 100nF capacitor across ground the +5v. Either way the program it is running should leave the LED off, but it randomly strobes.

Here's where I get confused:
if I lift said breadboard off the table...the LED goes off and stays off. Put it on...or even near the table (within maybe 8mm) and the LED starts going crazy again. It also seems to have a similar effect if I replace the table with my hand. I played with it some more, and it seems the closer my hand/table is to the pins of the atmega the more likely it is to strobe, the other side of the breadboard (where there is no micro) isn't effected.

I even tried swapping breadboards...still got the same effect.

Any ideas?

Cheers!

You meant LED and current limiting resistor, right?

Please post the code you are running.

You have a current limit resistor in series as well? If not, either the LED or the output pin will fail, and then will not turn on at all.

Post your code, otherwise we are in the dark as well...

If the code is reacting to an input, and that input is floating, it will be picking up noise from the ether and flapping between high and low.

a painted metal table will cause the same thing. The board and the table are at different potentials and the board is picking up noise (local High Power AM Radio station?) and 'displaying' it. The Clue was that the light changed when you picked it up. Likely if you use a piece of wood perhaps an inch 25.4mm thick the problem will go away.

Doc

It was a floating input, the table is wooden actually...but I expect somehow it was interacting with the input. Thanks guys!

Yeah someone else had a very similar issue with a Mega2560 and a GLCD... Turned out to be the same problem exactly...
Noise pickup on an 'un-terminated' input lead. Still a good puzzler for a while though.

Doc

Hi,

Did this happen with the simple Blink program also??

Yeah, come to think of it... the OP noted that he went to basics and still had the issue with pin "38? 39?, I really don't remember
Just a silly issue that 100k pull downs would have prevented.
Floating CMOS ports are Always a possible issue, As you Well Know.

Doc