SUMMER STEM-HEALTH CAMP
  • Home
  • 2025 RCC Camp
    • Day 1: Basic Coding >
      • Button Control
      • Multicolor LED
      • Fading multicolor led
      • Melody (sound)
    • Day 2: Servos and Potentiometers >
      • DC Motor
      • Ultrasound
      • Potentiometer and Motors
      • 2 servo control >
        • Analog Stick Control
      • PIR Motion Sensor
      • IR Light Proximity Sensor
    • Day 3 Making an ECG/EKG! >
      • ECG/EKG health lesson
      • OLED Screen Basics
      • Pictures to OLED
      • BPM on OLED
    • Day 4: Measuring Pulse >
      • Scrolling Screen Graph
      • How the body absorbs light
      • Screen Pictures
      • IR Temp Sensor And Screen
    • Day 5: Finishing up/Show >
      • IR Light Proximity Sensor
      • PIR Motion Sensor
      • CO2 Sensor
      • Ultrasound distance sensor
  • The Teachers
  • Our Partners
  • Archive
    • 2024 Health-STEM Coding Camp >
      • Home (2024)
      • The Teachers
      • Day 1: Basics and Lights
    • 2024 Coding/Robotics Camp >
      • Day 1: Basic Coding >
        • Saving your codes
        • Engineering design
      • Day 2 Servos >
        • 2 Servos, one potentiometer
        • Multicolor LED >
          • Fading multicolor led
    • Pictures from prior years
    • 2023 3D Design Camp >
      • Day 1: 2D design
      • Day 2: 3D design basics
      • Day 3: Constraints
    • 2023 Health-STEM Coding Camp >
      • PreAcademy prep
      • Day 1: Basics and Lights >
        • Multicolor LED
        • Button Control
      • Day 2: Ultrasound >
        • Ultrasound Health Lesson
        • Supplement Melody
        • Supplement: Servo >
          • Potentiometer and Motors
          • 2 servo control
      • Day 3: Measuring Pulse >
        • How the body absorbs light
        • OLED Screen Basics >
          • Scrolling Screen Graph
      • Day 4 Making an ECG/EKG! >
        • ECG Health Lesson
        • Pictures to OLED
        • BPM on OLED
      • Day 5: Finishing up/Show
    • 2021 STEM Camp (HS) >
      • The Teachers (2021)
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Temp Sensor
        • Day 1 Supplement: Identifying Resistors
        • Supplement: Controlling A Servo
      • Day 2: Measuring Pulse >
        • How the body absorbs light
        • IR Light Proximity Sensor
        • PIR Motion Sensor
      • Day 3 Supplement: OLED Screen Basics >
        • Display Screen Temperature
        • Scrolling Screen Graph
      • Day 4: Finishing up/Show
    • 2021 STEM Camp (MS) >
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Identifying Resistors
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Light Proximity Sensor
      • Day 2: Ultrasound >
        • Day 2 Supplement: IR Temp Sensor
        • Day 2 Supplement: Controlling A Servo
      • Day 3: Measuring Pulse
    • 2020 STEM Camp
    • 2018 Lessons
    • 2017 Camp
  • Contact Us!

Materials for this activity:


The Arduino and USB cord
Picture
Several Different LEDs
Picture
The 5.1 kOhm resistor
Picture
(kits may vary: any resistor) (from 4.7 to 5.2 kOhms works)
Picture

Wires
Picture
Breadboard
Picture

Temperature Sensor

Picture

Let's start by measuring your temperature.

Temperature is one of the simplest and main resources for healthcare professionals to know if something is wrong with you. This activity will help you learn basic Arduino wiring, how to read data from a sensor, and how to get information to display on your computer monitor. 

Making sure you have Arduino IDE 

Before we get started, have you installed the Arduino IDE software yet?
If you have, you should see a shortcut logo like this on your desktop --> 

If you do not have it, click the button below for directions. 

Click here for Arduino IDE download instructions
Picture

Downloading Libraries

Go ahead and open up your Arduino IDE program. 

Before we can use the code for the temperature sensor, you have to first download two libraries. Libraries are a collection of code that make it easier to connect to sensors.

To download libraries: open your Arduino IDE software, open the "tools" tab, and select "manage libraries" (wait about 5 seconds). This will open up the library finder tool. 

Here is a picture ​showing those steps. ​
Picture

This is what the library finder tool looks like. 
Picture
The two libraries we need are "OneWire" and "DallasTemperature". To find the first one,  type "OneWire" in the search bar on the top right and push enter on your keyboard. Scroll down until you find "OneWire". Move your computer mouse over that row and then select the "Install" button that appears in the bottom right (wait about 5 seconds for it to install).
Picture
Do the same thing to install "DallasTemperature."
Picture
You are now ready to wire up and write the code for the temperature sensor! 

