13 Replies Latest reply on Aug 22, 2014 9:15 AM by peteroakes

    5V on ADC that is set to a reference of 3.3V? What happens?

    masc

      Hi,

       

      Normally you can put up to 5V to the analog-pins. Let's say you set your reference to 3.3V by connecting the 3.3V to the AREF-pin and call analogReference(EXTERNAL).

       

      What happens now if you put 5V to the pin? Will it still put out 1024 as MAX-value or will it burn the arduino?

       

      Background:

      I have a thermal sensor that has a range from 500 to about 1700 Ohm for a temperature range from 0°C to 200°C. Combined with a 1kOhm resistor I want to use this as a voltage divider for the analog-in. With these settings the voltage will be between 1.6V and 3.15V, so i can't use the full range of the ADC but by setting the reference voltage to 3.3V I can increase the useable area from about 30% to 50% which gives me a better temperature resolution (0.4°C/step instead of 0.6°C).

       

      BUT when the temperature increases above 235°C the input voltage will increase over 3.3V!

       

      Thx in advance for your answers!

        • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
          jw0752


          Hi Marc - You are correct. Any voltage above the 3.3 volts will not harm the Arduino but all values will return a 1023. Here is a link to Arduino home that covers this.

           

          http://forum.arduino.cc/index.php/topic,119109.0.html

          • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
            peteroakes

            If you read the datasheet on the ATMEGA328, it states that the Analog VCC should be the same as the Digital VCC, this would be typically 5V on an arduino and if you want max speed, it can operate way lower if needed but at ta slower speed

             

            The analog inputs should not exceed the chip supply voltage byno more than what appears to be 0.5V

              • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                jw0752

                Hi Peter- You are the expert in this area as far as I am concerned. Doesn't the use of the analogReference() function allow one to set the ADC to a shorter domain thus giving a better resolution? I don't think that Marc expects to have an input to the analog pin on the UNO greater than 3.3V. Therefore he wanted the 1023 points of resolution to be between 0 volts and 3.3 volts. His concern was that since a voltage of more than 3.3 volts is possible would it harm the UNO and what would the analogRead() return for a value. I am very new to the analogReference () function so any light you can shine on it would be appreciated.

                John

                  • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                    peteroakes

                    YYou are correct in that by setting Aref to different values you can change the equivalent full scale range, so if you make Aref to 3.3v then you will get 1023 at 3.3v, he also was concerned about when the input went up to potentially 5v or more in extreamly high temp scenarios, this is where you can not exceed supply voltage by more than 0.5v

                     

                    also you should not really use the supply as the Aref as it will produce a noisy reading and effectively loose resolution

                     

                    your available options re 1.1v Aref from internal, 5v internal but from supply so will be noisy and dependent on supply of course or an external Aref, I would suggest a low cost band gap reference chip set to say 2.048 volts to vice a nice range to the reading.

                    also there is mention of an input offset which will also reduce effective resolution, this could be removed with a simple OpAmp circuit

                      • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                        masc

                        The voltage will definitely not go over 5V so i should be fine. Would it make sense to put a 10 µF in parallel to the 3.3V and GND close to the AREF pin to smooth the signal?

                          • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                            jw0752


                            Hi Marc - Adding a capacitor will effecively average your signal and slow its response. You could experiment with different values to see if you like the effect.

                            John

                            • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                              jw0752


                              Hi Marc - I thought of one more thing of consequence. Depending on the mass of the heat source that you are measuring a capacitor could make your sensor lag the heat source. If the heater can heat up faster than the sensor can register, your heat will oscillate between a peak high and a peak low as the sensor chases the actual temperature and over compensates. This is where the experimentation will come in. If your heat source is high mass this will be less of a problem as the sensor and circuit will be able to keep up.

                              John

                                • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                                  masc

                                  well, I didn't think about that. I think i will just leave the capacitor out. I don't have the heat source yet (should arrive tomorrow) so I couldn't do any measurements.yet. Either way I won't react on every measured value. I will always average over the last X measurement. X depends on the heating speed of the source. I will have to do some experiments there.

                                  Another point is the way of controling the source. Basically I aim for a temp-range from 160°C to 200°C.  I think about driving the MOSFET with a PWM-signal. The arduino PWM is rated at 490 or 980 Hz. This should be slow enough because even with 980Hz and a PMW-rate of 1% one pulse is about 10 µs long and all timings of the MOSFET are rated in low ns. I don't know exactly how the MOSFET will distort the signal, but because it's a simple heating coil, I think that the output should still be some kind of PWM-signal but maybe not as sqare as directly from the arduino. By that I could put the source in an "always on"-state, providing just enough heat to keep the temperature.

                                  Hmm. I think of something like that. At first heating up to a certain base level, maybe 160°. From that point on I map the temp-difference to the PWM-rate. HIgh distance => high rate. This should slow down the heating rate, the closer I get to the target value of maybe 180°.  I think this could avoid jumping around between two values or at least decrease the range.

                                   

                                  looks like I have to check out some things when all the parts are here, but Hey! isn't it that what this is all about?

                                • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                                  jw0752

                                  Hi Marc - Sorry I misread your post and thought you were talking about putting the 10uF cap between your input and ground to stabilize the input from your sensor. The placement you originally proposed would not effect your readings as I indicated.

                                  John

                          • Re: 5V on ADC that is set to a reference of 3.3V? What happens?
                            peteroakes

                            So a couple of things

                             

                            A cap on the ARef will not slow down measurement (Assuming you are referring to putting it there to provide a bit of smoothing) it will help a bit as long as your not running anything else on the 3v3 supply it should remain stable but don't expect the best quality reading

                             

                            there is an internal Band Gap reference of 1.1V that will be better, all you would need to do it use a resistor divider to bring your analog signal into the right range and this should be more stable than the 3v3 rail

                             

                            Another option is to use an inexpensive 12Bit ADC from TI or Microchip connected via SPI or I2C if you need better resolution

                            1 of 1 people found this helpful