element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Micro: Bit code club post 3: wearables
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ashutosh_pandey
  • Date Created: 11 Aug 2019 8:16 PM Date Created
  • Views 802 views
  • Likes 7 likes
  • Comments 2 comments
  • join the micro:bit summer code club challenge
  • micro:bit
  • summer code club challenge
  • microbit.
Related
Recommended

Micro: Bit code club post 3: wearables

ashutosh_pandey
ashutosh_pandey
11 Aug 2019

Wearable tech has come a long way from digital watches to fully functional smartwatches that can double up as phones. Fitness tracking in particular has become really important- we live quantified lives. We track the number of calories we eat, the number of hours we sleep and of course, the number of steps we walk. The idea is that once you attach a number to something, it becomes easier to have a progressive overload in that direction. Because the human body adapts so well, each day you need to walk a little farther and work out a little harder to get the same results.

 

At the micro:bit code club here, we started with a basic example given in Microsoft MakeCode - the step counter (Also known as Pedometer) and from there we gave the students total liberty (and a reel of scotch tape!) to see what they could manage to track. And we were in for a surprise!

 

Step Counter

imageimage

 

Above are some of the codes the students tried out for the step counter. One notable thing is that MakeCode gradually moves from giving full blown tutorials to giving instructions and letting students figure things out on their own. The students tried out the step counter, and the watch example, and then combined the codes to switch between the two with the press of a button. The step counter registers a step in response to a shake movement - In a normal micro controller with an accelerometer or IMU like the MPU6050, one would only get raw X,Y,Z acceleration values or at the most - roll, pitch and yaw. It is simply impossible to count repetitions of movements that way unless you see the peaks in a graph and make use of some machine learning algorithm- which is way beyond the scope of what we are trying to do here! But fortunately for us, its very easy to trigger the micro:bit to respond to movements such as tilt left, right, logo up, down etc as seen in the below image.

 

imageimage

We got the pedometer up and running pretty quick. Here is a video of one of our students trying it out!

 

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

 

Pushup Counter

 

Now that the students were done with the step counter example, it was time for them to experiment and see what other exercise they could count. They really enjoy doing pushups (and even compete to do the most pushups!) so they decided to track that. By observing how their upper arms, lower arms, back and chest move during a pushup, and by trial and error, they were able to make a pushup counter. It was a little too sensitive (counted a couple of extra repetitions) and the students are currently trying to make a more accurate version.

imageimage

Here's a video of one student doing pushups with the counter taped to his back!

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

 

Arm Rotation Counter

Perhaps the strangest of the bunch, a couple of students built an arm rotation counter to count the number of times you rotate your arm. This was a very easy example to program for, as they just programmed it to increment the counter by one when the logo/screen faces upwards! here's a video of two students trying their device out, to see who built the better one.

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

 

Overall, it was a fun activity. It wasn't complicated, but the students had a ton of fun horsing about in the computer lab (who thought that could be a good thing!) and learning programming in the process. The next time they play a game on their phone that involves tilt to control, they will hopefully know the principles behind it, which is basically taking data from an accelerometer and analyzing it.


Thank you for reading! Any comments/criticism are welcome!

 

Footnotes:

 

1.) First article: Micro: Bit code club Post 1: Humble beginnings and a game of Hand Cricket.

 

2.) Second article: Micro: Bit code club post 2: Radio communication and Electronic Voting Machines! 

  • Sign in to reply

Top Comments

  • clem57
    clem57 over 4 years ago +1
    Good job all.
  • e14phil
    e14phil over 4 years ago +1
    This is really cool to see, thank you for sharing!
  • e14phil
    e14phil over 4 years ago

    This is really cool to see, thank you for sharing!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 4 years ago

    Good job all.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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 © 2023 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