Science Oxford Logo

Using the Data Logger Extension

After adding the code, as shown below, the process for getting your data off the micro:bit is a bit tricky!

This extension only works with V2 micro:bits.


Adding the Extension

Click Extensions from the menu, and choose the datalogger option.

block code, as described below

You will now have an extra section in your menu called Data Logger.


The Code

Add two new blocks of code from the Data Logger menu, as shown below.

block code, as described above

Getting your Data

Each time you change your code, or want to get new data - follow these instructions.


  1. Download your new code to your micro:bit.
  2. Run your data collection code to get some data (it will show on your OLED screen).
  3. The next part will power off the OLED screen, so take a photograph of the graph if you want to.

  4. Unplug your micro:bit and plug it back in again (clicking 'reset' is not enough).
  5. Do not run your data collection code again, this will delete the earlier data.

  6. Open Windows File Explorer, and open the Microbit drive from the left-hand menu.
  7. block code, as described below
  8. Open MY_DATA.HTM - this will open in the web browser.
  9. See the table of data, and click Visual preview to see it as a graph. Does this look the same as the one on your OLED screen?
  10. Your log will be deleted each time you run the code, so if you want to keep it click Download to save a .csv file.

  11. Close the browser tab when you are finished with the data.

Whenever you make changes to your code, or run your data collection code again, the table will change - follow the instructions above each time to get your latest data.