2

I'm using an LM35 temperature sensor, and it outputs 190 mV (which agrees with 19°C). I'm using an external reference voltage which I measure as 417mV. (This is set by the pin "aRefCntrl"). So I should have a reading around 467, but I get 1023, i.e. the ADC overflows. When I use the internal 1.1V reference I get a correct reading. Any ideas?

This is my code (Arduino waits for a request from the PC to send the data):

#define lm35 A0
#define aRefCtrl 10
void setup() { 
 pinMode(aRefCtrl, OUTPUT);
 digitalWrite(aRefCtrl, 0);
 analogReference(EXTERNAL);
 analogRead(lm35); // dummy read
 Serial.begin(9600); 
} 
void loop() {
 if ( Serial.available() ) {
 Serial.read(); // PC's request is a single byte
 int temperature = analogRead(lm35);
 Serial.println(temperature); 
 }
} 

follow-up on Ignacio's comment: would a decoupling capacitor do? (I can't test for the moment, I have to order some)

asked Apr 7, 2015 at 15:57
2
  • How much current is available from the reference? Commented Apr 7, 2015 at 16:01
  • @Ignacio: not much, the reference voltage comes from a 10k/1k divider on 5V. Isn't the voltage I measure at the aRef pin not the real reference voltage? Commented Apr 7, 2015 at 16:05

1 Answer 1

4

The minimum reference voltage is 1.0 V according to the atmega328 datasheet. See table 29-15. ADC Characteristics.

answered Apr 7, 2015 at 16:35
2
  • Thanks a lot! I was looking for that information in the datasheet, scanning it for all occurrences of "Aref", but it seems to appear as "Vref" :-). (Page 310, FTW.) Commented Apr 7, 2015 at 16:45
  • Hmm, Aref as in Analog Reference and Vref as in Voltage reference I think? But indeed 1.1V bandgap is a reliable (small voltage) source. Commented Apr 7, 2015 at 17:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.