Skip to main content

10 May 2022

Datalogging with micro:bit V2 - part 1

CAS logo
Written by

Computing at School

In October 2020, four years after the release of the micro:bit V1, the micro:bit V2 was released. It has a wealth of updated features including a small speaker and microphone. Full details can be founded here - https://microbit.org/new-microbit/ 

The new features that support datalogging, not only include a new in built sensor, a microphone, for recording sound levels, but changes to other components the ability for the micro:bit to record and store data. To support this new commands have been created in the Makecode Editor.

Before we can start using these new features for datalogging, we need to make some simple changes to the makecode editor. These features are still being tested, so they are not available by default. This what I have been able to discover and get working. To use the sound sensor (microphone), the commands are featured by default and can be found in the Input command list, when the microphone is active, a small red LED will light up. Try replacing light or temperature in the previous examples with sound level. This will also work in the previous post's example where data collected was displayed in real time. Use the value of 255 for sound level

To utilise the V2's ability to record and store data we need to change the makecode editor to the beta experimental version. This is easily done by. Click on the 'COG' icon on the upper right of the browser window. From the menu that appears click on 'about'. Next click 'experiments'. From the experiments that appear click on 'beta editor'. You can just type in this URL -https://makecode.microbit.org/beta ,

but it's worth having a look at the other experimental features that might be added to Makecode in the future, the accessible blocks for example might be useful for some students.

Now that you are using the beta version of the editor, You will need to use this version every time when using the datalogging features on the V2. We alsoneed to load into the commands specifically designed for data-logging and give the microbit the ability to flash data to it's memory. Click Advanced in the Editor command list, next click Extensions, choose datalogger (if you can't see it use the search function at the top of the screen). You will see a new set commands called Data Logger added to the command list. When you save a program made with these commands this extension will automatically be loaded. Just note that if you try and use this setup with a V1 you will get an error. It is a good idea to start a new project if you are going to code again with a micro:bit V1.

Now you have all the features in place to create a micro:bit V2 datalogger - Now to code it - Find out in Part 2