SparkFun TMP102 Digital Temperature Sensor - Project Showcase - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

SparkFun TMP102 Digital Temperature Sensor


  • Please log in to reply
6 replies to this topic

#1 rwinscot

rwinscot

    New Member

  • Members
  • Pip
  • 2 posts

Posted 25 December 2010 - 09:43 AM

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 Attached File  Example_TMP102.zip   81.53KB   356 downloads

#2 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 25 December 2010 - 03:28 PM

Here is a class...


Where's the beef, er uh the code? This sensor uses an I2C bus on the Netduino?

Update: Are you referring to the code mentioned here?

-Valkyrie-MT

#3 rwinscot

rwinscot

    New Member

  • Members
  • Pip
  • 2 posts

Posted 26 December 2010 - 04:22 AM

Where's the beef, er uh the code? This sensor uses an I2C bus on the Netduino?

Update: Are you referring to the code mentioned here?

-Valkyrie-MT


Sorry... link added to the first post.

R

#4 VincentA

VincentA

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts
  • LocationIndia

Posted 01 January 2011 - 09:47 AM

Hey rwinscot, I just got one of those. Your stuff works! thanks mate! Vincent

#5 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

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 omnomnomsies

omnomnomsies

    New Member

  • Members
  • Pip
  • 3 posts

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

Attached File  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 Giuliano

Giuliano

    Advanced Member

  • Members
  • PipPipPip
  • 361 posts
  • LocationSimi Valley, CA

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

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.