I am doing a project where I need to measure temperature using lm35. I am using arduino's analog A0 to measure, I light up extra LED on an other pin while measuring. Suddenly the alarm triggers. I set the temperature to trigger an alarm when it rises to like 40 degree. It is not supposed to trigger as I haven't done anything yet.

The method I am using to measure the voltage of the lm35 is by using 5 volt as the reference.

Personally, I guess that the battery which I am using does not able to support as it consumes too much current, causing the ADC to be inccurate. Another thing worth to mention is that the same thing does not happens when I uses USB cable port.

I am a bit curious, if the battery low, shouldn't the temeprature detected be lower? But it triggers, it is mostly due to battery but why?

  • 1
    \$\begingroup\$ It's anyone's guess, get a multimeter and measure that voltage and you will have an answer. \$\endgroup\$ – Bimpelrekkie Oct 26 '15 at 9:01
  • \$\begingroup\$ I suggest use internal 2.56V as adc reference voltage to avoid this problem that caused by ADC error, absolutely. \$\endgroup\$ – HOPE Oct 26 '15 at 9:48

The LM35 produces an output that is 10mV per degree Celsius across a voltage supply range of 4V to 30V. This means it is largely unaffected by moderate drops in the 5V supply voltage.

However, if your ADC reference is the +5V supply rail and this drops a volt (due to a discharged battery) your ADC "full-scale" voltage is now 4V but the LM35 output remains the same and bingo, you get a measurement error and your MCU will think that the temperature has risen above the alarm threshold.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.