Start of main content
Age Range: 7-11
Duration: 60 or more mins
  • Computing
  • D & T
  • Science

Coding treasure hunt with the BBC micro:bit

Designing and programming a device that can find lost treasure

In this fun activity, students will design, program and use a programmable device to find other micro:bits in a class 'treasure' hunt. This coding treasure hunt is both entertaining and educational, providing a unique blend of adventure and learning.

This is one of a set of resources developed to aid the teaching of the primary national curriculum, particularly KS2. This is part of our series of resources designed to support the use of the BBC micro:bit in primary school design & technology (DT), computing and engineering lessons.

Activity: Designing and programming a device that can find lost treasure

In this activity, the students will be tasked with creating a programmable device using the BBC micro:bit that can locate other micro:bits (treasure) quickly during a class treasure hunt.

Learners will analyse a design brief and design criteria, and then take one of two routes through the activity – designing and producing the programming themselves or using a pre-written program that they can download straight onto their device and/or edit as they go through.

The engineering context

Programmable systems are integral to our world today, with almost all electronic devices from smartphones to complex aircraft control systems relying on programmable devices to function. Through this activity, students will gain insights into how programming can be used to embed intelligence into products and systems. They will also understand the importance of radio signals in wireless communication, a vital knowledge for engineers working in the communications industry.

Suggested learning outcomes

By the end of this activity, students will have a deeper understanding of how radio messages are sent and received using the BBC micro:bit. They will be able to design a programmable device that can locate other micro:bits emitting a radio signal, enhancing their problem-solving and critical thinking skills. Additionally, they will experience first-hand how to find multiple pieces of 'treasure' using their programmable device, which will boost their technical skills.

Examples of the BBC micro:bit programs

Click here to open the program directly in the microbit code editor or download the programs below to open in your existing editor.

Starter program

Beacon program

Range program

These programs can be downloaded as .hex files below via the 'Download all' button. 

Download our activity sheet and other teaching resources

The activity sheet includes teachers’ notes, useful web links, and links (where appropriate) to the national curriculum in each of the four devolved nations; England, Northern Ireland, Scotland and Wales.

All activity sheets and supporting resources are free to download, and all the documents are fully editable, so you can tailor them to your students’ and your schools’ needs.

Download our classroom lesson plan and PowerPoint presentation below.

Please do share your highlights with us @IETeducation. 

Related resources