Coding and wiring your temperature sensor.

Here is the wiring for the temperature sensor. 
​
The black wire is connected to ground 

The yellow signal wire connects to two things:
1) Digital pin 2
2) A 5 kOhm resistor that connects to the 5V

The red wire is connected to the 5V  
Picture
Below is a picture example of how you can wire it. 
Picture
Type this into Arduino IDE in order to get your temperature sensor to work. 

Remember the following tips:
1) Capitalization matters
2) If colored parts in my code are not colored in yours, you made a mistake somehow 

Below is the same code, but with comments to the side to help you see what each line is doing in the code. 

We will talk about what this code does in class. 

Picture
Picture

Upload your code to the Arduino board

Plug the blue USB cord into your Arduino and computer. Select the right arrow button (next to the check mark in the top left corner) to send your code to the board. 
Go back to the day 1 lesson about the basics if you get stuck here


Serial Monitor: Seeing your temperature

The Serial Monitor is where you can see text or data that the Arduino is outputting. After you upload your code to the board successfully, select the magnifying glass on the top right of the IDE. 
Picture
After you click that button, a separate window will open up after a few seconds. 
​It will also restart your Arduino. After a few seconds, you will start seeing your temperature sensor data appear. A new line will appear every two seconds because our code's delay value was 2000. 
The data will read normal temperatures assuming you wired your sensor correctly. 

The picture below is of Dor 
Picture
This activity was inspired by: https://www.youtube.com/watch?v=qxEclOy6jpI
And also by: 
https://create.arduino.cc/projecthub/akarsh98/ds18b20-temperature-sensor-tutorial-with-arduino-and-esp8266-db31aa
Proudly powered by Weebly
  • Home
  • 2025 RCC Camp
    • Day 1: Basic Coding >
      • Button Control
      • Multicolor LED
      • Fading multicolor led
      • Melody (sound)
    • Day 2: Servos and Potentiometers >
      • DC Motor
      • Ultrasound
      • Potentiometer and Motors
      • 2 servo control >
        • Analog Stick Control
      • PIR Motion Sensor
      • IR Light Proximity Sensor
    • Day 3 Making an ECG/EKG! >
      • ECG/EKG health lesson
      • OLED Screen Basics
      • Pictures to OLED
      • BPM on OLED
    • Day 4: Measuring Pulse >
      • Scrolling Screen Graph
      • How the body absorbs light
      • Screen Pictures
      • IR Temp Sensor And Screen
    • Day 5: Finishing up/Show >
      • IR Light Proximity Sensor
      • PIR Motion Sensor
      • CO2 Sensor
      • Ultrasound distance sensor
  • The Teachers
  • Our Partners
  • Archive
    • 2024 Health-STEM Coding Camp >
      • Home (2024)
      • The Teachers
      • Day 1: Basics and Lights
    • 2024 Coding/Robotics Camp >
      • Day 1: Basic Coding >
        • Saving your codes
        • Engineering design
      • Day 2 Servos >
        • 2 Servos, one potentiometer
        • Multicolor LED >
          • Fading multicolor led
    • Pictures from prior years
    • 2023 3D Design Camp >
      • Day 1: 2D design
      • Day 2: 3D design basics
      • Day 3: Constraints
    • 2023 Health-STEM Coding Camp >
      • PreAcademy prep
      • Day 1: Basics and Lights >
        • Multicolor LED
        • Button Control
      • Day 2: Ultrasound >
        • Ultrasound Health Lesson
        • Supplement Melody
        • Supplement: Servo >
          • Potentiometer and Motors
          • 2 servo control
      • Day 3: Measuring Pulse >
        • How the body absorbs light
        • OLED Screen Basics >
          • Scrolling Screen Graph
      • Day 4 Making an ECG/EKG! >
        • ECG Health Lesson
        • Pictures to OLED
        • BPM on OLED
      • Day 5: Finishing up/Show
    • 2021 STEM Camp (HS) >
      • The Teachers (2021)
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Temp Sensor
        • Day 1 Supplement: Identifying Resistors
        • Supplement: Controlling A Servo
      • Day 2: Measuring Pulse >
        • How the body absorbs light
        • IR Light Proximity Sensor
        • PIR Motion Sensor
      • Day 3 Supplement: OLED Screen Basics >
        • Display Screen Temperature
        • Scrolling Screen Graph
      • Day 4: Finishing up/Show
    • 2021 STEM Camp (MS) >
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Identifying Resistors
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Light Proximity Sensor
      • Day 2: Ultrasound >
        • Day 2 Supplement: IR Temp Sensor
        • Day 2 Supplement: Controlling A Servo
      • Day 3: Measuring Pulse
    • 2020 STEM Camp
    • 2018 Lessons
    • 2017 Camp
  • Contact Us!