Articles

Human Fall Detection System using RDK X5 D-Robotics

Last Updated on September 11, 2026 by Engr. Shahzada Fahad

Description:

Human Fall Detection System using RDK X5 D-Robotics – What if your system could and react in real time?



Human fall detection system detecting a fall instantly using AI body tracking
Human fall detection detects a fall instantly in real time.

Today, I am building a Fall Detection System using AI on the powerful RDK X5,




RDK X5 by D-Robotics development board for AI and robotics applications
RDK X5 by D-Robotics powers real-time AI and robotics applications.

 Combined with a MIPI camera for real-time vision.



MIPI camera connected to RDK X5 for real-time AI vision and human fall detection
MIPI camera with RDK X5 for real-time AI vision and fall detection.

And when a fall happens… this system can trigger anything;

A buzzer, LED, email alert, or even a complete emergency response system.

So in this project, we are using AI body tracking with keypoints to detect when a person falls or lies down.



AI body tracking system for real-time human fall detection
AI body tracking enables real-time human fall detection.

For demonstration, I will turn ON an LED when a fall is detected.

But you can easily upgrade this into a smart healthcare system or home safety system.



Human fall detection indicator showing a fall detected alert
Human fall detection indicator alerts when a fall is detected.

Now let’s build it step by step.

Amazon Links:

RDK X5

RDK Stereo Camera

USB Camera

HDMI Screen

Keyboard and Mouse

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

For this project, I am using an LED; but you can connect anything you want.

For example:

A buzzer

A relay module

Or even trigger another circuit

So whenever a fall is detected…

The GPIO 37 pin will go HIGH and activate your device.

Simple… but very powerful

STEP 1 – CREATE PROJECT FOLDER

First, open the terminal and create a project folder:




RDK X5 terminal creating a project folder for human fall detection
Creating the human fall detection project folder in the RDK X5 terminal.

mkdir -p ~/Desktop/fall_project

STEP 2 – NUCLEAR FIX (VERY IMPORTANT)

Now before anything… we need to apply something called the Nuclear Fix.

Why this is needed?

By default, the AI system sometimes does NOT give body keypoints like shoulders and hips.

And without these… fall detection is impossible.

So this fix forces the system to:

Always enable keypoints detection

Think of it like this:

Without fix → system is blind ❌

With fix → full body tracking ✅

That’s why I call it Nuclear Fix; it overrides everything.

Nuclear fix on RDK X5 enabling body keypoints for human fall detection
Nuclear fix enables body keypoints on the RDK X5 for human fall detection.

Now copy and paste the command I provided.

Nuclear fix:

# 1. Define the Keypoint Configuration (The new settings)

JSON_CONTENT='{

  “model_file_path”: “multitask_body_head_face_hand_kps_960x544.hbm”,

  “dnn_Parser”: {

    “pixel_prob_threshold”: 0.5,

    “kps_pos_distance”: 5.0,

    “kps_neg_distance”: 5.0,

    “enable_kps”: 1

  }

}’

# 2. Back up the original file (Just in case)

sudo cp /opt/tros/humble/lib/mono2d_body_detection/config/iou2_method_param.json /opt/tros/humble/lib/mono2d_body_detection/config/iou2_method_param.json.bak

# 3. Overwrite the Standard Detection Config

# This uses ‘sudo bash -c’ to write directly into the protected system folder

sudo bash -c “echo ‘$JSON_CONTENT’ > /opt/tros/humble/lib/mono2d_body_detection/config/iou2_method_param.json”

# 4. Overwrite the “Euclid/Tracking” Config (Double Tap)

# This ensures that even if the robot switches modes, it still uses our settings

sudo bash -c “echo ‘$JSON_CONTENT’ > /opt/tros/humble/lib/mono2d_body_detection/config/iou2_euclid_method_param.json”

echo “✅ NUCLEAR FIX APPLIED: System defaults now force Keypoints ON.”

After this step, your AI is ready for fall detection.

STEP 3 – CREATE FALL DETECTION CODE

Now create the main file:



Creating the main human fall detection file on the RDK X5
Creating the main fall detection file on the RDK X5.

nano ~/Desktop/fall_project/fall_node.py

Copy and paste this code:

Let me quickly tell you; what this code is doing

It reads body keypoints

Finds:

Shoulders midpoint

Hips midpoint

Then it compares:

Body height (vertical)

Body width (horizontal)

Main logic:

If body is vertical → standing

If body becomes horizontal → fall detected

This line is the brain of the system:

if horizontal_len > vertical_len:

Means the person has fallen or is lying down

And this turns ON the LED:

GPIO.output(ALARM_PIN, GPIO.HIGH)

STEP 4 – CREATE START SCRIPT

Now let’s create another file:



