SparkFun TMP102 Digital Temperature Sensor
#1
Posted 25 December 2010 - 09:43 AM
#4
Posted 01 January 2011 - 09:47 AM
#5
Posted 03 January 2011 - 04:29 PM
Here is a class that can be used to get the Netduino talking with the TMP102 breakout from SparkFun
Just been playing with this. Thanks for the code - saved me some time. Just a thought - wouldn't it be better if the GetTemperature method returned null if not enough data was returned rather than "0" ? Afterall, 0 degrees is within the operating range (if I've read the data sheet correctly).
Thanks again,
Mark
To be or not to be = 0xFF
Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life
Follow @nevynuk on Twitter
#6
Posted 15 November 2011 - 09:32 PM
Here is a class that can be used to get the Netduino talking with the TMP102 breakout from SparkFun (<$6).
http://www.sparkfun.com/products/9418
I imagine that this approach could be modified to use the I2CBus as well... mileage may vary. Before I forget - many thanks to all the other posters of I2C topics. Your knowledge and experience is very helpful!
Cheers,
Rick Winscot
www.quilix.com
Example_TMP102.zip 81.53KB 356 downloads
For anyone who stumbles on this as I did and wonders what happened to the precision of the temps you can get the decimals by reading the 2nd byte (buffer[1]) and then bit shifting it over 4 times (>> 4) - that gives you a value that you multiply by .0625 for the Celsius information after the decimal point.
It was also annoying to find that String.Format doesn't exist and that Math.Round doesn't work as expected either. I used ToString("") with a format specifier depending on how many places you want.
Hopefully that will save someone out there some time.
- Giuliano likes this
#7
Posted 09 January 2012 - 06:36 PM
Just been playing with this. Thanks for the code - saved me some time. Just a thought - wouldn't it be better if the GetTemperature method returned null if not enough data was returned rather than "0" ? Afterall, 0 degrees is within the operating range (if I've read the data sheet correctly).
Thanks again,
Mark
I was doing some testing over the weekend and it returns 0 eventhough there is no sensor connected to the board. So what would it be a good way to control this?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users