Someone kicking a soccer ball with a CHARGE power pack and micro:bit on their kicking leg.

Introducing the Kick Power Tracker

Data is a really useful tool to help sports players improve their skill. If your most powerful kick isn’t very accurate, use the data collected by your micro:bit to determine the power level to kick the ball consistently. Make collecting the data easy by using the CHARGE power pack to strap the micro:bit to your leg. 

What you need:

With CHARGE for micro:bit

  • micro:bit (V1 or V2)
  • USB cable
  • Chromebook, laptop, or desktop
  • Access to MakeCode
  • CHARGE w/ wrist strap

Without CHARGE

  • micro:bit (V1 or V2)
  • USB cable
  • Chromebook, laptop, or desktop
  • Access to MakeCode
  • power bank or battery pack
  • wrist strap, clips, or elastic bands

Code your Kick Power Tracker:

  1. Open makecode.microbit.org
  2. Extension drawer: add “Data Logger”
  3. Delete “forever” codeblock
  4. Input -> more drawer: add “set accelerometer range 1g” to “on start” and set 1g to 8g.
  5. Variables drawer: “Make a Variable” and name it something like logging
  6. Variables drawer: add “set logging to 0”  below “set accelerometer”
  7. Logic drawer: grab <false> and drop it onto the 0 in “set logging to 0”
  8. Basic drawer: add “show icon [heart]” below “set logging to false” and change the [heart] icon to an X
  9. Data Logger drawer: add “set columns ___ +” and fill the blank with “strength”
  10. Input drawer: add “on button A pressed”
  11. Copy & paste “set logging to false” place block into “on button a pressed” and change false to true.
  12. Copy & paste “show icon X” place block under “set logging to true” and change the icon to a check mark. 
  13. Copy & paste “on button A pressed” change A to B (it should become full colour again)
  14. In the “B pressed” code, switch True to False and the icon back to an
  15. Data Logger drawer: add “on log full” 
  16. Copy & paste “set logging to false” into “on log full” 
  17. Copy & paste “show icon” and change it to something to represent the micro:bit is full and can’t collect anymore data.
  18. Plug in your micro:bit, pair, download your code and test!

Or experiment with the finished code here:

Use the Kick Power Tracker:

Now attach the micro:bit to your leg, press A to start tracking. Remember to keep track separately or in your head which kicks hit your target (for example, the first and the third out of 4 total kicks went into the net). After you’ve collected some data, head over to a computer to have a look. When you plug in the micro:bit, head over to your file explorer or finder and open the MY_DATA.htm file. This should open in a browser and will allow you to look at the data you’ve collected so far. It will come up as a table of data; to make it easier to read, select “Visual Graph” to see the spikes of acceleration when you kicked the ball. Now compare each of the spikes with each other and if they hit the target.

Make it better:

Can you think of other sports you could wear the CHARGE power pack and micro:bit to collect data? Or sports you could attach the CHARGE and micro:bit to the equipment? 

Side portrait of a kid gearing up to throw a baseball with a micro:bit and CHARGE power pack on his wrist.

How about if you want to track multiple people’s data without needing to download the data after each session? Here’s some advanced code that covers multi-round data logging: 

You can also turn the CHARGE power pack or micro:bit off between rounds. This will continue to put data into your MY_DATA.htm file but the visual graph will only show the first set of data. You’ll have to take your data into another software like Google Sheets or Microsoft Excel to visualize and process the data further.