With the XinaBox IM01 bridge and a BBC micro:bit you can build a powerful data logger capable of recording large data files onto an SD card.
Being able to easily record large data files unlocks activities and experiments that are not possible with the micro:bit's limited built-in memory and allows for the introduction of real data science into the classroom.
It is very quick and easy to build: the hardware can be assembled in seconds and the code required is provided for you. Get your data logger up and running in three quick, simple steps:
You need the following hardware:
To assemble the hardware:
- Format the microSD card and insert it into the slot on the IM01.
It is not always necessary to format the SD card first, but it is recommended. If you are unsure how to format an SD card the process is explained on this wikihow page. When formatting your microSD card: choose "FAT32" (or "FAT" if FAT32 is not available)
- Slide the micro:bit into the IM01: Make sure they are both facing the right way (more detail on the getting started page).
When connected together your micro:bit and IM01 should look like this:
The video below shows the components being assembled:
The code required to power the data logger is pre-compiled:
- Download the hex file DataLogger v1.06.hex from this folder.
- Flash it onto your BBC micro:bit: connect your micro:bit to your computer then drag and drop the file onto your micro:bit.
For power you can use your micro:bit AAA battery holder or connect a USB cable to either the micro:bit or the IM01. There are also a load of battery pack xChip options that will work (check out the full range here).
With your micro:bit data logger powered up and running:
- press A to start logging data from the micro:bit internal sensors (accelerometer and magnetometer) to a csv file.
- Press A again to stop logging.
- Press A again to continue logging data to the same file.
- While recording data the LEDs on the micro:bit will pulse on and off and a green light will show on the IM01.
- While recording click the B-button to tag a record in the data
- Data is recorded to csv and file sizes of >1gig are possible
- When you are finished take out the SD card and put it into your laptop to access the data on the csv file.
Extending the data logger:
Do you have an XK04 STEM kit? Specifically, do you have an SW01 weather station or SL01 light sensor?
You can add these xChips to the IM01 and the data logger application will auto-detect them. Weather and / or light data will be recorded and added to the csv file.
The image below shows temperature and humidity data recorded over a 12 hour period and includes more than 20,000 data records:
Data logging need not be limited to recording data onto an SD card. If you have access to the Excel Data Streamer and are interested in LoRa peer-to-peer (P2P) communications you might find the video below interesting. By adding LoRa P2P to the data logger it is possible to communicate data over quite large distances:
If you are interested in finding out more about the LoRa add-on for micro:bit please email us on firstname.lastname@example.org
When you power up the circuit you should see the following:
- The blue power indicator on the right hand side of the IM01 turns on.
- The LED on the IM01 may flash blue for a short period.
- The LED on the IM01 will turn a solid blue when it is ready to record.
If you do not see a solid blue light, the first thing you should try is removing the power, then powering it up again (yep, the classic turn-it-on-and-off).
The most common issue that we encounter is with microSD cards that are not formatted in FAT. If you have problems please ensure your microSD card is correctly formatted - there are details further up this page that will help.
The circuit may misbehave if you have a CW01 plugged into it. Remove your CW01 if you are having difficulties.
If you continue to have issues please get in touch and we will try to help: email@example.com:
Find out more about XinaBox and micro:bit on our getting started page.