[Noisebridge-discuss] troubles with temperature probe - LM35DZ and arduino

Frantisek Apfelbeck algoldor at yahoo.com
Tue Jul 31 03:39:31 UTC 2012


Hi to all,
I have moved to testing the temperature sensor/probe LM35DZ for the experimental incubator which is now being finally in service. I have used the arduino sketch which I have found at adafruit webpage and which I posted below for the probe to get the temperature readings (in Celsius) displayed at the serial monitor. The temperature is around 50 degrees below the one measured by digital thermometer. So if I use a digital thermometer and it says it is 25.5 C, the LM35DZ tells me at serial monitor it is around -25 C (room t), when submerged in to the warm water digital thermometer shows 42C, probe -9.96C (not completely submerged, it is not water tight yet). Do you have idea how to change the script so it shows corresponding temperature? I use 5 V.


I also wonder if the sensebridge would be the place to ask in the future, because it is likely I'm going to have more questions about similar sensor and arduino related topics.

Thanks a lot for any help,

Sincerely,

 
Frantisek Algoldor Apfelbeck



	1. //TMP36 Pin Variables
	2. intsensorPin =0;//the analog pin the TMP36's Vout (sense) pin is connected to
	3. //the resolution is 10 mV / degree centigrade with a
	4. //500 mV offset to allow for negative temperatures
	5. 
	6. /*
	7. * setup() - this function runs once when you turn your Arduino on
	8. * We initialize the serial connection with the computer
	9. */
	10. voidsetup()
	11. {
	12. Serial.begin(9600);//Start the serial connection with the computer
	13. //to view the result open the serial monitor 
	14. }
	15. 
	16. voidloop()// run over and over again
	17. {
	18. //getting the voltage reading from the temperature sensor
	19. intreading =analogRead(sensorPin);
	20. 
	21. // converting that reading to voltage, for 3.3v arduino use 3.3
	22. floatvoltage =reading *5.0;
	23. voltage /=1024.0;
	24. 
	25. // print out the voltage
	26. Serial.print(voltage);Serial.println(" volts");
	27. 
	28. // now print out the temperature
	29. floattemperatureC =(voltage -0.5)*100;//converting from 10 mv per degree wit 500 mV offset
	30. //to degrees ((volatge - 500mV) times 100)
	31. Serial.print(temperatureC);Serial.println(" degrees C");
	32. 
	33. // now convert to Fahrenheight
	34. floattemperatureF =(temperatureC *9.0/5.0)+32.0;
	35. Serial.print(temperatureF);Serial.println(" degrees F");
	36. 
	37. delay(1000);//waiting a second
	38. }


biotechnologist&kvasir and hacker


http://www.frantisekapfelbeck.org


"There is no way to peace, peace is the way." Ghandi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.noisebridge.net/pipermail/noisebridge-discuss/attachments/20120730/2f407172/attachment-0002.html>


More information about the Noisebridge-discuss mailing list