Firmware Programming

GUI Design for Embedded Systems (Including Embedded Android)

How to design embedded GUIs: choosing MCU, Linux or Android, framebuffer memory, GUI libraries like LVGL and TouchGFX, UI design, optimization and embedded Android.

On this page
  1. Start with the platform decision
  2. Display hardware basics
  3. GUI libraries for microcontrollers
  4. GUI options on embedded Linux
  5. Designing the UI itself
  6. Performance and memory optimization
  7. Embedded Android development
  8. A common architecture: MCU for control, Android or Linux for UI
  9. Testing embedded GUIs

A graphical interface is often the part of an embedded product that users judge first, and it can also use the most memory and CPU time. Good GUI design for embedded systems means balancing two things: what the screen should look like and how it should behave, and what the hardware can realistically drive. This guide starts with the platform decision, covers display basics, GUI libraries and UI design, and ends with embedded Android development: when it makes sense and what it costs.

Start with the platform decision

The biggest decision is which kind of processor runs the UI. It determines which libraries you can use, how much the hardware costs, how fast the device boots and how much software you’ll maintain.

Platform Typical UI Strengths Costs
Microcontroller (e.g., Cortex-M, ESP32) Small to mid-size touchscreens, simple animations Low cost, low power, fast boot, real-time control on the same chip Limited RAM for framebuffers, fewer UI frameworks, more manual work
Embedded Linux (Cortex-A SoC) High-resolution displays, rich animation, video, web content Full OS, networking, GPU acceleration, many frameworks More expensive hardware, longer boot, OS maintenance
Android (AOSP on a Cortex-A SoC) Phone/tablet-like UX, app ecosystem Familiar UX, huge developer pool, mature UI toolkit Highest hardware requirements, platform maintenance, licensing questions for Google services

Many products that “need” Linux or Android for the UI actually need it only for a large, high-resolution display or rich media. A 3.5-inch or 4.3-inch touchscreen with buttons, gauges and charts often runs well on a mid-range microcontroller.

Display hardware basics

Resolution, color depth and framebuffer memory

A full framebuffer needs width × height × bytes per pixel of RAM:

Display Color format One full frame
320 × 240 RGB565 (2 bytes/pixel) 153,600 bytes (150 KiB)
480 × 272 RGB565 261,120 bytes (255 KiB)
800 × 480 RGB565 768,000 bytes (750 KiB)
800 × 480 ARGB8888 (4 bytes/pixel) 1,536,000 bytes (1.5 MB)

Double buffering, which avoids tearing, doubles these numbers. That’s why larger MCU-based displays often need external SDRAM or PSRAM. Lowering the color depth from 32-bit to 16-bit halves memory and bandwidth, usually with only a small visible difference.

Libraries such as LVGL can also render into partial buffers, for example a tenth of the screen, and send each region to the display as it’s finished. This lets small MCUs drive displays whose full framebuffer wouldn’t fit in RAM. The trade-off is lower peak frame rates.

Display interfaces

  • SPI: cheap and needs few pins. It’s common on small displays with their own controller and memory (such as the ILI9341 at 320 × 240). Bandwidth is the limit. At a 40 MHz SPI clock, a full 320 × 240 RGB565 frame takes about 31 ms to send, so full-screen animation tops out around 30 frames per second before any other overhead.
  • Parallel MCU interface (8080-style): faster than SPI, still driving a display with its own controller.
  • Parallel RGB: the MCU continuously streams pixels from its own framebuffer. It needs an LCD controller peripheral such as the LTDC on many STM32 parts.
  • MIPI DSI, LVDS, HDMI: higher resolutions, mostly on Linux and Android SoCs and higher-end MCUs.

Touch input

Capacitive touch (like phones) gives a better feel and supports multi-touch, but it can struggle with thick gloves or water on the screen. Resistive touch works with gloves and styluses but feels less responsive. Most touch controllers connect over I2C, and the GUI library polls them or reacts to an interrupt.

