Simulink / Matlab Smart Phones Application - Part 2 Real Time Android AHRS with Kalman Filter

Опубликовано: 23 Май 2026
на канале: Alireza Ghaderi
2,993
27

00:00 Introduction
01:30 What is AHRS?
03:25 AHRS vs IMU
05:50 What is Kalman Filter?
08:20 What you need for this?
10:30 Checking your phone Sensors
11:10 Implementing the Project
21:15 Application Output Result
24:35 Conclusion

Link:
----------------------------------------------------------
If you havent watched the last video about setting up your android phone, Watch the last episode of this tutorial in the following link:
   • Simulink / Matlab Smart Phones Application...  
Download Source Code from Mathworks (or search the name in Matlab addons)
https://www.mathworks.com/matlabcentr...

or Download from GitHub:
https://github.com/alireza787b/smartP...



Simulink Support Package for Android Devices:
https://www.mathworks.com/matlabcentr...

Simulink Support Package for Apple iOS Devices:
https://www.mathworks.com/matlabcentr...

Matlab TechTalk "Sensor Fusion Introduction" with Brian Douglas:
https://www.mathworks.com/videos/sens...

Matlab TechTalk "Understanding Kalman Filters"
https://www.mathworks.com/videos/seri...

IMU-sensor-fusion-with-linear-Kalman-filter
https://www.mathworks.com/matlabcentr...
----------------------------------------------------------------------------------------
Attitude and Horizon Reference System (AHRS) application using Onboard smartphone Sensors Linear Kalman Attitude Estimation (AHRS) Using Onboard Smart Phone IMU Version 1

Using this Simulink Model, you can use your smartphone sensors to get raw gyroscope, accelerometer, magnetometer data and estimate the real-time attitude of the phone using Kalman filter. Pitch, Roll, Heading angles and rates.

This project is still in the development phase so use it at your own risk. No noise filtering is done on the output. You can implement different noise reduction algorithms according to your application.
I will Upgrade with better results in near future...

Because I don’t have an Apple development ID, I only uploaded the Android version. But you can easily just change the sensor inputs the iOS version from Simulink support Package for iOS device.

You need to have following items for building this project. MATLAB 2019b or later / Simulink 10 or Later (because of using gauges in application you need 2019b or later) Simulink support package for Android Device (or iOS if you wish) Android Device equipped with Accelerometer , Magnetometer, Gyroscope (IMU)
If you added a feature to this model, or fixed a bug please commit to this git project or send it to me. I will update this project with better features in near future.

Let me know if you have a similar project or need help

E-mail: [email protected]
E-mail: [email protected]
WhatsApp: +989190123481
Telegram: alireza787b
Instagram: Alireza787b