Project 24:loT Athlete Running Speed Measuring System

The Internet of Things allows data to break through spatial limits for remote transmission and interaction. In this lesson, we'll build an athlete's running speed test system. With IoT technology, we'll collect and upload starting speed data for coaches to view remotely. We'll master building a multi-node IoT system together. 


Project Objectives


Knowledge Objectives


1.Build a multi-node loT system using the UNIHIKER K10.
2.Understand different lol system architectures.


Practical Objective 


We'll build a multi-node scenario measurement system with the SIoT platform to measure an athlete's speed changes in the starting phase. The measurement results and average speed will be shown on the screen and uploaded to the IoT platform for dashboard visualization. For handheld viewing, we'll use two UNIHIKER K10 boards to remotely transmit and display the motion speed data, max and min values, on the coach's device.

 

Materials List

HARDWARE LIST
2 UNIHIKER K10
2 USB Cable
2 mmwave presence sensor
1 Module Cable

Preparations


Hardware


(1) Set the dip switches on the back of the mmwave presence sensor to the I2C and 0x2A positions respectively.

(2) Connect the mmwave presence sensor to the I2C interface of the UNIHIKER K10 via a module cable, then connect the UNIHIKER K10 to a computer with a USB cable.

Software


Open Mind+, switch to“Upload Mode”, connect the UNIHIKER K10 as shown in the figure below, and load the UNIHIKER K10 library.

Hands-on Practice


Next, we'll complete the athlete's starting speed detection, visualization dashboard design, and corresponding multi-node scenario test system construction via four tasks.
Task 1: Athlete Starting Speed Monitoring
In this task, we'll measure the athlete's starting speed in real time, upload it to the IoT platform, and then view it on the platform.
Task 2: Visualization Dashboard for Speed Change Display&Time Period Control
In this task, we'll design the visualization dashboard and use line charts to show the athlete's starting speed changes. Meanwhile, we'll use switch components to remotely control the measurement's start and stop.
Task 3: Selection of Maximum Speed
In this task, we'll select the athlete's max starting speed through programming, upload it to the IoT platform, and then view it on the platform.
Task 4: Multi-Node Scenario Test System
In this task, we'll design a multi-node scenario measurement system to remotely display motion speed data and its max/min values on the coach's device.


Task 1: Athlete Starting Speed Monitoring


Network Configuration


First, check that your computer and the UNIHIKER K10 are connected to the same wireless network, to ensure they are on the same local area network.

 

Set up the server


Start the SIoT platform program


Download the Windows version of SIoT V2 and extract the SIoT_V2_Win.zip file.
After extraction, double-click start SIoT.bat to launch the new version of SIoT. Once launched, a small black command window pops up to start the server. Don't close it while the project is running, and note your computer's IP address.

Note: It's recommended to turn off all computer firewalls before starting, or external devices may not access.
After starting the server, open your browser, enter the local IP address followed by :8080 (e.g., 192.168.35.1:8080) to access the server login interface.

The login username is siot and password is dfrobot. Enter them to access the SIoT data management interface. The server setup is now complete.


Create a Topic


After successful login, create a new topic named "starting speed" on the SIoT platform webpage.
Note: After creation, double-click the topic name in the label (e.g., siot/starting speed) to auto-copy the full topic name. The full topic name is in the siot/[topic name] format, with "siot/" added auto and no manual entry needed.

Code

  
Let's first load the required graphical libraries: in "Extension" → "Module", search for and load the graphical libraries for Wi-Fi and MQTT.

Next, search for the graphical library named Millimeter Wave Radar Sensor in the Module section, then click to add.

Next, we can complete the code following the logic:connect to the network→MQTT initialization→connect to the server→ subscribe to the topic→set up message reception control.The corresponding code is as follows:

Note: The positive and negative values of the speed detected by the mmwave radar are related to the relative movement direction between the athlete and the sensor. To expand the system's application scope, we take the absolute value of the speed so that the measured speed magnitude is independent of the relative movement direction. 


Run the Code


Click the“Upload”button.  Wait for the upload to complete and then wait a bit. If the network and server connect successfully, the screen show“Network connection successful”and“Server connection successful”in sequence.

Next, open the IoT platform, click“Details”option for siot/starting speed, and check Auto Refresh in the top-right corner.When the athlete starts running in front of the mmwave sensor, the corresponding starting speed can be detected on the IoT platform.The details are shown below:

Task 2: Visualization Dashboard for Speed Change Display & Time Period Control


Code

 
To obtain valid data related to starting speed, we can use the switch in the visualization dashboard to control the start and stop of starting speed detection.
First, we need to create a new topic siot/switch on the SIoT platform to control the start and stop of speed detection, as shown below:

Next, modify the program based on Task 1 to achieve the target function. When the MQTT message received from siot/switch is "on", start detecting the starting speed; when it's "off", stop the detection. We can set a variable num and use the switch to control its change, thus controlling the start and stop of starting speed detection. The specific logic is as follows:

The complete reading code is as follows:

Design the visualization dashboard


After finishing the program, click the plus sign at the top to add an application tab and select dashboard (only available in Mind+ 2.0.5). Then enter the local IP address to enter the Dashboard interface.

