Unstable readings from analog sensor on Arduino Uno when powered via USB

Hello everyone,

I’m facing an issue with unstable analog readings on my Arduino Uno. I’m using an analog sensor connected to A0. When the board is powered via USB from a laptop, the readings fluctuate significantly even when the sensor value should be stable.

I’ve tried:

  • Adding a 0.1 µF capacitor between A0 and GND
  • Using different USB cables and ports
  • Adding delay between readings and averaging values in code

The problem still persists. However, when I power the board from an external 9V adapter, the readings become much more stable.

Could this be related to USB power noise or grounding issues? What is the recommended way to stabilize analog readings in such cases?

Any advice would be appreciated

Welcome to the forum

Exactly which Arduino board and sensor are you using ?

Please confirm that you are using a UNO Breakout Carrier in your project

Yes it is due to noisy power.

What is the recommended way to stabilize analog readings in such cases?

Try putting a 10uF capacitor beween AREF and GND.
Continue to average readings.

If still not stable you will need a clean voltage reference connected to the AREF pin and select analogReference(EXTERNAL) or use a clean power source (like 9V battery) to power the board

Welcome!
When powering from the USB the ~5V has the computer noise, and what ever noise it picks up in the cable; there is not much filtering. When you power it from the external Vin (7-12V) power goes through a regulator and filters. Also note the Vref for the A/D converter is powered by the 5V on the UNO. Any changes in the 5V will be reflected in your analog readings.

There are alternatives (Fig-1):
1. External: 1.1V - 5.0V
2. Internal 1.1 V


Figure-1:

Until we get an answer to these questions then I suggest that all bets are off