Micro:bit Temperature Reading
Students will program micro:bits to measure temperature readings in Celsius and then convert to Fahrenheit either using a math conversion.
OVERVIEW
Activity Overview:
Students will program micro:bits to measure temperature readings in Celsius and then convert to Fahrenheit either using a math conversion.
Meta description
- Subject Area: Computer Science, Mathematics, Science
- Grade Level : 6-8
- Computer Science Domains:
- Computing Systems, Data Analysis, Algorithms and Programming
- Computer Science Principles:
- Collaborating Around Computing, Creating Computational Artifacts, Testing and Refining Computational Artifacts
- Materials:
- Website, Micro:bit, makecode.microbit.org
- Considerations:
- Basic weather gathering materials and knowledge needed. This lesson will enhance a two week period of gathering weather information.
Lesson Plan
Overview
Students will program micro:bits to measure temperature readings in Celsius and then convert to Fahrenheit either using a math conversion.
ASSESSMENT PRE/POST-TEST
Can you accurately measure and interpret the temperature outside? Can you program a micro:bit to measure the temperature outside? Can you convert degrees Celsius to degrees Fahrenheit?
OBJECTIVES
program a micro:bit, interpret and convert temperature readings
CATCH/HOOK
ACTIVITY INSTRUCTIONS
*I will be sharing my screen for students to follow along and do as I do.
- Students will receive materials necessary to accomplish task (micro:bit, USB charger, battery pack charger).
- Students will log in to makecode.microbit.org and create a new project titled ’temperature'.
- Students will use block code to program micro:bit with the ability to read the current temperature
- Use ‘On Start’ block located on current board
- Go to variables tab and make a ’temp C’ variable
- In variables tab- now find ‘set temp C to ___’, drag and drop block into your ‘on start’ block
- Go to the input tab and find the ’temperature (C)’ oval shape, place into the oval shape at the end of your red ‘set temp C’ block. Your micro:bit should now show a thermometer.
- Now choose an input block, either ‘on shake’ or ‘on button A (or B, or A &B) pressed’, and drag and drop it on a clear space on your board.
- Go to the Basics tab and choose the ‘show number’ block and drag and drop it into your purple input tab.
- Right click the ’temperature (C)’ oval from previous, or drag and drop a new one from the inputs tab, and carefully place into the number oval on your blue ‘show number’ block.
- Depending on your input block, use the action listed and do so to your micro:bit. The temperature should scroll across the screen.
- Attach your handheld micro:bit with the USB and download the program. Find the ‘hex’ file located in your file explorer and drag and drop it to the ‘Micro:bit’ folder. Wait for download to complete and unplug mirco:bit.
- Plug the battery pack into the microbit and test the temperature outside.
- Take your temperature reading and convert to Fahrenheit. Multiply the reading by 9/5, then add 32. This is the temperature in Fahrenheit.
Supplements
Any items in this section are the property & under the license of their respective owners.
REVIEW
Now you know a simple program to place on a microbit, and how to convert Celsius to Fahrenheit. Reading the temperature can be an amusing and fun task when using computer science. For a career idea or another real life example: https://climatekids.nasa.gov/career-satellites/
STANDARDS
| Type | Listing |
|---|---|
| CS Domains | Computing Systems, Data Analysis, Algorithms and Programming |
| CS Principles | Collaborating Around Computing, Creating Computational Artifacts, Testing and Refining Computational Artifacts |
| Other Content Standards | ESS2 |