My analog pin always reading 0 for LM35 temperature sensor. what would be tha issue?? same issue i am facing with LDR sensor
Hi Abhishek, if you want to be sure that your UDOO doesn't have problems, connect the analog pin once to ground, once to the 3.3. and check if values are the same you expect. Cheers! Andrea
I found that I get better accuracy if I do a dummy analogRead() of a different pin just prior to the one(s) I'm interested in, with a delay(4) in between. I'm not sure why, and the actual difference isn't that great, so if you're getting wildly varying results it's probably something else. Unconnected analog inputs seem to float at close to +3.3V (full-scale reading), at least on my boards. The short-to-ground test Andrea recommended is a good idea.
Hi Abhisnek, I am also reading temperature through an LM35. What PIN on Arduino you are using for that? @Fetcher: I can not approve you suggestion: Whatever I read in front or not, the values on Analog In are alwas the same for me.
Hi, this is how I can successfully read from LM35 Code: /* Analog attributes */ #define def_analogReference AR_DEFAULT #define def_analogReferenceVoltage 3.3 #define def_analogReadResolution 12 #define def_analogWriteResolution 8 #define LM35 A0 // the setup routine runs once when you press reset: void setup() { // set analog reference voltage analogReference(def_analogReference); // set analog read + write resolution analogReadResolution(def_analogReadResolution); analogWriteResolution(def_analogWriteResolution); pinMode(LM35, INPUT); Serial.begin(9600); } void loop() { Serial.println(analogRead(LM35)); delay(1000); }
Otherwise just check another LM35 (I had also defect once) Maybe you have a voltometer to check if gives some signals? Or just use A1-A7