Creating another file for the RDK X5 human fall detection system
Creating another file for the RDK X5 human fall detection system.

command:

nano ~/Desktop/fall_project/start_clean_fall.py

Copy and paste this code:

This script

Starts the AI detection system

Cleans previous processes

Runs your fall detection code smoothly

So you don’t have to run multiple commands manually.

Alright… now everything is set.

Let’s go ahead and close this file and any other open windows, because our project is now fully ready.

STEP 5 – RUN THE PROJECT

To run this project, first make sure you are on the Desktop…



RDK X5 desktop with terminal open for the human fall detection system
Opening the terminal on the RDK X5 desktop for human fall detection.

Then open the terminal…

Opening the terminal on the RDK X5 for the human fall detection system
Opening the terminal on the RDK X5 to set up the fall detection system.

And now we are going to start the entire system

Command:

source /opt/tros/humble/setup.bash

This command Loads all ROS2 and AI environment settings

RDK X5 terminal command loading the ROS2 environment and AI settings
Loading all ROS2 and AI environment settings on the RDK X5.

Command:

python3 ~/Desktop/fall_project/start_clean_fall.py

This second command:

Second command running the human fall detection system on the RDK X5
Running the second command to start the RDK X5 human fall detection system.

Starts the whole system:

  • AI detection
  • Body tracking
  • Your fall detection logic

STEP 6 – OPEN DASHBOARD

Now open this in your browser:

RDK X5 live video streaming dashboard opened in a web browser
Opening the RDK X5 live video stream in a web browser.

What this does:

Shows live camera feed




RDK X5 displaying a live camera feed for real-time human fall detection
RDK X5 displaying the live camera feed for human fall detection.

Displays AI body detection

RDK X5 BPU displaying AI body detection for human fall detection
RDK X5 BPU displaying AI body detection for real-time human fall detection.

You can visually see:

Person detection

Body movement

AI body movement and skeleton detection for human fall detection
Body movement and skeleton detection using AI body keypoints.

This is very useful to:

Debug the system

See how AI is tracking your body

FULL DEMO (REAL-TIME TEST)

Alright… now comes the most exciting part; let’s actually test this system in real time.

So right now; I am just standing normally in front of the camera.

Person standing normally in front of the RDK X5 camera for human fall detection
Person standing normally in front of the RDK X5 camera during fall detection testing.

Nothing special.

And if you look at the system; it clearly understands that I am standing.

Why?

Human body skeleton monitoring with a vertical body position and shoulders above the hips
Human body skeleton monitoring shows a vertical standing position.

Because my body is vertical, my shoulders are above my hips, and the height of my body is greater than its width.

So the system says: “OK – Standing”

And you can see… the LED is OFF. Perfect.

RDK X5 LED-based human fall detection system detecting a person falling
RDK X5 LED indicates a detected fall in real time.

Now let’s take it to the next level; I am going to simulate a fall.

Watch carefully…

As I fall… and lie down on the floor…



Person lying down on the floor during a human fall detection test
Human fall detection identifies a person lying down on the floor.

Now my body position completely changes.

Instead of being vertical; my body becomes horizontal.

Now the width of my body is greater than its height.

And boom

Human fall detection system reacting instantly when a fall is detected
Human fall detection system reacts instantly when a fall is detected.

Instantly the system reacts:

Fall detected

LED turns ON

No delay… no confusion…just real-time fall detection.

So this is how you can build a real-time AI fall detection system.

You can extend this project by:

Sending alerts

Triggering alarms

Connecting to IoT or cloud

And if you want the full project…

You can download the complete source code, all resources, and a detailed step-by-step document from my Patreon.

I have explained each and every command, so you can easily build this project without any confusion.

Go check it out… and start building

So, that’s all for now.

Support me on Patreon:

If you enjoy my work and find these projects helpful, please consider supporting me on Patreon. With just $1, you can get access to all project source codes, schematics, and extra resources that I share with my supporters. Your support helps me continue creating new electronics tutorials, experiments, and open projects for the community. Thank you so much for being part of this journey and for supporting my work!

Watch Video Tutorial:

AI Detected My Fall Instantly Real Time Test! RDK X5


Discover more from Electronic Clinic

Subscribe to get the latest posts sent to your email.

Engr. Shahzada Fahad

Engr. Shahzada Fahad is an Electrical Engineer with over 15 years of hands-on experience in electronics design, programming, and PCB development. He specializes in microcontrollers (Arduino, ESP32, STM32, Raspberry Pi), robotics, and IoT systems. He is the founder and lead author at Electronic Clinic, dedicated to sharing practical knowledge.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Discover more from Electronic Clinic

Subscribe now to keep reading and get access to the full archive.

Continue reading

Electronic Clinic
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.