element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Working with temperature sensor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: markvenn
  • Date Created: 10 Jan 2015 5:22 PM Date Created
  • Views 1226 views
  • Likes 1 like
  • Comments 2 comments
  • sketch
  • temperature-sensor
  • arduino_adk
Related
Recommended

Working with temperature sensor

markvenn
markvenn
10 Jan 2015

I have been working with my Arduino Mega ADK and a nice little TO92 temp sensor, the TSIC 301. (Datasheet here) I have been playing with a very basic sketch, all it is doing at the moment is looping around "read value and display on serial"

const int IN_PIN = 0; // analogue input pin
const int DELAY = 1000; // a constant value for the delay.
int value = 0; // declare and initialise the variable for the value

void setup()
{
  Serial.begin(9600); // setup serial connection
}

void loop()
{
  value = analogRead(IN_PIN); // read the value of the sensor
  Serial.println(value); // display it in the serial monitor
  delay(DELAY); // wait 1 second then start the loop again although this can be altered easily
}

I am using this as the basis for a couple of ideas, one is to indicate high and low temperatures via LED display, maybe a "traffic light" systems that has different LEDs lit at certain temps or maybe a RGB LED would be best?(Suggestions please) Another idea is to tie this up with a stepper motor and use this sort of sketch to open and close a window in a greenhouse or similar.(All these ideas are being used as "proofs of concept" or should that be "proofs of concepts"?

I have been able to see the output value change from 78 in a normal run to 60 with an air duster blowing on it to 85 with a good  old fashioned "huff".I do not have a thermometer here to test the values, I will see if I can get hold of one to check.Apparently this can measure from -50C to +150C, (-58 to 302 to you Fahrenheit lovers :-) )

 

image

The sensor in this Fritzing image is the correct form, TO-92, with the correct polarity with 1 being gnd, 3 being 3.0V to 5.5V and 2 being the actual sensor output.I am going to be using this sketch as the basis for a function, it is nice and small and won't take up a lot of memory.(4134 bytes)

  • Sign in to reply

Top Comments

  • jw0752
    jw0752 over 10 years ago +1
    Hi Mark, Very nice job of explaining and posting your experiment. I look forward to how you will expand it. John
Parents
  • jw0752
    jw0752 over 10 years ago

    Hi Mark, Very nice job of explaining and posting your experiment. I look forward to how you will expand it.

    John

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • jw0752
    jw0752 over 10 years ago

    Hi Mark, Very nice job of explaining and posting your experiment. I look forward to how you will expand it.

    John

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • markvenn
    markvenn over 10 years ago in reply to jw0752

    Thanks John.

    I am working on a few ideas on a few bits of kit, have a look in  Beaglebone Black and Raspberry Pi areas to see what I am working on if you are interested.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube