Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Can I use the AREF pin for regular analog input?

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    6

    Can I use the AREF pin for regular analog input?

    I'm using a Teensy LC and I'm going to need all the analog inputs I can get. Can I set pinMode to INPUT on the AREF pin and use analogRead on it? I don't want to mess with the reference voltage.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,301
    No. AREF can't be used as a regular analog input.

    There is a difficult and usually impractical hack to use AREF as an input, where you configure the ADC for AREF and then measure a known signal (which must be lower than whatever input you have on AREF) and then use some math to deduce what AREF must have been.

    But on top of the limited range (AREF must be higher than some other signal that's known), this requires a slow reconfig and recalibration of the ADC. The AREF pin also draws pulses of current during conversions, so it's not a proper input that samples the signal once before doing the conversion. These limitations make the AREF pin not very useful as an input, except in very unusual circumstances, like how our bed-of-nails test fixture does the verification that AREF really is connected and working.

    If you need more signals, usually a mux chip like 74HC4051 is the best way. Scroll down to "Connecting Many Buttons & Knobs/Sliders" on this page for info.

    https://www.pjrc.com/teensy/td_midi.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •