Introduction to Raspberry Pi through Making


Objectives

Students will be able to:

  • Connect a temperature sensor for reading input from RPi
  • Use conditional statements in Python
  • Modify and improve starter Python code

Lesson Outline

  • Present students with a working demo (15 minutes)
  • with students (10 minutes)
  • Students build temp sensors (90 minutes)

Teaching/Learning Activites

  • Start off the lesson by showing students a pre-wired and programmed temperature sensor running the provided sample code.
    • Wiring instructions can be found here:
    • The temp starter code was modified slightly from the above tutorial to simplify access to students.  If the students in the course have more than a very introductory level of programming knowledge it probably doesn’t need to be modified.  The starter code can be found in:
      • temp_starter.py (see Resources)
    • Do not explain a lot about how the sensor works at first, but instead invite students to explore the sensor and ask questions about it.
  • Give students the adafruit tutorial and the starter code and have them follow it to build the temp sensor.
  • Facilitate a wrap up discussion that pushes all students into the improve phase of the maker workflow.
    • If students don’t bring this up themselves, guide them to the understanding that the sensor is an INPUT that is providing information to the raspberry pi.  We can then use that information to do some output.
    • If the students don’t come up with this on their own, suggest a system with an LED that lights up if the temp is too high.
      • Ask students for real world examples of where this might be useful?
        • There is a temp sensor monitoring computers at all times (sometimes when iPhones/iPods get too hot they display a warning message.
        • Monitoring water temp for small children (or tired people who accidentally get in a cold shower in the morning)
  • Challenge students to think about how they could build something like this given the skills they currently have.  Tell them that they will be doing this soon.

Resources


Download: temp_starter.py

Temperature Sensor Tutorial

Return to top