Arudino Article with mistake ??

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Arudino Article with mistake ??

Postby philippp » Mon Jan 07, 2013 4: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

phil
philippp
 
Posts: 1
Joined: Mon Jan 07, 2013 4:05 pm

Re: Arudino Article with mistake ??

Postby adafruit_support_bill » Mon Jan 07, 2013 6: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
adafruit_support_bill
 
Posts: 16617
Joined: Sat Feb 07, 2009 9:11 am


Return to Arduino

Who is online

Users browsing this forum: Google [Bot] and 8 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [113]

Raspberry Pi[81]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]