GUI libraries for microcontrollers

  • LVGL: open source (MIT license) and written in C. It runs on a very wide range of MCUs and also on Linux. It includes widgets, styles, animations and partial-buffer rendering, and visual editors such as SquareLine Studio and EEZ Studio can generate LVGL code.
  • TouchGFX (STMicroelectronics): C++, free for STM32. It comes with a designer tool and a PC simulator, and it uses STM32 graphics accelerators such as Chrom-ART (DMA2D).
  • emWin (SEGGER): a long-established commercial library. Some MCU vendors license it for use on their chips (for example STemWin for STM32).
  • Embedded Wizard, Crank Storyboard and Qt for MCUs: commercial tools with designers and code generators, aimed at product teams.
  • Slint: a newer declarative UI toolkit written in Rust, with C++ and other bindings, targeting both MCUs and Linux. It has several licensing options.
  • Simple graphics libraries (Adafruit GFX, TFT_eSPI, u8g2): enough for status screens and small OLEDs, but without a full widget system.

GUI options on embedded Linux

On a Linux SoC, the main choices are:

  • Qt / QML: widely used in industrial, medical and automotive HMIs. It offers GPU acceleration and strong tooling, and it’s available under open-source and commercial licenses.
  • Flutter: Google’s UI toolkit, increasingly used on embedded Linux through community and vendor embedders.
  • GTK: common in Linux desktop environments and sometimes used on devices.
  • LVGL or Slint on Linux: lightweight options that draw straight to the framebuffer or DRM without a full desktop stack.
  • Web UI in a kiosk browser (Chromium, WPE WebKit): easy for teams with web skills, but it uses more RAM and boots more slowly.

Designing the UI itself

Design for the context of use

An embedded screen is used in situations a phone app rarely faces:

  • Distance and lighting: make text large enough to read at arm’s length, use high contrast, and consider sunlight readability.
  • Gloves, vibration, wet hands: use generous touch targets and spacing between them, and avoid gestures that need precision.
  • Glanceability: the most important value (temperature, status, alarm) should be readable in a second.
  • Feedback: every touch should get a visible response quickly. If an action takes time, show that it’s in progress.
  • Errors and alarms: decide early how warnings look and sound, and keep them consistent.

Keep it consistent and component-based

Users learn an interface once. Buttons, sliders and lists should look and behave the same everywhere. Building screens from a small set of reusable components (templates or custom widgets) makes consistency much easier and keeps code size down.

Separate UI from application logic

Keep the GUI code to presentation only. Sensor reading, control loops and communication belong in their own modules, connected to the UI through a small interface such as events, a message queue or a model/view pattern. This makes it possible to:

  • Change screens without touching control code
  • Test application logic without a display
  • Run the UI on a PC simulator, because it doesn’t call hardware directly

UI flows such as “settings → confirm → saving → done” often map naturally onto state machines in embedded C.

Prototype on the PC first

Most GUI libraries can run on a desktop. LVGL can use SDL, and TouchGFX and Qt include simulators. This lets designers, product managers and testers try screens long before hardware exists, and it makes design iterations much faster than flashing a device each time. Broader simulation options are covered in embedded development tools: IDEs, toolchains and simulators.

Performance and memory optimization

  • Redraw only what changed. Dirty-area (invalidated-region) rendering avoids repainting the whole screen for a changing number.
  • Use hardware acceleration where it exists, such as DMA2D/Chrom-ART on STM32, the PXP on some NXP parts, or a GPU on Linux SoCs.
  • Use DMA to move rendered pixels to the display while the CPU prepares the next region.
  • Subset fonts. Include only the characters and sizes you actually use. A full Unicode font at several sizes can take up a lot of flash.
  • Compress or reduce images. Use indexed or lower-depth formats for icons, and keep large bitmaps in external flash if needed.
  • Cache expensive composites during animations, at the cost of extra RAM.
  • Measure. Most libraries can show frame rate and CPU load. Profile on the real hardware, because PC simulators are much faster.

Embedded Android development

What “embedded Android” means

