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
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
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
  • 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: zst123
Date Created: 12 Oct 2021 5:29 AM
Views: 235
Likes: 0
Comments: 2
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

 

 

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:

The full changes are in my Github commit:

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

 

Create a new project in Edge Impulse

 

This will be the project we will forward the data into

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.

 

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.

 

Collect the data

 

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

 

Shake is swinging the device back and forth

 

Flick is a quick turn of the wrist

 

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

 

Training the model

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

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.

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.

 

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

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.

 

 

Conclusion

 

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

Anonymous
Parents
  • BigG
    BigG 7 months ago

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

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • zst123
    zst123 7 months ago in reply to BigG

    Thank you for your kind words!

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Comment
  • zst123
    zst123 7 months ago in reply to BigG

    Thank you for your kind words!

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Children
No Data
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube