Happy Arduino Day! Use the code ARDUINODAY on checkout and get 10% off your order on all items in stock!

Arudino Article with mistake ??
Moderators: adafruit_support_bill, adafruit

Arudino Article with mistake ??

by philippp on Mon Jan 07, 2013 5:07 pm

dear adafruit team - dear admins and arduino fans !

i have a question to article http://www.ladyada.net/make/logshield/lighttemp.html where im not sure about one thing.

in your article (Screenshot with light reading and temperature) you write that the "TEMP reading" sensor has values between 151 - 153 ...

so, lets say tempReading is 151 as a value stored in "tempReading" variable...
now we do the math's

float voltage = tempReading * aref_voltage / 1024;

151 * aref_voltage (which is 3.3 acording to the sourcecode) / 1024 gives us : 0.48662
so now voltage has the value 0.48662 ==> I cannot understand how you received 0.74 volts!!

second math operation is:

float temperatureC = (voltage - 0.5) * 100 ;
so this is (0.48662 - 0.5) * 100; which gives us -1.338 (and not 23.73 degrees....)

could you tell me if i am wrong, my maths skills are not good enough or... i simply did a mistake somewhere in my thinking ??

Thank you in advance for your reply!!
Best greets

Posts: 1
Joined: Mon Jan 07, 2013 5:05 pm

Re: Arudino Article with mistake ??

by adafruit_support_bill on Mon Jan 07, 2013 7:34 pm

The math does work for a AREF of 5v. The screen shot is apparently from a system running with a 5v AREF.
User avatar
Posts: 35850
Joined: Sat Feb 07, 2009 10:11 am