Making a Smart Temperature Sensor

Version 1


    Created by Charles Alba, on September 16, 2015; last modified by Tom Seaman on September 16, 2015


    Unit Summary

    The devices in our daily lives keep getting smarter, more aware of what’s happening around them.  In this hands-on unit, students learn how to build a “smart” temperature sensor that can monitor the temperature and then take action based on whether the measure exceeds a threshold or drops below a limit.  In the real world, a sensor like this might turn on an air conditioning unit when the temperature rises above 24 degrees C, or might turn on a heater if the temperature drops below 20 degrees C.  In this learning unit, students build a smart device that turns on or off an LED and/or an alarm (buzzer) when certain temperature conditions are met.  Students learn about thermistors – or temperature-dependent resistors – and build the smart device using a thermistor, an Intel® Galileo Gen 2 board, and a computer program they can manipulate.  They are challenged to make changes to the program to modify the device’s behavior.  The design can be adapted to offer utility in any number of science projects.  No prior experience with Galileo or programming is required.


    At a Glance

    • Grade: 6-8, 9-12
    • Subjects:  Science, technology & engineering
    • Topics:  Computers, electronics, temperature (science) • Higher-order thinking skills:  Analysis, experimental Inquiry
    • Key Learnings:  Coding, making, design thinking, types and uses of electronic components
    • Content type:  Unit plan
    • Time needed:  45-60 minutes
    • Prerequisites:  No prior knowledge or experience is necessary to complete the activities.
    • License:  Creative Commons Attribution-ShareAlike (CC BY SA).  Read about the license and what you can do with this material here.


    Learning Outcomes

    • Students should gain hands-on experience with of coding and computer hardware.
    • Students should acquire confidence that they can make their own tools.
    • Students should get a glimpse of the type of work engineers and computer scientists do.


    Things You Need

    We suggest students work in groups of 2-4.  This list represents the

    • The Intel® Galileo Gen 2 board
    • The Galileo’s power cable
    • A USB cable (standard USB at one end, micro-USB at the other end)
    • A Grove Starter Kit Plus – Intel IoT Edition for Intel Galileo Gen 2 and Edison
      • See figure 1 below for the list of items we’ll be using from the kit • A PC (with the Galileo IDE)



    Standards Alignment

    This unit is aligned to Common Core National and Next Generation Science Standards.

    • Engineering Design:  define design problem, generate solutions, carry out tests and analyze resulting data
      • 3-5-ETS1-1, 3-5-ETS1-2, 3-5-ETS1-3
      • MS-ETS1-1, MS-ETS1-2, MS-ETS1-3, MS-ETS1-4
    • ELA/Literacy:  conduct short research projects, build knowledge through investigation
      • W.5.7
      • WHST.6-8..7


    Inquiry Process

    The unit encourages students to engage in scientific inquiry.  Students will be challenged to figure out how the sketch (computer program) works and interacts with the input (temperature sensor) and outputs (LED, buzzer).  They must figure out how the program works to be able to change the device’s behavior.  If things don’t work out right, they must investigate why not and try another approach.

    Assessment Processes An opening discussion about prior exposure to computers, electronics, and programming can be helpful in pacing the activity and grouping students who can provide leadership.  Short wrap-up discussions after completing the unit is helpful to assess progress and revisit key learnings.


    Instructional Procedures

    Introduce the Key Concepts

    Introduce the concept of a thermistor, how it works and its applications.  Introduce the light-emitting diode (LED) and how it works and its applications.  You may choose to use the attached teacher’s presentation for this, or use your own materials.  Explain that in this activity, we’ll be using a thermistor to sense the temperature, and an LED to simulate an air conditioning unit that we’d like our smart device to turn on when the temperature exceeds a threshold.


    To build our smart device we need some smarts.  Introduce the Intel® Galileo board.  Explain to students that Galileo is a computer, but unlike a PC, it has no keyboard.  This computer is designed to allow a wide assortment of things to be connected to it.  For example, you might connect some type of device to sense input.  This might be a microphone to sense sound.  It might be a button to sense a human decision, or a device that can sense motion or the temperature in the room.  You can also connect other types of devices to allow the computer to output something.  This might be something to display information from the computer, or provide a sound from the computer.  It could be a simple light that the computer turns on and off based on something it’s doing, or a signal that tells a motor when to run or turn off.


    With so many options for connecting different combinations of inputs and outputs, and instructing the computer how to think and act, the possibilities for creating cool things are truly endless.


    Instruct students to unpack the Grove Starter Kit Plus - Intel IoT Edition for Intel Galileo Gen 2 and Edison.  Allow students to explore the kit and identify its pieces.  Have them use the diagram in figure 1 to set aside the pieces they will need from the kit for the activity.


    Explain that in the following activity, they’ll be connecting a temperature sensor and an LED to the Galileo board via the shield and cables.  They’ll build the light sensor and will then have to change the design by way of modifying the computer program.


    Set-up for the Activity

    Note about set-up:  You may elect to allow the students to connect up their Galileo boards, or you may elect to perform this set-up yourself prior to the start of class. The set-up involves connecting the Galileo to the PCs the students will be using, as well as pre-loading the Arduino (Galileo Gen 2 version) IDE onto the PCs.


    If the students will be performing the set-up themselves, add 15-20 minutes to the amount of time required for the unit.  In addition, make sure the students are responsible and take care to follow the instructions below very carefully as performing the steps in the wrong order can result in permanent damage to the Galileo board.


    Step-by-step instructions for connecting Galileo are found here:


    Within the step-by-step instructions, when prompted to choose a development environment, choose Arduino.  Have the students proceed all the way through the getting started exercise to the point where they blink the LED on the Galileo board. This affirms the set-up was done correctly.  If they cannot blink the LED, have them start over and/or seek your help.


    Make the Temperature Sensor

    Now that the Galileo board is connected to the computer and the computer running the Arduino IDE, the students are ready to build the temperature sensor circuit.  Share with the class the photo in figure 2 of the teacher’s presentation, illustrating the correct set-up.  Explain that to simulate an air conditioning unit, we will be using an LED.  So, when certain conditions are met, instead of turning on an A/C unit, our system will turn on an LED.


    Walk students through the steps as follow:

    1. Identify the shield, temperature sensor module, LED module, the green LED, and cables in the Grove Kit.
    2. Carefully attach the shield to the Galileo Gen 2 board as shown in figure 2.
    3. Using the cables, connect the temperature sensor module to the shield at A0.
    4. Attach the green LED to the LED module, and then using the cables connect the LED module to the shield at D4.
    5. Turn on the shield using its switch.
    6. Open the Arduino IDE software.
    7. Upload the sketch K11_4.ino from Github, here:
    8. To simulate the changing of temperature, you may opt to heat up the sensor with your finger.


    Challenge:  Sound the Alarm!

    In addition to using the smart system to turn on the air conditioner (ie. using the LED as a placeholder for an A/C unit), now we also want to sound an alarm if the temperature dips below a certain temperature.


    Connect the buzzer module to the shield at D5.


    Modify the code to activate the buzzer if the temperature dips below 20 degrees C (you may modify the actual temperature based on ambient temperature in your environment.)


    Conclude the Unit

    Lead the class in a discussion about the unit.  Several directions are possible:  What did we learn?  Where else could this temperature sensor system be used in the real world?  Can you think of any interesting ideas for innovative smart devices for the home?  What kinds of careers are available to people who enjoy this kind of activities?


    Differential Instruction

    Resource Student

    • Allow more time as needed.
    • Skip the challenge sections and focus on building the sensor and discussing how it works.

    Gifted Student

    • Give students additional challenges that force them to go deeper into modifying the sketch.
    • Have students integrate the smart temperature sensor into a broader science project.
    • Have students learn the Arduino programming language and try writing their own sketches to interact with she sensor input.

    English Language Learner

    • Pair the student with a peer in groups
    • Allow more time on the visuals in the presentations
    • Provide the student with Internet access and relevant sites in the student’s first language beforehand


    Additional Resources

    For an introduction to the benefits of teaching making and coding, and tips for bringing hands-on activities to your classroom, see Gary Stager’s paper, “Guide to Creating and Inventing with Technology in the Classroom.”

    Students use Intel® Galileo to build a smart sensor that can take action when temperature exceeds or falls below a limit.  No prior experience with Galileo or programming required.