I need to measure an Analog signal in the range of 5-30 mV.

Naturally, using the internal default 5V reference leads to very poor measurement resolution. I would like to use the capability to use an external reference voltage of 50mV on the AREF pin (using an Agilent precision power supply)

However, when I tried this in the lab, I noticed something strange. The ADC readout on the channel remained stuck at 1023. If I used anything above 0.5V on the AREF pin, the readout on the ADC is correct, and the counts reliably go up and down when I ramp up and down the Analog input accordingly.

Any idea how to resolve my issue?

  • Please tell us what your project is and where that signal comes from. Perhaps you need an opamp or external adc. The ads1115 has a gain (only x16), that might be enough.
    – Jot
    Commented Dec 13, 2017 at 11:08

2 Answers 2


According to the datasheet (page 375) the minimum voltage you are allowed to have as a reference voltage for the ADC is 1V.


In the Arduino Mega it's possible to use differential mode between two analog pins with 10x gain (or 200x). But, the resolution is halved (-512 ... 511) as it's possible to measure negative difference. But with some precision voltage reference switching and 200x gain you might be able to archieve some precision.

The downside is those ADC channels are not supported by analogRead, you have to do it directly by setting ADMUX register (or ADMUX and ADCSRB) to desired differential channel with gain.

byte backup = ADMUX; // store the arduino settings
ADMUX = _BV(REFS1) | _BV(MUX3) | _BV(MUX0); // internal 1.1V reference, differential: ADC1+ ADC0-, gain: 10x

// there should be some delay to stabilize the voltage reference (if another one was selected)
// but it's possible to preset it by  analogReference(INTERNAL1V1); in the setup() so no delay will be needed

ADCSRA |= _BV(ADSC);  // start conversion

while ((ADCSRA & _BV(ADSC)) != 0);  // wait for conversion end (ADSC is cleared after the end by hardware)

int val = ADC; // read the result
ADMUX = backup; // restore original settings (from arduino)

In the Arduino everything else in ADC is configured and ADC is started, so just necessary changes are here. It should be working but I didn't tested it (I don't have the Arduino Mega here)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.