활동

Movement data logger

중급 | MakeCode | LED, 가속도 센서, 데이터 로깅, 버튼 | 과학적으로 일하기, 데이터 처리, 불 논리, 센서, 정보 다루기, 측정, 통계 & 그래프

1단계: 만들어 보세요.

프로젝트 소개

Use data logging with your BBC micro:bit V2 to gather accelerometer readings to help design a personalised fitness tracker.

준비물

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

Gather data

• Transfer the code below to your micro:bit, then disconnect it from your computer.
• Connect a battery pack and attach the micro:bit to your shoe or leg.
• Previous data is deleted when you transfer new code to your micro:bit, but you can also delete old data by pressing buttons A and B together.
• Press button A to start logging data. A tick appears on the display. It is now recording accelerometer data ten times every second.
• Start walking and count how many steps you take - try ten to start with.
• In the very unlikely event the micro:bit log becomes full, all the lights on the LED display will light up.
• Press button B to stop logging. You should see an X appear to show it’s stopped.

• Disconnect the battery pack and plug the micro:bit into a computer.
• The micro:bit appears like a USB drive called MICROBIT. Look in there and open the MY_DATA file to see a table of your data and a visual preview in your web browser:
• 가속도 센서로부터 받은 데이터가 3D로 저장되었습니다.
• Click on visual preview to see the data as a graph. Examine it and see if you can spot where the user took ten steps:

Studying this data you can see that almost every time a step was taken, the reading in the Z axis went above 500.

So with this data set, we might use the number 500 as the threshold to use in the Sensitive step counter project, modifying the 'acceleration (mg) strength' block to read 'acceleration (mg) z > 500'.

This means that you've collected data that's unique to the way you walk, and used it to make a personalised digital product that works better for you.