PaxInstruments / t400-electronics

Electronics for the Pax Instruments T400 temperature datalogger
20 stars 9 forks source link

What are the effects of input voltage on the 32u4 internal reference voltage? #43

Closed charlespax closed 9 years ago

charlespax commented 10 years ago

See https://github.com/PaxInstruments/t400-electronics/issues/44

samchoy88 commented 9 years ago

I double check on Atmega32u4 datasheet. It seem we connected the AREF to 3.3V of the regulator. It means the MCU ADC conversion is base on 3.3V as reference voltage. Otherwise, I should connect the AREF to a filter capacitor only and software required to set register using 2.56 internal reference. image

image

Should I disconnect the AREF to 3.3V?

charlespax commented 9 years ago

I was incorrect in my understanding that the AREF is different from the 2.56 V internal reference and they can be used independently. It seems we can select between INTERNAL or AVcc in software. That's probably better than AVcc being hard-wired to VREF. I think you're right and we should hook AREF to a capacitor. @cibomahto what do you think? It affects the software, so I don't want to make a change unless you give the okay.

screen shot 2015-01-15 at 23 51 00

The idea on the table is to use the internal 2.56 V internal reference to partially calibrate the AREF value. From further reading I see that it will not make things generally more accurate. See http://www.skillbank.co.uk/arduino/measure.htm and http://www.re-innovation.co.uk/web12/index.php/en/information/electronics-information/accurate-voltage-measurement

However, the internal 2.56 V internal voltage reference may be useful as a reference for measuring the battery voltage as the battery voltage drops below approximately 3.5 V. As the battery voltage decreases the MIC5219 output voltage will be affected. The problem is that the battery voltage affects the reference voltage from which we are measuring the battery voltage.

MIC5219 output V versus input V: screen shot 2015-01-15 at 23 46 25

Fromt he 32u4 datasheet: screen shot 2015-01-16 at 00 01 40

samchoy88 commented 9 years ago

Do you want me disconnect 3.3V from ARef pin and use internal 2.56V reference?

This is Rev 0.8 connection: image

charlespax commented 9 years ago

Yeah, let's do it and add the bypass cap.

charlespax commented 9 years ago

Here is the issue to address this int he firmware: https://github.com/PaxInstruments/t400-firmware/issues/21

samchoy88 commented 9 years ago

Disconnected to 3.3V image

image

charlespax commented 9 years ago

Nice. Closing issue.

samchoy88 commented 9 years ago

In Rev 0.10, the ARef Pin measured 2.508V while software selected internal voltage reference. However, the ARef Pin measured 3.269V while software selected default voltage reference. It seem the internal voltage reference has high tolerance then using default voltage reference.

charlespax commented 9 years ago

@samchoy88 I don't understand what you mean. The internal voltage reference of the ATmega32U4 has a 2.56 V nominal voltage.

samchoy88 commented 9 years ago

As the Reference voltage is critical for calculating the VBAT voltage value. I expect using internal 2.56V voltage reference. and calculate the VBAT level by ADC x 2.56V / 1023. However, I found the VBAT value does not match with measuring point.

After checking the circuit and ARef pin, the internal voltage reference only supply 2.508V and causing incorrect result in calculation.