Slowdown when reaging voltage - why?

Setup:

  • Laptop A: Arduino Micro (Leonardo compatible) connected, via USB
  • Laptop B: I want to measure voltage of a pin (max. 5V), relative to ground.
  • The power adapters of both laptops are plugged into the same power outlet.

Now, when I connect A2 of the Arduino to the pin on laptop B, then the Arduino's loop speed slows down by a factor of 100 or so.

Why the slow down?

My guess: Connecting A2 to laptop B's circuit somehow causes the power supply voltage of the Arduino to drop, thereby making it slow down.

On the circuit of laptop B, there are actually pins with ground and 5V. So, I could use these to power the Arduino. However, losing the USB connection to laptop A would also mean that I don't have the serial monitor anymore. Well, I could use status LEDs to show what's going on...

You should try connecting the Arduino ground to the Laptop B ground. They should be connected already through the Laptop B power adapter, Laptop A power adapter, and USB cable, but a direct connection might help.

I now used an ordinary volt meter to double check the voltages on laptop B. Interestingly, the voltage of the pin I wanted to measure was sometimes fluctuating between 0 and 5V, possibly due to a signal. I then set the volt meter to AC, and got a voltage of close to 100V AC. This is unexpected.

Unfortunately, I don't have an oscilloscope.

I think you will might find that the output voltage of the power adapters is floating with respect to electrical earth. Just because they are plugged into the same outlet does not mean that their output earths are the same.
Hence the ground of Lap A and Lap B are not the same.

So you must connect the grounds of the two laptops together.

This helps to simplify regional power supply systems, ie USA no earth pin.
Also when a laptop is connected to an external device, such as industrial controller that is earthed there will not be an earth loop to cause problems.
Don't forget when operating from internal battery the Laptop has no power earth.

The arduino speed is crystal controlled so supply voltage variations will not change CPU speed.
What could be happening is when measuring Lap B with no earth, the voltage it sees could be positive or negative and any magitude, this could have an effect reset levels, making the arduino reset intermittently. (my ten cents worth).

Tom

TomGeorge:
This helps to simplify regional power supply systems, ie USA no earth pin.

One laptop's power adapter was connected to mains via a Schuko plug. The other power adapter connects to mains via a Europlug and to the laptop via battery input (a hack because the laptop's power receptacle is broken).

making the arduino reset intermittently.

I was thinking along similar lines. Anyhow, the issue doesn't exist anymore. I have successfully finished my reverse engineering project.