Micro Logger for micro:bit

(1 customer review)

£24.00 inc VAT (£20.00 ex VAT)

Available on back-order

Brand: Proto-PIC
Part Number: MB00142
SKU: PPMB00142
Barcode: 5055421002152

One of the many questions we get asked when it comes to micro:bit is ‘how can I log the data from the XYZ sensor to a file’. So here is the answer, our Micro logger for micro:BIT. While the micro:bit is easy to program, and with its support for a wide range of sensors, storing the readings from sensors has always been a bit of a challenge. This Micro logger provides a solution for this by storing the data on an SD card, in any customisable format you can program. The SD card can be removed for reading with a computer, or there is an FTDI header that can be used to dump the data to your computer using a terminal program, or your own custom software.


The Micro logger has an easy to use set of commands for formatting and saving your data, changing the settings of the logger, and dumping out the data to serial or erasing the datafile. There is also an onboard voltage regulator to take the power input from 5V on the USB or 5V – 12V on the barrel jack down to 3.3V for your micro:bit and sensors. There is a switch to change the input from the micro:bit to the FTDI header, allowing you to access & operate the logger from an FTDI breakout or another microcontroller, e.g. Arduino, this is a 3.3V device so you will need to use a logic level shifter if you use a 5V device. The 3.3V, GND and micro:bit pins have been broken out for you to add pin headers to, or solder wires directly to, allowing you to use sensors on breakout boards with standard jumper wires.

We had one of these logging the soil moisture in one of our plants here at Proto-PIC HQ using the code below, using the data to create a graph of moisture over time.


Here is the code :

from microbit import *
tick = Image(“00000:”
# Start serial output on pin 16 – this is the output to the Datalogger
uart.init(9600, tx = pin16)
# Give the connection time to setup
# Turn Line Feed OFF – we want to concat our data
while True:
# Wire pin 1 to the +ve pin on the sensor
# We only turn it on when required
# This stops the current when we are not reading
# makes the probe last a LOT longer
reading = pin0.read_analog()
print(“<moisture reading : “, end=””)
# Move to New Line
# Make sure the data has been written to the SD card
# Wait for 1 minute

The logging of DATA is easy, just make sure it is in between < and >. Anything that does not have the will be ignored by the logger. COMMANDS are in between <{ and }>. Examples of these are below.

<12,34,56><{NL}> Would create :


with a new line after the 6, the<{NL}> is a command for New Line.


Commands :

{NL}                         Add New Line.

{NLON}                   Auto New Line after DATA on.

{NLOFF}                  Auto New Line after DATA off.

{FLUSH}                  Ensure the DATA buffer has been written.

{CLOSE}                  Ensure the DATA buffer has been written & close the file.

{DUMP}                  Write the data file out using the serial connection.

{ERASE}                  Delete the datafile.

{BAUDxxxx}          Change the BAUD rate of the serial connection, valid speeds :

9600 (Default), 19200, 38400, 57600 and 115200

{STATUS}               Show the current Auto New Line status.

{VERSION}            Show the current firmware version.

1 review for Micro Logger for micro:bit

  1. Dave Morgan

    Fabulous, a little expensive, however I can see why, with a atmega. great to see the combination. Have had mine running for over a week now glitch free taking moisture readings in my office wall.

Add a review