Cervical Spine Health Assistant Based on Orientation Detection

1.1 Project Introduction

This project aims to design an intelligent cervical spine health monitoring device, inspired by the common issue of neck discomfort caused by prolonged screen use among modern people. This is not just a basic face recognition project: it uses the face orientation detection function of HUSKYLENS 2 to accurately capture the user's head pose angles. Then, based on these angle data, it will determine whether the user has maintained the same posture for a long time. If the duration of maintaining that posture exceeds the set threshold, it will send a reminder and guide relaxation exercises to help users relieve neck tension and develop a healthy lifestyle.
You can place this compact cervical spine health guardian on your office desk, study desk, or next to your home computer. From face orientation recognition and posture timing to reminder and relaxation guidance, this project fully demonstrates the accessible implementation and practical applications of Artificial Intelligence and embedded hardware in the healthcare field, turning ordinary hardware into a device that can sense, care, and deliver greater practicality!

1.2 Demo Video

2. Project Implementation Principle

When operating in Face Orientation Detection mode, the HUSKYLENS 2 AI camera sensor captures facial images in real time via its built-in algorithm, performs feature extraction, and returns the facial pitch angle (up-down angle) and yaw angle (left-right angle) data. This data is transmitted to the micro:bit main controller through I2C communication.
After receiving the data, the micro:bit runs calculations. If the user remains stationary for an extended period, it will remind the user to start moving, and count the number of cervical spine movements. Once the activities are completed, the system will return to the detection state to safeguard the user's cervical spine health. The detection logic follows the workflow: continuous monitoring → anomaly alert → cycle reset.

3. Hardware and Software Preparation

3.1 Equipment List

3.2 Upload Materials

Connect your HUSKYLENS to your computer using a USB data cable. A connection diagram is provided below:

Once the connection is successful, "HUSKYLENS" will appear in This PC. Navigate to the path HUSKYLENS → storage → audio, then drag and drop the audio materials required for your project into this folder. (Required audio assets are available in the attachment.)

3.3 Hardware Connection

Make connections by referring to the diagram below.

Note: Please ensure the battery has sufficient power. If powering via an alternative expansion board, please confirm the supply voltage is 5V.


3.4 Software Preparation

Download and install the Mind+ installation package(Version 2 or above) from the official website. Double-click to open it after installation.


4. Project Making

4.1 HUSKYLENS 2

First, select the protocol type for HUSKYLENS 2.
Tap System Settings → Protocol Type → select I2C communication mode, then return to the main menu interface.

Second, swipe the screen to find the "Orientation Detection" function.


Point the HUSKYLENS 2 at a human face. When a human face is detected, the screen will mark the detected face with a white bounding box and display the angle information of the face orientation.

After pointing the HUSKYLENS 2 camera at a face, press the Button A in the top-right corner to learn this face orientation. HUSKYLENS 2 will assign a unique ID to each learned face orientation according to the learning sequence, and display the recognition confidence.

For more detailed usage of HUSKYLENS 2, please refer to the following URL: https://wiki.dfrobot.com/sen0638/docs/23748

Use the HUSKYLENS 2 to learn head-up and head-down postures, save them as ID1 and ID2, then start coding to build a cervical spine health assistant based on orientation detection.


4.2 Programming

Open the programming software Mind+, choose "Coding" mode, then click "Upload Mode" to create a new project.

First, you need to add the corresponding extensions in Mind+, including micro:bit and HUSKYLENS 2.


Go to the "Extensions" page, click "Board" and search for "micro:bit".


Click the "Download" button on the extension pack and wait for the download to complete.

Click the extension pack to complete the loading process.

Click "Module", search for "huskylens", and load the user library "HUSKYLENS 2 AI Camera", following the same steps as loading "micro:bit".

Click the "Back" button to return to the programming interface.

Click "Connect" in the "Device Connection" panel.

The successful connection screen is shown below: click the "×" to return.

After your device is successfully connected, write the program as follows:

The analysis of the core code is as follows:


There is a complete program file for this project in the attachment.
Open Project→Open Local File to load project.


Select the project in the attachment and click "Open".


Click "Upload" to run the program.


The effect is as follows:

5. Attachment

icon Attachment (2).zip 50KB Download(0)
License
All Rights
Reserved
licensBg
0