super newb question: why 2 ground pins on nano?

After doing a few "hello World" apps with a breadboard and some LEDs and various ICs, I went ahead and started to play with the nano that came in last week.

I was able to upload sketches, write some basic programs (like one that made the built-in led blink faster and faster, or slower and slower over time, and etc.)

Then I tried to do the "Hello World" test using just D13 pin, but no luck (at first it wasn't working at all, then I was obviously doing something wrong, because the LED on pin13 would light up when the built in led on 13 was off, and vice versa. Today I took another stab at it after I got some more LEDs and a new breadboard, and then realized there are actually 2 ground pins on the nano. I had been using the one on the right side (above the 5v on the side with all the analog pins). I used the one on the left, and everything was solved.

I'm sure there is a really easy and obvious answer as to why there are 2 pins (and why/how they act differently). Instead of making assumptions, I figured I would ask here :-[

Thanks in advance for your patience and understanding :sunglasses:

There are 2 ground pins on the atmega168 itself. If you look at the schematic at the bottom of the attached link you will see both ground pins go to ... well ... ground ;D.

It really should not matter which ground pin you use as they both go to the same ground source, in this case the ground connection in the usb cable.

I'm sure there is a really easy and obvious answer as to why there are 2 pins

There are often multiple ground pins in a system because the ground carries the return current from all the other pins. Therefore putting two or more in parallel reduces the resistance and hence power loss / voltage drop of the contacts.

1 Like

And there are actually three, the third is next to pin 13. I think the convenience of connecting multiple ground wires when breadboarding is the main reason.

There also might be connections to ground on the underside of the IC. I know the MLF package has a 3mm x 3mm ground pad on the underside, but I'm not sure about the larger TQFP that the Nano uses.

Of course none of this explains why the original poster is apparently getting different behavior from the two ground pins... They really should all be conected to the same ground, so if you really do see different behavior something very strange is going on.

  • Ben

It really should not matter which ground pin you use as they both go to the same ground source, in this case the ground connection in the usb cable.

ah, but there lies the confusion - my Hello World program would only work using the GND pin on the left (pin4) (with all the digital pins) and acted unexpectedly using the groundpin on the top right (pin29) (above the analog pins). Unexpected as in it would light up when it should be off, and it would go off when it should be on.. but even when it was off (the loose LED on a breadboard) the nano's built in LED13 looked like it was still getting a current, albeit very weak - because i could see the onboard LED trying to light up.

edit: after reading all the replies, im guessing i had something else weird going on, I'll try again today and see if I can reproduce the problem. If so, i'll take some pics / video for example.

Do you have a multimeter? If so, can you confirm that the two pins you're using for ground are indeed on the same net?

unfort, no time to hack around again until this weekend, but I will most certainly pick up a digital multimeter by then as well.

Thanks again for the replies thus far. I'll post when I have updates!

Had some extra time, and verified I was in fact doing something wrong (i was using the pin above ground, the VIN). Unfortunately, after I got my Hello World working with a separate LED, I tried to upload a new sketch and got the dreaded avrdude error... so I added a reply to the thread, and am at sort of a standstill until I figure this out.

Thanks again!

Make very very sure you're using the pin you think you are. I had exactly the same problem and realised I had wired to the wrong pins - off by one in this case. On the nano, the top left is VIN, not ground as I had thought. This resulted in my LED being doing the opposite of what I expected.

Hope this helps.

EDIT: Ah, you figured the same thing out yourself in the post above. Just realised. Maybe me repeating it will help :wink:

Graham