Skip to content

Atividade

Kick strength data logger

Intermédio | MakeCode | Acelerómetro, Registo de dados | A trabalhar cientificamente, Estatísticas & gráficos, Gestão de dados, Lógica Booleana, Medições, Sensores, Tratamento de informações

Passo 1: Faz tu mesmo

O que é isto?

Use your BBC micro:bit to improve your game by collecting sports science data on the strength of kicks or racket strokes.

Introdução

Guia do código

Como é que funciona

This project uses the micro:bit’s accelerometer sensor and data logging feature to log and store data on how hard you kick a ball, or hit a racket, over a short period of time. You can then study the data on a computer to improve your consistency or performance over time, in the same way sports professionals use data science to help improve their performance.

Collecting data

  • Put the code on a micro:bit V2 and attach a battery pack. When you’re ready to collect data, tuck it inside your sock (or strap it to your wrist.)
  • Carrega no botão A para começar a registar dados. The display shows a tick (check mark).
  • Try some different types of moves over a short period of time. For example, spend a couple of minutes taking three penalty kicks, then make three passes.
  • If you see a cross on the display, that means the micro:bit was accidentally reset. Delete the old data by touching the logo, and at the same time hold down button A and press button B. Then press button A to start logging again.
  • Unplug the battery pack when you’ve finished collecting data.

Analysing the data

Plug the micro:bit into a computer’s USB socket.

How the micro:bit's MY_DATA file appears on a Windows computer

Look for the MICROBIT drive on the computer. Double click on the MY_DATA file to see your data in a web browser. Then click on ‘Visual preview’ to view your data on a graph.

A graph showing 3 large spikes and 3 smaller spikes.

The graph shows time along the X axis and the strength of acceleration in the Y axis. This is measured in milli G. The larger the number on the Y axis, the more acceleration that was measured and the stronger your kick.

Can you identify your three penalty kicks and your three passes? Was your strongest kick your most accurate? You could compare your performance and consistency over time, or with other players.

You can download the code from this page and use it straight away. Or, if you want to code the kick strength data logger yourself, watch the coding video above.

Do que é que precisas

  • micro:bit V2 and battery pack
  • computer and micro USB cable for coding the micro:bit and viewing your data
  • our data logging guide may be useful

Step 2: code it

Step 3: improve it

  • Use data from the kick-strength meter to help you and a partner improve the consistency of your passes over a period of time.
  • Collect data over longer periods of time by logging less often. Change the time in the ‘every’ block to a larger number.
  • Add an audible or visual alert if your kick strength goes over a certain value.