Electronic – Arduino ADC values change after USB disconnect

adcarduinoswitch-mode-power-supplyvoltage divider

enter image description hereI using an Arduino uno analog read function to read a voltage divider circuit for a voltage range from 0-70 VDC. On the voltage divider, I am using 2.7Kohm and 36kohm to reduce to voltage range from 0-70VDC to 0-5VDC for arduino analog input.
The circuit works fine with the USB power to the arduino, and as soon as the I disconnect the USB, and the arduino switches to the backup dual switching power supply (120 VAC to 12VDC and 5VDC), the analog values change.
The values are still steady and I dont see any garbage values, but there is a big offset between the original values and the values after disconnecting the USB power to arduino.
Can anyone comment with a solution to this? I checked multiple times and the ground is common through out the circuit.

Best Answer

Read the Atmel Datasheet for the '328

Section 28.2 cover the A/D The inputs look like this:

enter image description here

By default on the Arduino Uno the ref voltage is taken from AVCC which is the 5 V VCC used by the MCU.

The Arduino schematic is here.

You can program the unit to not use AVCC/1.1ref and feed in a more stable reference ....or fix your supply voltage.

You could also switch to the 1.1 V reference and change your input divider.