Analog Input goes crazy when the laptop is plugged in

I've been perplexed lately as to why my analog inputs would sometimes go absolutely nucking futs regardless of the circuit. I found out that when I plug the power supply into my computer (Dell Vostro Windows 7) they start jumping. I can have a simple pot circuit with a pull-down, and it still does it. If I touch the usb input on the Arduino, they level out a bit. Does anyone know why this is happening and if there is a way to get around it? I can only work so long at a time till my battery runs out...

gorbulus:
I've been perplexed lately as to why my analog inputs would sometimes go absolutely nucking futs regardless of the circuit. I found out that when I plug the power supply into my computer (Dell Vostro Windows 7) they start jumping. I can have a simple pot circuit with a pull-down, and it still does it. If I touch the usb input on the Arduino, they level out a bit. Does anyone know why this is happening and if there is a way to get around it? I can only work so long at a time till my battery runs out...

Well that's a new complaint/symptom that I hadn't heard before. When powering the board via USB the PC's +5vdc becomes the boards power source and also it is the reference voltage used by the analog ADC circuitry. Perhaps your PC has lots of ripple, noise or other problems with the USB voltage it is providing. The easiest way to determine that is to try your board on another PC. You don't have to install the arduino IDE software, just run the existing sketch already installed on the board but then being powered by USB from a different PC.

Lefty

Thanks Lefty. It works fine on my desktop pc, just like it does on my laptop when I'm running off of my battery. I've also tried switching up usb cables, and playing around with the power settings on my laptop. I am curious to see if it does the same thing on another laptop, but I don't have another. I'll get my friend over here to test it out soon.

gorbulus:
Thanks Lefty. It works fine on my desktop pc, just like it does on my laptop when I'm running off of my battery. I've also tried switching up usb cables, and playing around with the power settings on my laptop. I am curious to see if it does the same thing on another laptop, but I don't have another. I'll get my friend over here to test it out soon.

Works fine on your desktop PC, check
Works fine on your laptop if board is battery powered, check
Works not fine on your laptop if board is powered from USB, check

Problem is something in your laptop when having to supply current to the arduino board.
What all do you have wired up to the board? Maybe the laptop can't supply enought current for some reason?
Not sure how you are going to be able to correct that. You may just have to get an external DC power supply for the arduino, or a larger battery with longer duration?

I'm sure an oscilliscope or maybe even a DVM could tell you something about the USB power condition from your
laptop.

Lefty

Not exactly, what I'm saying is:
Works usb on desktop
works usb when the laptop is battery powered
doesn't work usb when the laptop is plugged into a power source

It does it regardless of the circuit, whether extremely simple potentiometer circuit, or anything else

gorbulus:
Not exactly, what I'm saying is:
Works usb on desktop
works usb when the laptop is battery powered
doesn't work usb when the laptop is plugged into a power source

Got it. However that still points to power problems internal with the laptop.

It does it regardless of the circuit, whether extremely simple potentiometer circuit, or anything else

That's what I initially thought, which is why I tried adjusting power settings and switching out usb cables. I was hoping to get suggestions as to what to do about it. I've read a few things about a ground loop here power supply - Sensor reading is chaotic when Arduino is powered by laptop unplugged - Electrical Engineering Stack Exchange in the second answer. This guy had the opposite problem. Not sure what I could do about it though.

If you can't get the laptop working another workaround would be to use a 9V "wall wart" power supply to power the Arduino instead of the batteries. Not optimal, but beats buying a new laptop...

willnue

The data shows that the supply from the 5V of the USB (from the laptop) has noise.
As you were told wisely ,a scope will verify it.
Sometimes a ferrite on the supplier of the PC is not enough,and if you exchange it with a bigger one,
it chopes the variance of the AC.
A better solution will be to get a USB with isolator (Optocouplers) which will remove any interference ,
but it is not cheap.( a USB isolator)
You may have the choice to add a capacitor to the internal voltage regulator.
The Scope will show you whehter it is worth a big one or a little one. Both will be the easier
Shimon

i had a bad ground pin on a power strip - that when i plugged my laptop PS into it, i would feel a slight tickle on the case (macbook with alumin chassis) -swapping to a different plug solved it. i'm thinking that would cause some sort of issue on an arduino being powered through USB...

good luck

Thanks Johnnym, that was pretty much the problem. Apparently the outlets in my apartment aren't hooked up to ground (which is a safety issue I'll be taking up with my landlord). I took the laptop to a friends and the problem went away