1

I am trying to use the Arduino Uno with the LMT86LP temperature sensor, but I am getting strange output voltages from the sensor.

I have the pins (from left to right, flat side facing forward) as VDD, OUT, and GND. VDD is connected to 5V, GND to GND, and Vout to A0 (analog pin 0). The readings from the Arduino are consistently around 360 mV but should be somewhere around 1800 mV as I measured the output of the sensor using a multimeter and got a constant 1.8 V.

Right now the code is very simple. I am just doing analogRead() and printing to the Serial Monitor.

1 Answer 1

1

The result from analogRead() is in counts of full scale, not in volts. Since you are using a 10-bit ADC, full scale is 1024.

1.8V/5V⋅1024=368.64

7
  • Ah I see, thank you. However I seem to be getting negative values for the temperature. The calculations I am doing are like so, int vin = analogRead(A0); float mV = (vin/1024.0)*5000; float tempC = (mV-500)/10; Jul 9, 2015 at 20:48
  • @user1982824: Why are you subtracting 500? Jul 9, 2015 at 20:51
  • Sorry sorry, this actually what I'm doing, voltage = reading * (5.0 / 1024); tempC = (voltage - 0.5) * 100; and I'm getting values around 12.5 celsius Jul 9, 2015 at 21:00
  • @user1982824: That equation doesn't match anything I can find in the datasheet. Jul 9, 2015 at 21:08
  • should i be using the equation T = (10.888 - sqrt((-10.888)^2 +4*.0035*(1777.3-temp))/(2*-0.00347)) + 30 Jul 9, 2015 at 21:12

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.