LilyPad Temperature Sensor

Detecting temperature changes has never been easier. The MCP9700 is a small thermistor type temperature sensor. This sensor will output 0.5V at 0 degrees C, 0.75V at 25 C, and 10mV per degree C. Doing an analog to digital conversion on the signal line will allow you to establish the local ambient temperature. Detect physical touch based on body heat and ambient conditions with this small sensor.

LilyPad is a wearable e-textile technology developed by Leah Buechley and cooperatively designed by Leah and SparkFun. Each LilyPad was creatively designed to have large connecting pads to allow them to be sewn into clothing. Various input, output, power, and sensor boards are available. They're even washable!

Note: A portion of this sale is given back to Dr. Leah Buechley for continued development and education of e-textiles.

  • 20mm outer diameter
  • Thin 0.8mm PCB

LilyPad Temperature Sensor Product Help and Resources

LilyPad Temperature Sensor Hookup Guide

January 23, 2018

How to hook up the LilyPad Temperature Sensor as well as some project ideas and example code.

Example Code

To use the temperature sensor, you would need to connect it to an analog input pin. You would also be using the analogRead() http://arduino.cc/en/Reference/AnalogRead. The LilyPad development board https://www.sparkfun.com/products/11262 uses the same temperature sensor.

You can also check out the activity guide's Arduino code and examples using a LilyPad Simple Board with the LilyPad Temperature Sensor:

Or the tutorial specifically for the LilyPad Temperature Sensor breakout board:


Core Skill: DIY

Whether it's for assembling a kit, hacking an enclosure, or creating your own parts; the DIY skill is all about knowing how to use tools and the techniques associated with them.

1 DIY

Skill Level: Noob - Basic assembly is required. You may need to provide your own basic tools like a screwdriver, hammer or scissors. Power tools or custom parts are not required. Instructions will be included and easy to follow. Sewing may be required, but only with included patterns.
See all skill levels


Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

1 Programming

Skill Level: Noob - Programming will be limited to basic drag and drop interfaces like ModKit or Scratch. You won't be writing code, but you will still need to understand some basics of interfacing with hardware. If you?re just using a sensor, it's output is analog.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

1 Electrical Prototyping

Skill Level: Noob - You don't need to reference a datasheet, but you will need to know basic power requirements.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Star Machinery / about 9 years ago / 1

    Here's some code:

    const int tempSensorPin = A0;  
    int sensorValue = 0;       
    float degreesC = 0;
    
    void setup() {
      Serial.begin(9600);
    }
    
    void loop() {
      sensorValue = analogRead(tempSensorPin);
      degreesC = sensorValue/2.046 - 50.0;
    
      Serial.print("sensor = ");
      Serial.print(sensorValue);
      Serial.print("\t degrees C = ");
      Serial.println(degreesC);
    
      delay(1000);
    }
    

    I think this is correct, but I am getting fairly high temperatures, ~ 28 degrees, while the weather is more like 22. I don't have a commercial device to verify though. Here's my reasoning:

    The formula given above ("This sensor will output 0.5V at 0 degrees C, 0.75V at 25 C, and 10mV per degree C") is

    Degrees C = Voltage out x 100 - 50

    But you don't get Voltage out from the AnalogRead() function (http://arduino.cc/en/Reference/AnalogRead). If you use the default settings it maps 0-5V on to 0-1023. This combined with the previous gives the formula:

    Degrees C = analogRead() x 0.489 - 50

    or without rounding

    Degrees C = analogRead()/2.046 - 50

    • Member #819969 / about 8 years ago / 1

      Hello, I have the same issue. The correct formula seems to be

      degreesC = ((sensorValue * 0.00488) - 0.5) * 100;

      and that gives me outputs of ~60 C where of course it's not as hot, but roughly ~28C. Any solution? Thanks

  • Maca / about 9 years ago / 1

    Playing with this board, I used the manual's equation to know the temperature measurement, but it doesn't fit well. After that, I found the DS (DEV-12651) manual, and there is a similar example ... but there is a factor, when I use it, everything fit well. So now my question is about the factor=0.00488, what is it ?, is it related with the analogRead resolution?. Please, I need to understand it. I'm working with the ProtoSnap development board (DEV-11262). Thanks very much

    • Maca / about 9 years ago / 1

      I already understood... thanks (if someone read this question)

  • Could these be used to detect skin temp changes? i.e. flushing/hot flashes?

    • Unless someone's skin temperature is changing by several degrees at a time, this is not going to be sensitive enough to give you really meaningful data.

    • LAM8 / about 10 years ago / 1

      Did you find another sensor that can do this? I am looking for one. I want to detect the skin temp changes as well

  • Member #594035 / about 10 years ago / 1

    The sensitivity/accuracy of this thing is really bad, at least the one I received.

  • Member #484168 / about 11 years ago / 1

    Please provide a arduino code for this sensor that works.

    If you know of a working one please post a link

  • fillibar / about 13 years ago / 1

    Still receiving an error with the "LilyPad Temp. Sensor Sticker Sheet PDF"... 8 months now? Probably should just kill off the document link entirely.

    • fillibar / about 13 years ago / 1

      Replying to myself... Oh no... But the link is gone now. Thanks! Especially since it is included in the All sheet.

  • Member #250043 / about 13 years ago / 1

    Still get a 404 error on the Sticker Sheet PDF...

  • fillibar / about 14 years ago / 1

    Has anyone had any luck downloading the "LilyPad Temp. Sensor Sticker Sheet PDF"? Tried a few different times now and each time the file is reported as corrupted by Acrobat Reader. The "All" and other varieties of sticker sheets are working (buzzer, power, vibe, etc...).

  • devellison / about 14 years ago / 1

    So want a lilypad heater to go with this :) Even if the power requirements were ridiculous.

  • Guru232 / about 16 years ago / 1

    Is it possible to post the Eagles files for the MCP9700?

    • Guru232 / about 16 years ago / 1

      Just kidding, it's included in the standard SparkFun library. Thanks for being one step ahead!

Customer Reviews

No reviews yet.