Drag the "Image text" from the left "Display Components" to show the starting speed detected by the mmwave radar sensor.

In the Component Properties section on the right side of the interface, configure the settings to enable the component to display the starting speed.The specific steps are as follows:

Next, insert a line chart (in the Chart Components module) to show starting- speed changes more clearly and intuitively. Obtain the max and min starting- speed values from the chart. Then, configure its relevant properties on the right side, as shown below. 


Finally, insert the "Switch" from "Basic Components" to control the start & stop of detection.Specific operations and property configurations are shown below.

The overall design effect of the visualization dashboard is as follows:

Run the Code


Click the“Upload”button.  Wait for the upload to complete and then wait a bit. If the network and server connect successfully, the screen show“Network connection successful”and“Server connection successful”in sequence.

Next, open the IoT platform, click "Details" for siot/starting speed, and check "Auto-Refresh" in the top-right corner. Meanwhile, open the visualization dashboard, click the switch button, and observe the data changes on the IoT platform and the data and line chart changes on the visualization dashboard simultaneously, as shown below.

Note: If the switch on the visualization dashboard can't control the detection, the dashboard may not be properly connected to the SIoT platform. You can reconnect it in the top-right corner of the visualization dashboard. The specific steps are as follows:

Task 3: Selection of Maximum Speed


Code  


First, create a topic named “siot/max starting speed” on the IoT platform to record the max value of each detection result, as shown below:

Next, we obtain several random starting speed values from when the switch is turned on to off. How to find the max starting speed? Set a variable max to achieve this. The specific logic is as follows:

The complete code for reading is as follows:

Run the Code


Click the“Upload”button.  Wait for the upload to complete and then wait a bit. If the network and server connect successfully, the screen show“Network connection successful”and“Server connection successful”in sequence. 
Open the visualization dashboard and IoT platform, then turn on the switch. When an athlete runs past the mmwave sensor, the sensor detects the starting speed, and the topic “siot/starting speed” continuously outputs values. After turning off the switch, you can observe that the topic “siot/max starting speed” outputs the max speed value, as shown below:

Task 4: Multi-Node Scenario Test System


Finally, we'll use two UNIHIKER K10. One (smart terminal) detects an athlete's starting speed in real-time, and the other (mobile terminal) enables the coach to remotely monitor the starting speed in real-time. 
These two UNIHIKER K10 communicate through a server (e.g., a computer), completing the construction of a multi-node scenario test system.The specific connection logic among the three devices is as follows:

Next, we'll design programs for the server, smart terminal, and mobile terminal respectively. Since the smart terminal program design was completed in the previous two tasks, it won't be elaborated on here. 


Server


In this project, we use a computer as the server. Its main tasks are to start the SIoT service and create relevant topics. This function was implemented in previous tasks, as shown below.

Mobile Terminal


Take the second UNIHIKER K10 as the mobile terminal. We'll design a program to display the button status and the detected starting speed on the screen of the mobile terminal.
First, take out the second UNIHIKER K10 and connect the mobile terminal to the server (via Wi-Fi and MQTT). The corresponding code is as follows:

Then, subscribe to the relevant topics, configure the message receiving control logic, and implement the corresponding display functions on the screen. The complete code for reading is shown below:


Note: The smart terminal, server and mobile terminal must be connected to the same wireless network.


Run the Code


Click the“Upload”button.  Wait for the upload to complete and then wait a bit. If the network and server connect successfully, the screen show“Network connection successful”and“Server connection successful”in sequence. 
Open the visualization dashboard and change the switch button status. When an athlete runs past the smart terminal, the mmwave sensor detects the current speed and displays it on the mobile terminal via the server.

Knowledge Base


Next, let's learn and summarize the knowledge used in this lesson.


Composition of IoT Multi-Node Systems


In this lesson, we learned to build an IoT system with multiple UNIHIKER K10. This system usually consists of smart terminals, a server, and mobile terminals. 
√ The UNIHIKER K10, a smart terminal, connects to sensors and actuators for data collection and control. An IoT can support multiple such terminals.
√ Mobile terminals are used for data viewing and remote actuator control. An IoT system can include multiple mobile terminals, such as UNIHIKER K10 boards, computers, and mobile phones.
√ The UNIHIKER K10, acting as the server, manages data storage, sending, and receiving. It only requires powering on and enabling its built-in SIoT service.

The general steps for building an IoT system with multiple UNIHIKER K10 boards are as follows: First, configure the network to connect all IoT system devices to the same network segment. Then, start the SIoT service on the server side. Finally, set up the SIoT connection, subscribe to topics, and send/receive data.

Challenge Task


Based on this project, a new topic will be added. When the mmwave sensor detects the athlete's instantaneous starting speed exceeds 5m/s, the smart terminal will automatically send the "Exceeding Performance" message to this topic. Meanwhile, the coach's mobile terminal can receive and display this prompt in real-time. All original functions like switch control and speed visualization line chart will be retained. Then, complete the debugging and operation of the entire multi - node IoT system. 

icon material.zip 4KB Download(1)
icon project 24.zip 111KB Download(1)
License
All Rights
Reserved
licensBg
0