Using our website means you agree to using cookies which help us improve microbit.org.Learn more

Elizabeth’s homemade burglar alarm

Elizabeth was the winner of the Global Challenge for North America. She created an affordable home security system after one of her friends’ houses was nearly robbed. 

How did Elizabeth start using the micro:bit?

Elizabeth began using the micro:bit after learning to code with her mother, Marianne, at a mother-daughter coding class. They were tasked with coding light-up pumpkins for Halloween! Elizabeth and her mother really loved how easy micro:bit is to use so they could get creating and coding straight away. Since taking part in the Global Challenge, Elizabeth thinks she would like to work for Apple or Google in the future! 

What did she create? 

The code for Elizabeth’s home security system was written in MakeCode; you can see the code here. 

Her home security system used a micro:bit and Neopixels, a strip of multi-coloured LEDs that can be controlled by micro:bit. When the program starts it scrolls “Alarm set” across the micro:bit screen, indicating the alarm is switched on. When the micro:bit experiences a force of 3g the alarm is triggered (1g is the force of gravity, so a force of 3g suggests an attempted break-in). Until the alarm is reset, the micro:bit plays a loud alarm sound and the Neopixel LEDs flash red, white, and blue (emulating police lights). The alarm can be stopped by pressing button B on the micro:bit.