Best voltage source and circuit for AREF pin on Teensy 3.1 ?

Status
Not open for further replies.

amundsen

Well-known member
Hello,

I have several flex sensors I want to connect to the Teensy's analog inputs.

I plan to use the AREF pin in order to adapt the range of the conversion to the sensor's voltage range (each sensor being inserted in a voltage divider). However I am not sure about the best solution to provide a stable reference voltage.

First, I have several possible voltage sources.

1. My circuit will include a Pololu switching step-up regulator which will provide 5V to the Teensy and to some other components.
2. The Teensy's 3.3V output.
3. An additional shunt regulator (TL431).

Would any of them be stable enough ? Which one would be the best ?

Second, as I want the possibility to adjust the voltage, I planned to feed the AREF over a voltage divider including a trimmer. Any recommendation about this ?

Thank you in advance.
 
i'd say you're looking at option #3.

(switching regulators don't make for good voltage references, and the onboard 3v3 is what the external reference defaults to).

i'm unfamiliar with TL431, so can't really help there. it looks as if it's used somewhat differently from LM4040, which are the ones i tend to use. those can simply be attached to AREF and AGND (there's a 470R resistor connecting AREF/VREFH to VDDA -- you must have come across it in the other AREF threads); as for the trimmer, Figure 18 in the TL431 datasheet might be what you're after, not sure.
 
Thanks mxxx.

I understand your argument against option #1, but not the one against #2. Anyway, the schematics you mentioned seems to be the right one indeed.
 
re #2, i was just saying that's what you'd get as the default, either VDDA (EXTERNAL) or 1.2V (INTERNAL) *. either might be ok, i guess, depending on what output range/resolution those sensors have. using an external precision reference will tend to be somewhat better/cleaner as a VREF.


* that's the relevant bits in analog.c :

Code:
#elif defined(__MK20DX256__)
	if (analog_reference_internal) {
		ADC0_SC2 = ADC_SC2_REFSEL(1); // 1.2V ref
		ADC1_SC2 = ADC_SC2_REFSEL(1); // 1.2V ref
	} else {
		ADC0_SC2 = ADC_SC2_REFSEL(0); // vcc/ext ref
		ADC1_SC2 = ADC_SC2_REFSEL(0); // vcc/ext ref
	}
 
A switching regulator's output is never a good option for a reference.

What sensor are you using ?

Depending on your sensor, either using the internal 3.3 V or an external absolute reference may be best. If the sensor generates a ratiometric output (e.g. proportional to the signal * supply voltage), then using the Teensy's 3.3 is likely best (the ADC output will then not depend on the reference value !

If it's an absolute output (e.g. a photodiode), then a external precision reference is likely best. Don't add a trimmer or voltage divider -- the leakages, errors and drift from that will exceed the accuracy enhancement you get. If you need higherresolution, then a voltage divider might work, but you will degrade absolute accuracy.
 
There's something I don't get with the Teensy's AREF pin: what the 470 ohm resistor implies. Paul Stoffregen wrote this in another thread:
Teensy 3.0 has a 470 ohm resistor between AVCC and AREF. It's meant to provide the current for your LM431 chip.

Just connect the LM431 between AREF and AGND. You do not need to provide any power or current to the LM431. The resistor that's already on Teensy 3.0 does that.

The LM431, as well has the TL431, has three pins. If I understand Paul's message correctly, only two pins of the regulator are supposed to be used. Then, which ones are used and which one is left unconnected?
 
What sensor are you using ?

Those from Flexpoint.


Depending on your sensor, either using the internal 3.3 V or an external absolute reference may be best. If the sensor generates a ratiometric output (e.g. proportional to the signal * supply voltage), then using the Teensy's 3.3 is likely best (the ADC output will then not depend on the reference value !

If it's an absolute output (e.g. a photodiode), then a external precision reference is likely best. Don't add a trimmer or voltage divider -- the leakages, errors and drift from that will exceed the accuracy enhancement you get. If you need higherresolution, then a voltage divider might work, but you will degrade absolute accuracy.

The issue is that the sensors are not completely bended, hence only a part of the 3.3 range is used. But I don't see how to use Teensy's 3.3V as reference without a voltage divider at least, otherwise what's the difference with the default EXTERNAL/VDDA reference ?
 
The 470 Ohm resistor is meant for a shunt-style diode or similarly-acting component. It allows for a relatively low cost, higher precision AREF than the 3.3V power supply that is inside the Teensy can supply by itself. AREF should also be kept in a 3.3V >= AREF >= 1.2V range, IIRC.

If you want to use a series reference or similar component, it's easy enough to find the 470 Ohm resistor and remove it. It's right next to the RTC holes. A touch with a soldering iron or a cruder approach with a right-angle wire-cutter will take care of it.

For highest precision, only two differential inputs are allegedly rated for 16 bit when used together. The rest are 13-bit (other differential pair) and 12-bit (unipolar). I'll wager an ice cream that 16-bit accuracy is only possible under the most bizarre of circumstances (i.e. a $20 front end, Teensy asleep other than ADC, massive oversampling, and so on).

That said, you'll likely be wise to use a good op-amp setup to serve a good signal to the Teensy, i.e. make it unipolar if it's bipolar, remove the source impedance problem, and so on. However, op amp setups by themselves will potentially degrade the signal. Tradeoffs are everywhere!:)
 
Last edited:
Those sensors are ratiometric -- the output is proportional to their supply voltage. By powering both the sensor and the AREF from VDDA, you get an ADC result that is independent of the actual AREF value.

You could scale amplify the sensor's output -- their design guide here gives some guidance: http://www.flexpoint.com/technicalDataSheets/electronicDesignGuide.pdf, but I suspect the accuracy/repeatibility/performance of those sensors doesn't justify adding any complexity.
 
That said, you'll likely be wise to use a good op-amp setup to serve a good signal to the Teensy, i.e. make it unipolar if it's bipolar, remove the source impedance problem, and so on. However, op amp setups by themselves will potentially degrade the signal. Tradeoffs are everywhere!:)

Yes, adding op-amps instead of providing a lower reference to the AREF seemed an obvious alternative from start but there's not much space left on my PCB for a quad-channel op-amp and all the peripheral components (currently my abilities in soldering are limited to through-hole components and DIL packages).

Thanks for the answers everyone!
 
Status
Not open for further replies.
Back
Top