element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
  • Settings
Low Power IoT Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Low Power IoT Design Challenge
  • More
  • Cancel
Low Power IoT Design Challenge
Blog Wearable Gesture Control - #4 Collecting data for Edge Impulse
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: zst123
  • Date Created: 12 Oct 2021 5:29 AM Date Created
  • Views 1195 views
  • Likes 1 like
  • Comments 2 comments
Related
Recommended

Wearable Gesture Control - #4 Collecting data for Edge Impulse

zst123
zst123
12 Oct 2021

Table of Contents

Wearable Gesture Control - #1 Introduction

Wearable Gesture Control - #2 Install & Setup Template Application

Wearable Gesture Control - #3 Integrating LCD & Accelerometer

Wearable Gesture Control - #4 Collecting data for Edge Impulse

Wearable Gesture Control - #5 Deploying Edge Impulse model & Fixing Makefile issues

Wearable Gesture Control - #6 BLE communication with an app

Wearable Gesture Control - #7 Low Power Profiling

 

See all my posts here

 

In this blog, we will be collecting our gesture data so that we can train our model on Edge Impulse. Firstly, we will create a data forwarder so that we can send the data. Next the data is collected and trained to create a model.

This is the process of data forwarding

 

image

 

PSoC code for data forwarding

 

If the user button is pressed upon turning on the device, it will go into a section of the code for Data forwarding mode. It consists of an infinite loop where it readings (x, y and z axis)to the serial UART console.

To summarize, we are sampling the sensor at 100Hz which will be the data sent to Edge Impulse.

 

Here is a snippet of the code:

image

The full changes are in my Github commit:

  • https://github.com/zst123/Element14_Low-Power-IoT/commit/fa9ebb7eb5c7b60d6ef6cf7a204d50c040249829

image

 

Create a new project in Edge Impulse

 

This will be the project we will forward the data into

image

Install command line tools for data forwarding

Now that we have the board sending data over serial, we need to forward it using Edge Impulse's command line tool.

 

The instructions are found here on their official page:

  • https://docs.edgeimpulse.com/docs/cli-installation

 

Set up the tools according to their instructions too

  • https://docs.edgeimpulse.com/docs/cli-data-forwarder

 

Plug in the board and run the command (edge-impulse-data-forwarder).

In my case, it prompted for my username, password and project name.

The 3-axis data is detected and I named it as x,y,z respectively.

image

 

Click on the link as shown in the command line, or visit your project devices page. On Edge Impulse, the device has been recognized successfully.

image

 

Collect the data

 

Under data acquisition, I did the data collection. I collected 20 seconds flick, 20 seconds shake and 20 seconds idle.

image

 

Shake is swinging the device back and forth

imageimage

 

Flick is a quick turn of the wrist

imageimage

 

Lastly, idle is simply placing the device on the table without touching it.

image

 

Training the model

I left most settings of the model as the default recommendation. For your reference, this is my impulse settings.

image

On the next page, generate the features. We can see that the 3 classes are very spaced apart in the graph, so there should be no problems in our model.

image

Lastly, I trained the classifiers and the accuracy is 100%. There may be problems due to the limited amount of data, and the model has probably overfitted to the data. However, I think I will proceed with this for the purpose of this project as a proof of concept.

image

 

Live classification of the model

 

Now we have the model trained, I plugged in the board with the data forwarding again. We will be checking if we can classify gestures properly with this model. I started the testing sample and did a flick gesture

image

These are the results. You can see that the flick gesture was detected successfully in the middle section, and the sections before and after are detected as idle.

 

imageimage

 

Conclusion

 

With the model up and running, in the next blog, I will deploy the model code to the PSoC 6 board.

  • Sign in to reply
Parents
  • BigG
    BigG over 3 years ago

    Excellent blogs so far. They've been an enjoyable read and I found them all very easy to follow. Great effort.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • zst123
    zst123 over 3 years ago in reply to BigG

    Thank you for your kind words!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • zst123
    zst123 over 3 years ago in reply to BigG

    Thank you for your kind words!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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