Skip to content

News

Easy micro:bit data logging with MakeCode

18 Jun 2022

With Microsoft MakeCode, it’s easy to use the BBC micro:bit to log data in science, maths and computing lessons

students using the BBC micro:bit outdoors
  • The 2022 Microsoft MakeCode editor update includes a new data logging feature for the micro:bit V2.
  • With a few blocks of code, you can capture, store and visualise real world data from the micro:bit's built in sensors for temperature, light, sound, movement and magnetism.
  • It uses the increased memory capacity of the micro:bit V2 to store data on the micro:bit even when you disconnect the power.

What is data logging?

Data logging is a cornerstone of primary and secondary science. Recording environmental information from sensors over time enables your students to carry out meaningful scientific experiments, learn about how to collect reliable data, visualise and interpret it.

It’s a springboard for learning about computing, science and maths which is suitable for primary and secondary settings. Data logging with the micro:bit can be as simple or as complex as suits your students.

How micro:bit data logging works

Now the data logging feature of the BBC micro:bit V2 and the new update to the MakeCode block editor makes recording, visualising and analysing data in class quick and easy.

  • With just a few blocks of code you can start logging data from built-in sensors on the micro:bit V2, such as movement, light, sound, magnetism and temperature.
  • You can log data manually, or automatically in short bursts - for example measuring acceleration in an ‘egg drop’ experiment.
  • Or you might want to measure data over longer periods of time, such as light, temperature or sound levels over a day or a week.
  • No accessories are needed: just a micro:bit V2, USB lead and a computer. Battery packs give you more freedom and flexibility.
visual preview graph and table of data logged using a micro:bit

Data is shown in a table and graph on your MICROBIT drive

Retrieve, visualise and analyse your data

Data is stored on your micro:bit even when the power is disconnected.

It’s easy to access - no software is needed. Plug your micro:bit in to a computer, look in the MICROBIT drive and double-click the MY_DATA file to open it in a web browser.

You can see your data instantly as a table, visualise it in a graph, and copy or download the data into a spreadsheet like Excel or Google Sheets.

Find out more and get logging!

Data logging is an extension that’s easy to add, our user guide explains how to get started.

More data logging projects and video guides will be coming soon, so sign up to our education newsletter to make sure you don’t miss out.

About Microsoft MakeCode

Microsoft is a Founding Partner of the Micro:bit Educational Foundation. The Foundation works collaboratively with Microsoft on the development of the MakeCode software editor. Each year the two organisations collaborate on features to support new ways to work in code and physical computing with the micro:bit.

Latest stories