element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
micro:bit Blog [PROJECT] BBC Micro:bit – Fitness Tracker aka Step Counter
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join microbit to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 18 Sep 2018 4:37 AM Date Created
  • Views 3237 views
  • Likes 6 likes
  • Comments 0 comments
  • tutorial
  • micro:bit
  • fitness tracker
  • project
  • micro:bit project
  • microbit projects
  • microbit
  • diy
  • beginner micro:bit projects
  • fitness
  • cabeatwell
  • step counter
  • beginner_microbit_projects
  • stem projects
Related
Recommended

[PROJECT] BBC Micro:bit – Fitness Tracker aka Step Counter

Catwell
Catwell
18 Sep 2018

Among the BBC Micro:bit’s onboard sensors is an accelerometer. This can be used for a myriad of applications, but I will use it for the simplest of motion detection – a step-counter!

 

The idea is simple, it detects enough motion and considers it a step.

 

As soon as the system turns on, it will begin “sensing” steps. The current step count will display on the LED matrix screen. The BBC micro library provides functions to recognize various gestures. As I read in some articles, best gesture for a step meter would be a 'shake' in terms of the library.

The software works as follows:

- If 'shake' gesture is recognized then increase a step counter.

- Always show the step counter on the LED's.

 

First, let’s gather all the necessary components you’ll need to build this project.

1x BBC Micro:bit

1x 3 V battery pack - This is for AA cells, feel free to use the AAA one.

2x AA batteries - I am linking the ones I used here.

 

Since to use a step counter you’ll want to be mobile, I am recommending a battery pack. I used 2x AA rechargeable batteries out of curiosity; if rechargeable AA cells are usually at 1.2V, will it be enough to power everything at 2.4V or less, without issues? --- The answer is, yes, it’s fine.

 

Video demonstration of the project:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

STEP 1

Load the code onto the Micro:bit.

 

I am providing the hex file you need to drag and drop onto the Micro:bit, and the python code as two separate files. For the below process, just use the hex file.

 

Plug the MicroUSB cable into the Micro:bit, and plug the other end of the cable to a PC or MAC.

 

At this point, you are going to copy over the code to the Micro:bit. I am providing the program (code) in this posts that needs to be copied over. When the Micro:bit plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit, like it’s a USB Flash Drive, and the Micro:bit will reset, and the program is active.

 

After it resets, remove the Micro:bit from the PC and take it to wherever you have that battery holder.

 

A little bit about the code:

I commented the code enough to figure out I think. The program itself is rather straight forward:

image

I used the application "Notepad++" to write this, in case you were wondering.

 

STEP 2

Insert the batteries into the battery holder, and plug said holder into the Micro:bit.

If everything is ok, it will turn on and display a zero. It is ready to could steps.

imageimageimage

 

STEP 3

To get “steps” to show up, it definitely needs a hardy shake. You can shake it by hand and see the counter go up.

 

If you are running, I recommend putting the Micro:bit and battery pack into some sort of medicine bag you wear around your neck. Otherwise, you might have to attach it to your ankle or wrist somehow.

imageimage

 

STEP 4

The system will count steps until you turn it off, or it runs out of power. I had it on for several hours, curious how long the rechargeable batteries would last. I assume it would go beyond a few hours for sure.

 

Conclusion

It’s simple and to the point. However, this isn’t just a way to count steps. It could also be used to count any sort of motion.

 

- Attach it to a door and keep track of the number of times it was opened.

- Filing cabinet, desk drawers, anything that moved could be counted.

- Place inside your lunch bag, see how many times your sandwich was handled!

 

Imagination is the limit.

 

http://twitter.com/Cabe_Atwell

Attachments:
Microbit fitness tracker.zip
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube