October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Bettesworth Construction
electronics education

Build a Micro:bit Smart-Home Prototype: Light, Fan and Alarm

Use a micro:bit to explore a light-responsive lamp, relay-switched fan and light or movement alarm as separate low-voltage smart-home projects.

By Bettesworth Construction Team 5 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A micro:bit can demonstrate three smart-home ideas: a lamp that responds to room brightness, a fan switched through a relay, and an alarm triggered by light or movement. These are separate educational projects, not one verified integrated build. Treat the result as a low-voltage classroom prototype—not a certified security system or mains-powered home controller.

How the prototype works

Each function follows the same pattern: an input is read, code decides what to do, and an output responds. The micro:bit’s LED display can act as the light input; a relay can switch a separate battery-powered fan or lamp; and an alarm can use the display, sound, or a radio message to another micro:bit.

The Foundation defines a light sensor as “an input device that measures light levels.” Its LED display can perform that role, so a separate light sensor is not needed for the basic light-responsive demonstration. See the Micro:bit Educational Foundation’s sensors guide.

Choose the setup and parts

Function Controller and input Output and key parts
Automatic light One micro:bit can read ambient light using its LED display. For a switched lamp, the cited MonkMakes activity uses a compatible relay and a separate battery supply for a low-voltage LED lamp.
Fan A micro:bit controls the relay; the cited example toggles it after detecting a loud sound. Compatible relay, low-voltage motor with fan, battery holder and battery. The fan circuit is separate from the micro:bit.
Light alarm The Foundation’s radio example uses two micro:bits: one senses light and sends status messages; the other receives them. The receiving micro:bit provides display and sound feedback.
Movement alarm The Foundation’s PIR example uses an external movement sensor connected to a micro:bit, plus a second micro:bit as receiver. The receiver can display and sound an alarm when it receives a movement message.

Check compatibility for your chosen board and relay before assembling. The Foundation describes MakeCode as its blocks-based editor and provides a text-based Python editor; its light-alarm activity is available in both formats.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
KEYESTUDIO Micro:bit V2 Go Kit Original Microbit V2 Starter Kit, with Micro:bit V2, Battery Holder, Micro USB Cable
  • Includes the BBC Microbit V2.2 which has new speaker sensor, Built-in 25 LEDs, 2 buttons, motion sensor, buzzer, light sensor, temperature sensor, compass, radio and Bluetooth wireless features make it easy to get you started with more fun projects.
  • This is an easy to use electronic board that is very versatile and can be coded many different ways. It can be integrated with other coding tools and on many platforms.
  • Coding is easy with online block gui, javascript and python. Compiles to hex file, which you then copy to microbit (looks like a drive to pc)
  • Box contains: 1 micro:bit v2.2, 1 USB cable, 1 battery holder, 2 AAA batteries, user guide
  • Free tutorials and project ideas available on the micro:bit website. The instructions are easy to follow for a beginner to learn to code with it.

Make a light-responsive lamp

In the MonkMakes nightlight example, the code compares the micro:bit’s light reading with a threshold and switches an LED lamp through a relay when the room is darker than that value. The example starts at 50; a lower threshold means the lamp waits for darker conditions. That number is a starting point, not a universal lux measurement or a guaranteed setting for every room. The MonkMakes Electronics Kit 2 instructions describe the relay-based nightlight and fan activities.

  1. Read the light level with the micro:bit’s LED display sensor.
  2. Compare the reading with a threshold in the program.
  3. When the reading falls below the selected threshold, switch the relay to turn on the low-voltage LED lamp; when it rises above the threshold, switch it off if that is the behavior you want.
  4. Try the program in the actual room. Use button A to display a reading in the Foundation’s light-alarm example, then adjust the threshold to suit the lighting conditions.

For Foundation-specific guidance on this sensing approach, see its Light alarm activity.

Rank #2
Micro:bit BBC micro:bit v2 club pack (10 units), pocket-sized programmable computer for STEM education with Bluetooth, speaker, microphone, and sensors
  • Complete classroom kit: 10-unit club pack includes everything needed to get started: 10 micro:bit v2 boards, 10 micro USB cables, 10 battery holders, 20 AAA batteries, and 10 quick start guides — ideal for coding clubs, classrooms, and STEM workshops
  • Built-in sensors and outputs: Each micro:bit v2 features 25 individually programmable LEDs, 2 programmable buttons, built-in speaker, microphone, light sensor, temperature sensor, accelerometer, and compass — no additional hardware required to start learning
  • Wireless connectivity and AI-ready: Supports Radio and Bluetooth communication between devices for group projects and collaborative coding; technical upgrades enable students to explore AI and machine learning concepts hands-on
  • Easy to program on any platform: Compatible with desktop computers via USB (480 Mbps data transfer); program using MakeCode (block-based), Python, or Scratch; backward compatible with all existing micro:bit v1 lessons, tutorials, and code
  • Compact, durable, and classroom-friendly: Each board measures just 2" x 2" x 0.4" and weighs only 69g; battery-powered for portable use; designed for ages 8+ with no soldering required, making it safe and accessible for students of all skill levels

