Arduino Mega 2560 ground pin short-circuiting?

Hey, I am really new to this so keep things simple if possible, but I'm having a strange problem with a simple circuit. What I've narrowed the problem down to is this:

I have a potentiometer connected so that a 5v pin goes to the middle terminal, one of the side terminals goes to Analog In pin A0, and the other leg goes to a ground pin. Basically, whenever I turn the pot.'s shaft so that close to 0v are going into pin A0, and thus close to 5v are going to the ground pin, the lights on the Arduino dim or shutoff and it smells like something's burning. This exact circuit worked a week ago perfectly, but now it does this and it appears the Arduino stops running its code, or at least stops looping the loop().

Why is this happening? Am I putting too much current into the ground pin? Why was it working before, but not now?
Thanks!

llamamama:
I have a potentiometer connected so that a 5v pin goes to the middle terminal, one of the side terminals goes to Analog In pin A0, and the other leg goes to a ground pin.

Wrong connections!

CENTER/WIPER goes to A0
The ends go to +5V and Ground.

You have wired it to short-circuit the +5V supply when you get to the Ground end.

oh, WOW! that was stupid! and very simple! thank you so much.

llamamama:
oh, WOW! that was stupid! and very simple! thank you so much.

Can u tell me the code that you used? The example codes that come with arduino ide, which uses pots, doesn't work with my mega, the one named ReadAnalogVoltage, the output at SerialMonitor is always 5v or 1023.

rgPaiva:

llamamama:
oh, WOW! that was stupid! and very simple! thank you so much.

Can u tell me the code that you used? The example codes that come with arduino ide, which uses pots, doesn't work with my mega, the one named ReadAnalogVoltage, the output at SerialMonitor is always 5v or 1023.

Sounds like 0V end of your pot isn't connected to Ground. That leaves you with your analog input pin connected through a variable resistor to the +5V pin so it always reads +5V.

johnwasser:

rgPaiva:

llamamama:
oh, WOW! that was stupid! and very simple! thank you so much.

Can u tell me the code that you used? The example codes that come with arduino ide, which uses pots, doesn't work with my mega, the one named ReadAnalogVoltage, the output at SerialMonitor is always 5v or 1023.

Sounds like 0V end of your pot isn't connected to Ground. That leaves you with your analog input pin connected through a variable resistor to the +5V pin so it always reads +5V.

The bad way it was connected before would have burnt-out one end of the pot's track I'm afraid...

That Smell is the "Magic Smoke"... you see talked about here...

Bob