Thursday, February 27, 2025

AI-Powered Gesture Detection Using Edge Impulse

- Advertisement -
Electronics For You Tested DIY

Artificial intelligence for gesture recognition and classification has transformative potential across industries, from healthcare to manufacturing and consumer devices. It enables tasks like motion tracking in smartwatches, anomaly detection in machinery, and vehicle predictive analysis.

Implementing AI on compact devices like the IndusBoard Coin—a 3cm innovation with built-in sensors—demonstrates how these capabilities can be brought to edge devices with limited resources.

Bill of Materials
ComponentsQuantity
IndusBoard Coin1
USB C-type cable1

We create a simple model for gesture detection, designed to classify motions commonly used in smartwatches, phones, and exercise-related devices. The model is optimised to run efficiently on a microcontroller (MCU), overcoming constraints like limited RAM and storage while delivering reliable AI performance.

- Advertisement -

Only a few components, detailed in the accompanying table, are needed to build the device. Fig. 1 shows the prototype testing setup, showcasing how AI can seamlessly execute tasks on the edge.

Gesture Recognition Using Edge Impulse
Fig. 1: Prototype testing setup for AI-Powered Gesture Detection Using Edge Impulse

An online tool named Edge Impulse was used to collect the data, train a machine-learning model, and deploy it on the IndusBoard MCU. An Edge Impulse account must be created using this link. The developer and student mode offers a free account, while the enterprise version is available for factories or industrial use.

After creating an Edge Impulse account, the Edge Impulse Data Forwarder must be installed on the PC. For macOS, Linux, or Windows, the installation can be completed using the terminal (cmd for Windows) by running the following commands sequentially:

- Installing Node.js:
node -v
npm -v
- Installing Edge Impulse CLI:
npm install -g edge-impulse-cli
- Setting up the Data Forwarder:
edge-impulse-data-forwarder

Connecting IndusBoard Coin to Edge Impulse

The IndusBoard Coin must be connected to Edge Impulse to collect sensor data. The data forwarder code is required for this purpose.

The code must be modified to extract data from the relevant sensor for other sensors like light, environment, air quality, or similar. In the loop, sensor data can be sent to the serial port. For multiple sensor values, each can be separated using:

Serial.print(‘\t’);

For example, accelerometer data with three values (x, y, z axis) can be separated after each axis data using:

Serial.print(‘\t’);

The data forwarder code should be prepared and modified according to the requirements. The code can be downloaded from electronicsforu.com. Detailed guidance on the data forwarder code is available at Edge Impulse CLI – Data Forwarder. Fig. 2 shows the Edge Impulse data forwarder code.

Edge Impulse data forwarder code
Fig. 2: Edge Impulse data forwarder code

After uploading the data forwarder code and the IndusBoard to your laptop’s USB port, open the terminal for Linux or macOS (Cmd for Windows), then run the following command. For macOS and Linux, you might need to use sudo for superuser access, but it is not needed for Windows:

edge-impulse-data-forwarder --clean

Then, the system prompts the email ID to log in, followed by a request for the password. A list of models associated with the account is displayed, allowing the selection of the desired model to connect to.

The process involves detecting the computer’s hardware. If successful, the system automatically connects. If not, a list of available ports is displayed, prompting the selection of the correct one.

Next, the system detects sensor values from the IndusBoard. If multiple values exist, the system requests their names, separated by commas. For instance, the ACC sensor provides three-axis values. Input “x, y, z” in the terminal (see Fig. 3). Fig. 3 shows Edge Impulse connecting with IndusBoard using the data forwarder in the terminal.

Edge Impulse connecting with IndusBoard using the data forwarder in the terminal
Fig. 3: Edge Impulse connecting with IndusBoard using the data forwarder in the terminal

Collecting Dataset

OOPS! THIS IS EFY PRIME CONTENT...
which means that you need to be an EFY PRIME subscriber to read it.

EFY PRIME content is our best content. Hence, you need to make a small investment to access all of our content including EFY Prime content.

If you're already an EFY PRIME member, feel free to login below.

Else, CLICK HERE to invest in an EFY Prime account and become our VIP customer who can access all our content, and that too without the clutter of ads!

BENEFITS OF EFY PRIME MEMBERSHIP:
(1) Zero Clutter AD free experience
(2) Super-fast user experience
(3) Focussed reading experience with no distractions
(4) Access to all our content including our Best-of-Best which is EFY Prime

SHARE YOUR THOUGHTS & COMMENTS

Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.