Copying a micro:bit data log into a spreadsheet

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Copying a micro:bit data log into a spreadsheet

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How do you connect a micro:bit to a computer to get its data log?
A Hold it next to the screen
B Plug it in with a USB cable
2. Which file on the MICROBIT drive opens the data log?
A MY_PHOTO.PNG
B MY_DATA.HTM
3. What do you click on the MY_DATA.HTM page to save the readings as a file?
A Download CSV
B Delete log
4. Which file type can a spreadsheet open to show the micro:bit log in rows and columns?
A A CSV file
B An MP3 file
5. After opening the CSV in a spreadsheet, what should you check first?
A The column headings in row 1
B The colour of the cells

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1MY_DATA.HTM AThe file on the MICROBIT USB drive that you open to see the data log and download it as a CSV file
2Download CSV BMICROBIT (drive)
3The micro:bit appears as a USB drive after you connect it with a USB cable CThe column headings were not checked. Row 1 should hold the headings, such as time and temperature, before using the data.
4After downloading, open the data log file in a spreadsheet so the readings fill rows and columns DThe button that saves the logged readings as a .csv file you can open in a spreadsheet
5Open MY_DATA.CSV on the MICROBIT drive EThe file on the drive is MY_DATA.HTM, not a CSV. You open it, then use Download CSV to make the CSV file.
6Open the CSV and start graphing without looking at row 1 Fdatalog.csv

Definitions

MY_DATA.HTM

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
datalogger._______________("time", "temp")
2.
1. Open ___________ on the MICROBIT drive
3.
2. Click the Download ___ button
4.
Check the headings in row _ of the sheet
5.
Connect the micro:bit with a ___ cable

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A 1. Plug micro:bit in by USB
B 2. Open the MICROBIT drive
C 3. Open MY_DATA.HTM
D 4. Click Delete log
Question 2
A 1. Link micro:bit by Wi-Fi
B 2. Open the MICROBIT drive
C 3. Open MY_DATA.HTM
Question 3
A 1. Plug in the micro:bit
B 2. Open the Downloads folder
C 3. Open MY_DATA.HTM
D 4. Click Download CSV
Question 4
A 1. Download the CSV file
B 2. Open Excel or Sheets
C 3. Open the HEX file
D 4. Check the headings in row 1
Question 5
A Open the CSV in a spreadsheet
B Look at row 99 for headings
C Headings should name columns

Answer Key

Copying a micro:bit data log into a spreadsheet
Section A: Quick Questions
Q1
B — Plug it in with a USB cable
Q2
B — MY_DATA.HTM
Q3
A — Download CSV
Q4
A — A CSV file
Q5
A — The column headings in row 1
Section B: Match the Pairs
Q1
MY_DATA.HTM → The file on the MICROBIT USB drive that you open to see the data log and download it as a CSV file
Q2
Download CSV → The button that saves the logged readings as a .csv file you can open in a spreadsheet
Q3
The micro:bit appears as a USB drive after you connect it with a USB cable → MICROBIT (drive)
Q4
After downloading, open the data log file in a spreadsheet so the readings fill rows and columns → datalog.csv
Q5
Open MY_DATA.CSV on the MICROBIT drive → The file on the drive is MY_DATA.HTM, not a CSV. You open it, then use Download CSV to make the CSV file.
Q6
Open the CSV and start graphing without looking at row 1 → The column headings were not checked. Row 1 should hold the headings, such as time and temperature, before using the data.
Section C: Definitions
Q1
MY_DATA.HTM — The file on the MICROBIT USB drive that opens the data log. Use its Download CSV button, then open the CSV in a spreadsheet and check the column headings.
Section D: Fill in the Blanks
Q1
datalogger.setColumnTitles("time", "temp")
Q2
1. Open MY_DATA.HTM on the MICROBIT drive
Q3
2. Click the Download CSV button
Q4
Check the headings in row 1 of the sheet
Q5
Connect the micro:bit with a USB cable
Section E: Spot the Error
Q1
D — The Delete log button erases the readings. To save them as a file you click Download CSV.
Q2
A — The micro:bit is connected to the computer with a USB cable, not Wi-Fi. This is what makes the MICROBIT drive appear.
Q3
B — MY_DATA.HTM is stored on the MICROBIT drive, so you open that drive. The Downloads folder only holds the file after you download it.
Q4
C — A HEX file is the micro:bit program, not the data log. You need to open the CSV file in the spreadsheet.
Q5
B — Column headings are in the first row (row 1) of the spreadsheet, not row 99. Check row 1 to see if the columns are named properly.