Embedded Android usually means building a device on the Android Open Source Project (AOSP): the open-source Android platform, built for your own hardware. Examples include point-of-sale terminals, kiosks, smart displays, fitness equipment, industrial HMIs and in-vehicle systems.

  • AOSP gives you the OS and framework. Most of it is under the Apache 2.0 license, and the Linux kernel is under GPLv2.
  • Android Automotive OS is a version of Android designed to run a car’s infotainment system directly.
  • Android Things, Google’s earlier IoT-focused edition, has been discontinued and isn’t an option for new products.

Why teams choose Android

  • A UI toolkit and touch UX that users already know
  • A large pool of Android app developers (Kotlin/Java)
  • Rich media, camera, networking and connectivity stacks
  • Board support packages (BSPs) from many SoC vendors for their application processors
  • An established update mechanism, including A/B (seamless) updates

Costs and trade-offs

  • Hardware: Android needs an application-class processor (typically Arm Cortex-A) with a GPU, and in practice usually at least one to two gigabytes of RAM plus several gigabytes of storage. That costs more than an MCU or a minimal Linux system.
  • Boot time: Android generally takes longer to boot than a lean embedded Linux image.
  • Real-time behavior: Android isn’t a real-time OS. Motor control, safety interlocks and precise timing shouldn’t depend on it.
  • Google services: AOSP alone doesn’t include the Play Store or Google Mobile Services. Shipping those requires a licensing agreement with Google and passing its compatibility requirements. Many embedded products ship plain AOSP and install their own apps.
  • Maintenance: you’re responsible for integrating security patches (Google publishes monthly Android security bulletins) and for moving to newer Android versions as the BSP allows. Long product lifetimes make this a significant ongoing cost.

Accessing custom hardware

Android apps can’t touch hardware registers directly. Custom hardware is usually exposed through:

  • A HAL (hardware abstraction layer) implemented by the device maker. Recent Android versions use AIDL-based HAL interfaces, while older devices used HIDL.
  • A system service that wraps the HAL and offers an API to apps
  • JNI/NDK code in a privileged system app, for simpler cases
  • Standard interfaces where possible: USB, serial ports through a system service, Bluetooth, or network sockets to an external controller

Kiosk and single-purpose devices

Many embedded Android products run a single app. Android supports this through lock task mode and device owner provisioning, part of Android’s device management APIs. Together they keep the device in one app, hide system UI and control updates. Device makers building their own AOSP images can also replace the launcher entirely.

Updates and long-term maintenance

Plan the update system early. You need to decide on A/B partitions, delta updates, a way to roll back, signed images, and who hosts the update server. Also decide how long you’ll keep shipping security fixes, and check that your SoC vendor’s BSP roadmap supports that timeline.

A common architecture: MCU for control, Android or Linux for UI

Many products split the system in two:

  • A microcontroller handles real-time control: motors, sensors, safety interlocks, power management. It boots instantly and keeps working even if the UI crashes or reboots.
  • An application processor running Android or embedded Linux handles the touchscreen, networking and media.
  • The two talk over UART, SPI, USB or CAN using a small, versioned message protocol.

This keeps safety-relevant behavior out of a large, frequently updated OS. Each side can also be developed and tested on its own. On the MCU side, events from the link usually arrive through interrupts, so see how to write an interrupt service routine in C.

Testing embedded GUIs

  • Run screens on the PC simulator for fast visual checks and automated screenshot comparisons.
  • Test on the real display for touch accuracy, frame rate, color and viewing angles.
  • Script interactions. Inject touch events or UI commands over a debug interface to run repeatable test sequences.
  • Test the edge cases: very long translated strings, unexpected sensor values, fast repeated touches, and power loss during a settings save.
  • Watch memory over long runs. Fragmentation and leaks in GUI code often show up only after hours or days.

For debugging on the target itself, see debugging microcontrollers with JTAG, SWD and GDB. For the wider firmware context, start with embedded firmware development.

The complete guide to firmware programming

Embedded Firmware Development: Core Programming Concepts
Read the guide

Keep exploring

Guides from other topics

All topics →