The school garden club lost its broad bean seedlings to a late frost, so Year 4 set out to build an alarm over three lessons. In the first lesson groups code a micro:bit to show the temperature from its built-in sensor, and for a week they take the boards in clear waterproof boxes to three spots around the beds (by the wall, in the open bed and under the hedge) at 9am, midday and 3pm, leave them for five minutes and record the readings in a class table. Back in class they compare the spots, find which is coldest in the mornings, and agree a warning level a few degrees above freezing, because the board's sensor reads a little warmer than the air. Each group then codes an alarm that checks the temperature every minute and, once it drops below their level, shows a snowflake (and plays a tone on V2 boards) and keeps showing it until button A is pressed, and tests it by holding a cold pack against the board. On nights when frost is forecast the alarms go into the cold frame on a fresh battery pack, and the garden club checks them before school.
Tools: micro:bit, MakeCode Nine ideas for your own version in Generate
This page is one of a growing set of PICRAT examples by cell, subject and grade. Page maintained by Andy Perryer.