Traffic survey data logger¶
Uses¶
data logging (V2), touch logo (V2), buttons, LED display
Description¶
Use your BBC micro:bit as a data-logger to survey things you see, like different kinds of traffic or wildlife, or answers to questions.
At the press of a button, the micro:bit records what you have seen and stores the data in a table so you can analyse it later.
Data stays on your micro:bit even if you disconnect the batteries or USB cable, so you can study it when you’re back at your computer.
Basic Task¶
Gather data¶
- Transfer the program below to your micro:bit.
- You can record data anywhere if you unplug the micro:bit from your computer and connect a battery pack.
- A tick appears to show it’s ready to start logging.
- Any previous data is erased when you transfer new code to your micro:bit, but you can also delete any old data by pressing buttons A and B together.
5. Press button A to record when you see a car, button B when you see a motorcycle and press the gold touch logo when you see a truck. TIP: Make sure you hold your micro:bit by the edges so you don’t record any data by accident.
Analyse your data¶
- When you’ve collected your data, plug the micro:bit into a computer. The micro:bit appears like a USB drive called MICROBIT.
- Open the MY_DATA file to see a table of all the traffic you recorded in your web browser.
- The times recorded in the table show the amount of time that passed since your micro:bit was powered on.
You can:
- Add up the total of each column to make your own column or bar chart to visualise your survey data.
- Press the copy button to copy the data so you can paste it straight into a spreadsheet. Use the spreadsheet’s sum function to count the total number of each kind of vehicle.
- Download the data as a CSV (comma separated values) file which you can also import into a spreadsheet.



