The Arctic Blast Alert – Micro:bit Temperature Sensor

Posted by

The Bomb Cyclone has hit the Northeast. With nighttime temperatures of -10, I was worried that the water pipe in the garage would freeze. So I decided to use the radio and temperature features of the Micro:bit to warn me if the temperature in the garage went below freezing.

First the Sending Micro:bit 

Screen Shot 2018-01-07 at 1.48.14 PM

The temperature sensor outputs in centigrade and since the Makecode cannot deal with floating point variable (ugh), I kept the values in centigrade. The temperature sensor is actually a part of the CPU.

“The BBC micro:bit does not have a dedicated temperature sensor. Instead, the temperature provided is actually the temperature of the silicon die on the main CPU. As the processor generally runs cold though (it is a high efficiency ARM core), the temperature is a good approximation of the ambient temperature”

Since the reading is an approximation, I created an offset variable to compensate for the difference between the actual temperature to what the Micro:bit thought the temperature was.

The TempC variable is sent over the radio to the receiving Micro:bit in my living room. The Micro:bit will play a song of the temperature falls below 0 Celcius.

The Receiving Micro:bit

Screen Shot 2018-01-07 at 1.47.28 PM


The receiving code is straightforward. After setting the radio group in the On Start block, the Micro:bit just waits for a received number. If the number is less than zero, a tune is played.


Next Steps:

I found two interesting posts; one to transmit data to a website and another to integrate with IFTTT. So more to follow.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s