Step 1: Make it
What is it?
Show how hot or cold your micro:bit is using the built-in temperature sensor.
How it works
- This program shows how hot or cold your micro:bit is by taking a reading from the temperature sensor in its processor or CPU (central processing unit).
- The processor’s temperature is a fairly good approximation of the temperature around you in °C (Celsius).
- In this program, when you press input button A, the micro:bit displays the processor’s current temperature on its LED display output.
- Take the micro:bit into warmer and colder places and see how the temperature readings change.
What you need
- micro:bit (or MakeCode simulator)
- MakeCode or Python editor
- battery pack (optional)
- a source of heat or cooling, like a fan, if you want to see the temperature change quickly (optional)
Step 2: Code it
Step 3: Improve it
- Compare the reading with another thermometer. How accurate is the micro:bit? Do you need to modify the micro:bit reading to get the air temperature?
- Convert the temperature to Fahrenheit or Kelvin.
- Use radio to make a remote sensor sending temperature readings to another micro:bit, for example from outside to inside. You could make an indoor / outdoor thermometer this way.
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.