user-img

Mirko Pavleski

  • 101 Projects
  • 26 Followers
  • Jun 18,2026
+ Follow

DIY Avionics Simulator with ESP32 - Artificial Horizon

The project successfully demonstrates the integration of graphical user interfaces, I2C sensors, and the ESP32-S3 microcontroller into a compact avionics instrument simulator.

DIY Avionics Simulator with ESP32 - Artificial Horizon
 
  • thumbnail-img
 

Hardware Components

  • CrowPanel 2.1-inch HMI ESP32 Rotary Display

    X 1
  • 6 DOF Sensor - MPU6050

    X 1
  • QMC5883L/HMC5883L magnetic compass sensor

    X 1

Tools, APP Software Used etc.

  • soldering kit

  • Arduino IDE (programming)

Story

 The inspiration for this project comes from classical aircraft cockpit instruments used for navigation, orientation, and flight monitoring. In aviation, instruments such as the Artificial Horizon, Magnetic Compass, Altimeter, and Attitude Indicators play a crucial role by providing pilots with real-time information about the aircraft's orientation, heading, and altitude.

Detailed video instructions at:  https://youtu.be/9daBKkZEftE

The system is built around the CrowPanel 2.1-inch HMI ESP32 Rotary Display, which integrates an ESP32-S3 microcontroller, a 480×480 pixel IPS round display, a rotary encoder with push-button functionality, and expansion interfaces for external peripherals. 

These features make the module particularly suitable for the implementation of compact instrumentation and graphical control systems.

The MPU6050 six-axis accelerometer and gyroscope module provides information about the pitch and roll orientation of the model. These measurements are processed and converted into graphical movements on the display.

 In addition, support for a QMC5883L/HMC5883L magnetic compass sensor was implemented to provide heading information for the compass instrument.

  Artificial Horizon Instrument:

 The first instrument implemented is the Artificial Horizon, also known as the Attitude Indicator. It displays a blue upper area representing the sky and a brown lower area representing the ground. The MPU6050 sensor continuously measures the pitch and roll angles of the model, and these values are used to dynamically rotate and shift the horizon line. A fixed yellow aircraft symbol remains centered on the display while the horizon moves relative to the aircraft, closely replicating the behavior of a real aviation attitude indicator. Additional visual elements include pitch reference marks, a horizon scale, a virtual runway representation, and a roll-angle indicator located at the top of the instrument. When the nose of the model is raised, the horizon moves downward on the display. Conversely, when the nose is lowered, the horizon moves upward. Rolling the model left or right causes the entire horizon to rotate accordingly.

  Magnetic Compass Instrument:

The second instrument is a graphical magnetic compass. It consists of a circular compass card displaying cardinal directions and angular markings around its circumference. A fixed aircraft symbol is positioned at the center of the display, while the compass card rotates according to heading information obtained from the magnetic field sensor. Although the current implementation serves primarily as a simulator rather than a precision navigation device, it demonstrates the integration of a digital magnetometer via I2C communication and the graphical representation of heading information on a circular display.

  Altimeter Instrument:

 The third instrument is an analog-style aircraft altimeter inspired by traditional mechanical altitude indicators. It features a circular scale and two pointers similar to those found in a clock mechanism. The simulated altitude is initialized at 6300 feet and then dynamically changes according to the pitch angle measured by the MPU6050 sensor. Raising the nose of the model gradually increases the indicated altitude, while lowering the nose decreases it. The rate of altitude change is proportional to the measured pitch angle, creating a realistic simulation of aircraft climb and descent behavior. This approach demonstrates how sensor data can be transformed into meaningful aviation-style instrument indications without requiring an actual altitude sensor.

  Aircraft Attitude Visualization Screen:

A fourth display mode was implemented to provide a direct graphical representation of the MPU6050 measurements. This screen displays a simplified aircraft model that rotates according to the measured roll angle and moves vertically according to the pitch angle.

This visualization serves both as a demonstration and as a diagnostic tool, allowing easy verification of sensor operation and aircraft orientation in real time.

  User Interface and Control:

 The rotary encoder integrated into the CrowPanel module is used for adjusting display backlight brightness through PWM control. The encoder push-button allows the user to switch between the different instrument screens, transforming the device into a multifunction avionics display. This approach provides an intuitive and practical user interface while requiring minimal external hardware.

  Software Architecture:

The software was developed using the Arduino framework for ESP32-S3. Graphics are rendered using the Arduino_GFX library together with a custom framebuffer implementation, enabling smooth drawing of circular instruments and dynamic graphical elements. The program structure is organized around multiple display modes, each represented by a dedicated drawing function. This modular approach simplifies future expansion and maintenance of the code. Additional instruments can easily be added by implementing new display screens and linking them to the existing menu system. Sensor acquisition, graphical rendering, user input handling, and display updates are executed in separate logical sections of the program, improving code readability and scalability.

  Conclusion:

 The project successfully demonstrates the integration of graphical user interfaces, I2C sensors, and the ESP32-S3 microcontroller into a compact avionics instrument simulator. 

This CrowPanel Display proved to be an excellent platform for this type of application thanks to its integrated circular display, rotary encoder, processing power, and expandability through external sensors.

 

Code

DIY Avionics Simulator with ESP32 - Artificial Horizon

The project successfully demonstrates the integration of graphical user interfaces, I2C sensors, and the ESP32-S3 microcontroller into a compact avionics instrument simulator.

10
 
0
0
0

Share your project on social media to expand its influence! Get more people to support it.

  • Comments( 0 )
  • Like( 0 )
/1000
Upload a photo:
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

You May Also Like

View All
Add to cart
Board Type : GerberFile :
Layer : Dimensions :
PCB Qty :
Different PCB Design
PCB Thickness : PCB Color :
Surface Finish : Castellated Hole :
Copper Weight : 1 oz Production Time :
Total: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.

PCB Assembly

PCBA Qty: BomFile:
NO. OF UNIQUE PARTS: NO. of Components:
Country: Shipping Way:
Assembly Cost: US $
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
3dPrintingFile : Size :
Unit : Volumn :
3D Printing Qty : Material :
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Acrylic Type : AcrylicFile :
Dimensions: Engrave:
Acrylic Qty :
Acrylic Thickness:
Acrylic Color:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
CNC Milling File : Size:
Unit: Volumn:
CNC Milling Qty : Material:
Type of Aluminum: Surface Finish:
Tolerance:
Surface Roughness:
Total: US $12.99
As a sharing platform, our community will not bear responsibility for any issues with this design and parameters.
Add to cart
Item Price Qty Subtotal Delete
Total: US $0.00
Certified Product | Guaranteed Purchase: Full techsupport