Noise Introduced By USB Cable powering Arduino

I almost threw in the towel on a current bread-boarded project because I could not get its hall effect transistor to be stable. After much frustration and, ultimately, a great deal of investigation, I discovered that the problem was that I was powering the device using the USB cable while also sending out debug serial ASCII text messages over the same cable. Apparently using serial data over the same USB cable that provides power was introduced sufficient noise to destabilize the hall effect transistor.

Once I switched the project over to a standalone power supply, instead of using the USB cable, and consequentially discontinued the serial debug messages, the hall effect transistor became stable. The breadboard version is using a NANO but the final product will use a ATTiny85 and run off of a 1/2-AA battery. This bug should be of interest to anyone doing embedded system design - be careful about supplying serial data over the same cable that provides power.

You mean hall-effect sensor I think - transistors can be bipolar or field-effect, but not hall-effect.

You might have a crap USB cable with very thin power wiring. USB power from a computer or laptop is vastly noisy and not great for analog work anyway - and phone chargers vary a lot in their power quality (they are for charging batteries, not Arduino projects!).

You may find an Uno is miles better as it has lots of on-board decoupling (it has more room for this).