What will happen, if I try to measure voltage higher than ARef? For example, my ref is 3.3V, and I try to measure 4.5V. Will it damage adc?
-
Somewhat similar to my question: https://arduino.stackexchange.com/questions/43459/can-i-connect-a-voltage-higher-that-the-1-1v-bandgap-voltage-to-an-adc-pin – Gerben May 27 '18 at 16:00
-
I am using internal VREF 1.1V and measruring throuht a 1Mohm to 3.3V and a phototransistor is connected to GND. If no light is present, I read the value ADC of 1125bit. What is far strange because the maximum is 1023 with zero included. So I would say it may not damage the chip but creates strange behaviour. A voltage divider is recommended. – Fox82 Jul 08 '20 at 19:15
2 Answers
The datasheet of the Atmega328P does not give a direct answer to this, but
Single ended channels that exceed V REF will result in codes close to 0x3FF.
(Datasheet Chapter 24.5.2)
sounds, as it would not destroy the ADC, but only result in a value very close to the maximum. I also found another side, where this is also stated. They linked to the Arduino forum, where a similar question is handled in this thread.
So all in all it should be save to provide more than the reference voltage at the ADC pins, as long as it does not exceed the supply voltage (for the UNO 5V).
As Majenko pointed out in his answer, the datasheet states, that it is safe to provide VCC+0.5V at any pin (except for reset). I just wasn't sure, if this can easily be applied to this special hardware, but it seems, that it can.
- 15,197
- 2
- 16
- 26
Contrary to what @chrisl says, the datasheet does give a direct answer to this:
- Voltage on any Pin except RESET with respect to Ground: -0.5V to VCC+0.5V
So when running at 5V anything up to 5.5V is safe - regardless of what VRef has fed into it.
The VRef just sets the range of the ADC when comparing the incoming voltage to a DAC generated voltage, so anything over the VRef voltage will just read as "max" (1023).
- 103,876
- 5
- 75
- 133
-
As I understand this, the part you quoted does not say anything about the influence of special hardware, that is connected to the pin. For example: If you provide the ADC with the internal reference voltage of 1.1V, you must not connect a different voltage to the pin, or the ADC can be destroyed due to the short. With this reasoning I assumed, that your quote is not a direct answer for this specific case. – chrisl May 27 '18 at 21:05
-
That is incorrect. The VRef is what it says - a *reference* voltage. That is all. It is *compared* to the incoming voltage through a comparator. It doesn't care if the incoming voltage is above the reference voltage. – Majenko May 27 '18 at 21:06
-
@chrisl If you have a 30cm ruler and you try and measure a piece of string that's 50cm long it doesn't break the ruler. All you can say is that it's *at least 30cm*. – Majenko May 27 '18 at 21:08
-
I hang at this sentence from chapter 24.5.2 of the Atmega328P datasheet: "If the user has a fixed voltage source connected to the AREF pin, the user may not use the other reference voltage options in the application, as they will be shorted to the external voltage." Do I misunderstand something here? – chrisl May 27 '18 at 21:10
-
@chrisl Ah, you're talking about something completely different. Nothing to do with anything the OP asked. That's just a warning against a misconfiguration whereby you can select two reference voltages at once, which is bad (and poor design on Atmel's part...). – Majenko May 27 '18 at 21:13
-
Ok, I wasn't sure how reliable this statement is, when the voltage on the AREF pin matters on a misconfiguration. Something like when they have bad design there, why not also in another part on the same pin. I will edit my question to point to your answer – chrisl May 27 '18 at 21:22
-
It helps to understand how an SAR ADC works and what the role of the VRef is. – Majenko May 27 '18 at 21:23