RAPPAHANNOCK COMMUNITY COLLEGE STEM CAMP
  • Home
  • 2021 STEM Camp (HS)
    • 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 Buttons
      • Supplement: Controlling A Servo
    • Day 2: Measuring Pulse >
      • How the body absorbs light
      • Day 2 Supplement: IR Light Proximity Sensor
      • Day 2 Supplement: Motion Sensor
      • Code to start later on plotter
    • Day 3 Supplement: OLED Screen Basics >
      • Display Screen Temperature
      • IR Temp Sensor And Screen
      • Scrolling Screen Graph
    • Day 4: Finishing up/Show >
      • Pictures to OLED
      • BPM Pulse Sensor
      • Multimeter
  • Shared Google Folder
  • The Teachers
  • Archive
    • Pictures from prior years
    • 2021 STEM Camp (MS) >
      • Home (2021)
      • 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 >
        • Day 3 Supplement: Motion Sensor
      • Day 4: OLED Screen Basics >
        • Temperature Screen Display
        • IR Temp Sensor And Screen
      • Day 5 Friday: Finishing up/Show
    • 2020 STEM Camp >
      • Home (2020)
      • The 2020 Teachers
      • PreAcademy prep
      • Day 1 Monday: Basics and Lights >
        • Day 1 Supplement Activity
      • Day 2 Tuesday: Servos >
        • Day 2 (Suppliment Activities)
      • Day 3 Wednesday: Making an ECG/EKG! >
        • Day 3 (Supplement Page)
      • Day 4 Thursday: Controlling Servos with EMG >
        • Day 4 Supplemental Activity
      • Day 5 Friday: Finishing up/Show >
        • Unused lessons/content
    • 2018 Lessons >
      • Day 1: Basic Coding
      • Day 2: Motors
      • Day 3: Build Robot Claw
      • Day 4: Saving Positions
      • Day 5: Presentations
    • 2017 Camp >
      • Day 1 (Monday)
      • Day 2: Multicolor LED and Keypad
      • Day 3: Servo and Keypad
      • Day 4: Multiple Motors/Stepper Motor
      • Day 5: Presentations
    • Pictures archive for lessons (some graphic images)
  • 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
Powered by Create your own unique website with customizable templates.
  • Home
  • 2021 STEM Camp (HS)
    • 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 Buttons
      • Supplement: Controlling A Servo
    • Day 2: Measuring Pulse >
      • How the body absorbs light
      • Day 2 Supplement: IR Light Proximity Sensor
      • Day 2 Supplement: Motion Sensor
      • Code to start later on plotter
    • Day 3 Supplement: OLED Screen Basics >
      • Display Screen Temperature
      • IR Temp Sensor And Screen
      • Scrolling Screen Graph
    • Day 4: Finishing up/Show >
      • Pictures to OLED
      • BPM Pulse Sensor
      • Multimeter
  • Shared Google Folder
  • The Teachers
  • Archive
    • Pictures from prior years
    • 2021 STEM Camp (MS) >
      • Home (2021)
      • 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 >
        • Day 3 Supplement: Motion Sensor
      • Day 4: OLED Screen Basics >
        • Temperature Screen Display
        • IR Temp Sensor And Screen
      • Day 5 Friday: Finishing up/Show
    • 2020 STEM Camp >
      • Home (2020)
      • The 2020 Teachers
      • PreAcademy prep
      • Day 1 Monday: Basics and Lights >
        • Day 1 Supplement Activity
      • Day 2 Tuesday: Servos >
        • Day 2 (Suppliment Activities)
      • Day 3 Wednesday: Making an ECG/EKG! >
        • Day 3 (Supplement Page)
      • Day 4 Thursday: Controlling Servos with EMG >
        • Day 4 Supplemental Activity
      • Day 5 Friday: Finishing up/Show >
        • Unused lessons/content
    • 2018 Lessons >
      • Day 1: Basic Coding
      • Day 2: Motors
      • Day 3: Build Robot Claw
      • Day 4: Saving Positions
      • Day 5: Presentations
    • 2017 Camp >
      • Day 1 (Monday)
      • Day 2: Multicolor LED and Keypad
      • Day 3: Servo and Keypad
      • Day 4: Multiple Motors/Stepper Motor
      • Day 5: Presentations
    • Pictures archive for lessons (some graphic images)
  • Contact Us!