Switch a fan with a relay

A micro:bit pin should not drive a motor directly. In the cited fan activity, the relay switches a separate battery-and-fan circuit. The example changes a variable when it detects a loud sound, then sets pin 0 high or low to control the relay. This is a useful switching pattern, but it does not provide a combined wiring diagram for the light, fan and alarm functions.

  • Use a micro:bit-compatible relay specified for the project.
  • Power the fan motor from its separate battery holder and battery through the relay circuit.
  • Keep the micro:bit’s control connection distinct from the fan’s load circuit, and follow the relay and motor instructions.

The fan example is sound-triggered; you can treat the relay as a general switched output in your own code, but the cited instructions do not establish an integrated multi-function program or wiring plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
GeeekPi BBC Micro:bit V2.2 Board with Micro USB Cable and Battery Holder for Coding and Programming(Not Include Batteries)
  • Microbit V2.2 is an improved version of the original micro:bit featuring a built-in speaker, microphone, touch sensor and more computing power!
  • The micro:bit is completely programmable, so you can easily create your own games, music and even control robots.
  • With Rich Peripheries, 2.4GHz ratio and Bluetooth 5.0, the possibilities are endless.
  • 25 individually-programmable LEDs, 2 programmable buttons
  • Package includes: 1x micro:bit v2.2, 1x USB cable, 1x battery holder(Not Include Batteries)

Add a light alarm using radio

The Foundation’s light-alarm project uses two micro:bits. One monitors brightness and transmits a “lights on” or “lights off” message every 10 seconds. The receiving micro:bit reacts to the message: in the documented example, it shows an angry face and plays an alarm sound when it receives “lights on.” Both micro:bits must use the same radio group for messages to match.

  1. Program the sensing micro:bit to read the LED display’s light level and compare it with a threshold.
  2. Set the sender and receiver to the same radio group.
  3. Have the sensing device send the appropriate light-status message every 10 seconds.
  4. Program the receiving micro:bit to respond to the chosen message with display feedback and, if appropriate, sound.
  5. Adjust the threshold in the room where you will demonstrate it. The Foundation’s example starts at 50 and uses button A to display a reading that helps with adjustment.

The activity suggests changing the response—for example, triggering on the other light state—or combining the light alarm with another sensor. Its guide includes MakeCode and Python examples.

Rank #4
KEYESTUDIO Microbit Basic Starter Kit for BBC Micro:bit V2 Accessories STEM Kit Coding for Beginners (Micro:bit V2.21 Included)
  • Microbit controller V2.21 is included!onboard comes with BLE, accelerometer, electronic compass, three buttons, 5 x 5 LED dot matrix, mainly used for teens' programming education.
  • Specially designed this starter kit includes commonly used resistors, LEDs, sensors, LED segment display and more to get you started with 18 interesting projects at least.
  • We have detailed tutorials (including an introduction, wiring diagram, test code, driver installation, Example Projects...... Step by step to explain how to use on our wiki page.
  • Each sensor is packaged individually and then held in a beautiful plastic box with compartments, it must be the best kit for you, your friends, and electric newbies or hobbyists.
  • All boards are well-packed after function, voltage and current testing. The kit is well packaged, with each item packed separately.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Extend the alarm with movement sensing

A PIR sensor can provide a movement input. In the Foundation’s movement-alarm activity, connect the sensor’s power to 3V, ground to GND, and signal output to pin 0. One micro:bit sends a movement or still message; a second receives it and provides the alarm response. Follow the specific sensor’s documentation, since sensitivity and timing may need adjustment. See the PIR movement alarm guide.

  • Check whether the sensor is reporting movement or stillness before choosing the alarm condition.
  • Test its sensitivity and timing in the intended demonstration area.
  • Decide whether sound is suitable. The Foundation notes loud sounds as an accessibility consideration; a visual display response can be used alongside or instead of sound.

What this prototype can—and cannot—do

The cited project guides document these functions separately. They do not establish a single integrated wiring diagram or demonstrate that the combined system has been assembled and tested. Use the projects as building blocks, and develop and verify any combined low-voltage code and wiring carefully.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
GeeekPi microbit V2 Club Kit (10 Pack microbit v2 go kit) with 10 BBC Micro:bit V2 Boards, Battery Holders, Micro USB Cable,20 AAA Batteries for Coding and Programming
  • This BBC micro:bit v2 Club kit is upgraded with a powerful new processor housing tons more capability and also adds a new speaker and microphone!
  • 25 individually-programmable LEDs, 2 programmable buttons, Light and temperature sensors, Motion sensors (accelerometer and compass)
  • MEMS microphone;Speaker to play audio tones
  • Wireless Communication, via Radio and Bluetooth
  • Package includes: 10x micro:bit v2 boards, 10x mirco USB cables, 10x battery holders, 20x AAA batteries,10x user guides

The relay activities describe switching a separate battery-powered fan or LED lamp. They do not provide a validated procedure for mains wiring. Keep this project to suitable low-voltage educational circuits; do not use it in place of a smoke alarm, burglar alarm, or certified smart-home controller.

Quick Recap

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Site Office

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.