Using AREF on Nano Matter

I need accurate analogRead values using my Nano Matter. Even connected to a 1.5v battery, the values fluctuate. 5v pin is unstable and noisy and 3.3v pin AWFUL. Problem most likely caused by unstable 5v internal reference.
So, I need to provide an external reference voltage, and I already have much cleaner 3.152V from an AS431 in the circuit. But when I try using analogReference(EXTERNAL) I get a compiler error message “ ‘EXTERNAL’ was not declared in this scope’”.

Is there a way to use an external reference voltage with Nano Matter ?

Also, I see a ripple at about 185 khertz in several places. Could that be coming from the Nano Matter and, if so, any way to stop it ?

Hi @olehweres. These are the supported values for the argument to the analogReference function when using the Nano Matter board:

Thank you for your prompt response.

To be absolutely clear before I buy parts and modify my circuit, does this mean that if I

  1. Connect AREF pin to an external precision 1.25v reference, and

  2. Add analogReference(AR_EXTERNAL_1V25) to my sketch,

analogRead will return a value where 1.25v is mapped onto 0 to 4095; that is, 12 bit resolution

?

You might first try the internal 1.21 V band gap-based reference via analogReference(AR_INTERNAL1V2 ). This will be more convenient to use and may meet your precision requirements.

If you do chose to provide an external reference, note that the analog reference pin on the MGM240S microcontroller is not connected to the AREF pin on the Nano Matter board by default. If you want to use that pin, you must short the solder jumper on the bottom of the board that is marked "AREF" on the silkscreen:

📷

ABX00112-full-pinout.pdf by Arduino - CC BY-SA 4.0 (cropped, border added)

📷

ABX00112_03.back_1000x750.jpg by Arduino - CC BY-SA 4.0 (Cropped, rotated, annotated, border added)

Thank you for the advice, especially regarding the solder bridge needed to use an external AREF. What you are telling me really should be in the Nano Matter product brochure.

I tried the 1V2 reference; better than relying on the 5V PS, but still not very good. Basic problem is hat if you pair a 12-bit ADC with a +/-1% voltage reference, the result is 6-7 bits, not nearly good enough in an instrumentation application as in my case. Happily, Vref parts up to 12 bits are available.

Thanks for your suggestion. I have submitted a formal request on your behalf to the team at Arduino responsible for this documentation.

1% is fairly typical in multimeters. Usually it's specified as a percentage of full-scale which means that lower readings have a larger percentage error.

I couldn't find the specs but 12-bit resolution doesn't always mean 12-bit accuracy. :wink:

Most "precision" ADCs and DACs are calibrated. This can be done in software. A basic straight-line has an offset correction added or subtracted from the reading and slope correction which is a multiplication factor. Or sometimes there is multi-point calibration.

Then the is noise and drift. Noise is instability and drift is slow or low frequency instability or slowly changing errors. Depending on the application noise can sometimes be filtered. If you are measuring DC you can make a moving average to filter to average-out most of the variations. If you are reading something like audio, a sample is supposed to be at one instant in time so there's not much time to take multiple measurements and average, but sometimes it's still done. There's not much you can do about drift.

Of course, any noise/variation/drift in your reference is translated to added to noise and instability in the ADC itself.

If you need accuracy better than 0.5-1 millivolts, use the proven ADS1115