Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, a web toolkit designed to help citizens, conservation practitioners, municipal decision-makers, researchers, educators, and students advance knowledge and stewardship of fresh water. New to EnviroDIY? Start here

Reply To: AREF

Home Forums Mayfly Data Logger AREF Reply To: AREF

Shannon Hicks

    The AREF pin of the micro on the Mayfly is not tied to anything (except through a capacitor to ground as suggested in the ATmega datasheet), so when you use the standard analogRead(0) command, it uses the default 3.3v reference setting. If a user is more advanced and wants to use an internal reference by using certain commands, or by connecting an external reference to the AREF pin of the lefthand 20-pin header, then those options are available. However, it is extremely dangerous to adjust the AREF voltage either externally or internally if you can’t make sure that the analog pin won’t see a voltage exceeding the new reference voltage, otherwise permanent damage to the microprocessor will occur. See the Arduino page for example commands and warnings about how to do it safely. https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/

    I can’t imagine needed a finer resolution on the battery measurement though, it’s already pretty fine scale as-is on the default setting and is accurate enough to know your general battery health, plus the LiPo batteries we use have internal low-voltage cutoff protection so they will stop supplying power to the Mayfly if their voltage drops too low.