micro:bit Traffic Survey Data Logger

In this activity, students use the BBC micro:bit as a data logger to collect real-world observational data—most commonly by recording types of traffic such as cars, buses, and trucks. With a simple program, students press different inputs (buttons or touch sensor) to log each observation, which is automatically stored in a structured data table on the device.

Grade Levels: 3 - 8
Subject Matter: Algorithms, Data Science, Physical Computing, Programming, Cross-Curricular Integration: Math, Cross-Curricular Integration: Science
Concepts: Programs and Algorithms, Computing Devices and Systems, Data and Information
Standards: 6-8.PA.2, 6-8.CD.1, 6-8.CD.2, 6-8.CD.3, K-2.PA.1, K-2.PA.2, K-2.PA.3, K-2.PA.4, 3-5.PA.2, 3-5.PA.3, 6-8.PA.1, 3-5.CD.2, 6-8.PA.3, 3-5.DI.1, 3-5.DI.2, 3-5.DI.4, 3-5.DI.5, 6-8.DI.1, 6-8.DI.2, 3-5.CD.1, K-2.CD.2, K-2.DI.3, K-2.DI.2, K-2.DI.1
  • Average Rating: 0.0 (0 ratings)

Activity Instructions

  1. Introduce the Activity
    • Discuss:
      • How do cities know how many cars drive on a road each day?
      • Who collects that data?
      • How could we collect it ourselves?
    • Today, we are going to become data scientists and collect real-world data using the BBC micro:bit.
  2. Introduce Data Logging
    • Data logging means collecting and storing data over time using a device. Instead of writing things down, your micro:bit will record and store the data for you.
    • Optional: Watch what is data logging BBC video
  3. Code & Load the Program
    • The program below uses three vehicle categories: car, bus, truck. If you would like to change those categories make sure to change it throughout the entire program.
    • Walk students through creating the following code or use the provided link to share the completed code with students.
  4. Collect Data
    • Now it’s time to gather real data. Data can be collected anywhere using battery power, spread out to all can observe the area.
    • Instruct Students to:
      • Move to observation location
      • Watch traffic (or another category if remixed)
      • Press buttons/logo to log observations
    • Tips:
      • Be consistent
      • Record accurately
      • Avoid accidental presses
  5. Retrieve & View Data
    • Let’s see what your micro:bit recorded.
    • Instruct students to:
    • Plug micro:bit into computer
    • Open the MY_DATA file
    • View table of results
  6. Analyze & Visualize Data
    • Now we clean, transform, and analyze your data.
    • Discuss:
      • What graph would make the best graph for this data?
      • Which type of vehicle was most common?
      • When did most traffic occur?
      • What trends do you notice?
    • Identify areas of data to be cleaned:
      • Avoid accidental presses, etc.
    • Identify patterns
  7. Discuss & Interpret
    • What did your data show?
    • Were you surprised by the results?
    • How reliable is your data?

Assessment Opportunities

Reflection

  • How did the micro:bit help you collect data?
  • Why is digital data collection useful?
  • What would you investigate next?

Extension Opportunities

  • The project can be adapted to many different types of surveys. Students can:
    1. Survey different data:
      • Wildlife
      • School transportation methods
      • Recycling types
    2. Export data to spreadsheets
    3. Create more advanced graphs
    4. Compare results across groups
    5. Present findings to an audience

Elements of this resource were created by BBC micro:bit, then curated by the team at Nextech.

Learn More