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!

Display your Temperature on Screen

This lesson combines the code from the Hello World OLED screen lesson and the temperature sensor code. Here are links to those two activities so that you can go back to them if needed. 
OLED Screen Lesson: https://www.rcccamp.org/day-4-supplement-oled-screen-basics.html
Temperature Sensor Lesson: https://www.rcccamp.org/day-1-supplement-measure-temperature.html


Supplies Needed

Arduino and USB Cord
Picture
Breadboard
Picture
4.7K to 5.3K Resistor 
You likely have a 5.1K in your kit

Picture

OLED Screen
Picture
Temperature Probe
Picture
Jumper Wires
Picture

Reminding Ourselves of the Old Codes

We will use the basics of what we learned from coding the screen and temperature sensor to do this activity. We will be combining the two codes so that the LCD screen displays the temperature. 
Here is the old codes. 

Temperature Sensor Code

Picture

OLED Screen Code 

Picture
What are the main code sections in both? 
1) Before setup       2) Setup          3) Loop
The
 3 parts need to be combined in new code! 

Combining the Code, start by loading one of these. 

Let's open a new Arduino file and start by just combining all of the parts together like this. 
1) Copy the parts before the setup in both files and past it into the new file. 

2) Combine all of the "begin." parts like sensors.begin, serial.begin, and display.begin, into the setup. I would say put the display. parts that you see in the setup in the new file, but we want that in a loop now so the temperature can be live updated. 
3) move all of the display. parts and put it with the serial.print parts of the old code into the new file. 
4) replace hello world text with temperature and then add a new line where it will print the temperature. 

Here is an example to the right of a way to combining the codes. 
Picture
Does it varify? You really just mostly needed to copy and paste if you have been saving all of your codes. The display and serial monitor will display the same text now after you wire it up. We can alter this code later to work better with the screen and lose the Serial.print parts, but that will be later. 

The Wiring

The wiring is combining the two together. Here is what they looked like on their own.
​Just do both together at the same time. 
Picture
Picture
Except plug the screen into the 3.3 V 
This is because the 5V will be used by the temperature sensor. 


Combine the Wiring

We need two things plugged into  5V? But fun fact, the screen can also run on 3.3 V!
Here is how to wire it. 
1) Screen's GND to Arduino GND
2) Screen's VCC to Arduino 3.3 V 
3) Screen's SCL to Arduino A5
4) Screen's SDA to Arduino A4

5) Temp probe's red wire to Arduino 5V 
6) Temp probe's black wire to Arduino GND 
7) Temp probe's yellow wire to Arduino pin 2 
8) Jump the 5k resistor from yellow to red row on the breadboard 

Picture

Combining the code (Cleaning it up)

There are several main parts to the codes. The parts before the setup, the setup, and the loop.
We need to move these parts from one code to the other code. That will look something like this after cleaning it up some. We do not need the serial begin any more though because we are only using the display. 
Picture
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!