Skip to content
Verified fix

How to design a circular UI for a 5 inch 1080x1080 display?

Designing a circular UI for a 5 inch 1080x1080 display requires a fundamental shift from traditional rectangular screen layouts, because the square pixel matrix (1080x1080) is actually a circular cutout, meaning the physical display area is a circle inscribed within that square. This specific display, often referred to as a 5 inch 1080x1080 round tft display, has a pixel density of about 305 PPI (pixels per inch), which is calculated by dividing the diagonal resolution (1527 pixels, using Pythagorean theorem: sqrt(1080^2 + 1080^2)) by the 5-inch diagonal. This high PPI means you can render fine details, but the circular form factor introduces constraints: the effective visible area is only about 78.5% of the full 1080x1080 square (since area of a circle inscribed in a square is π/4 of the square area). So, your usable canvas is roughly 0.915 million pixels, compared to the 1.166 million total pixels in the square. This means any UI element placed near the corners of the square will be clipped by the circular bezel, so you must design within a circular boundary of radius 540 pixels (half of 1080). The first practical step is to establish a coordinate system where the center of the circle is at (540, 540) in pixel space, and all UI elements should be constrained to a radius of 540 or less. For touch interaction, the display likely uses a capacitive touch panel that aligns with the circular cutout, but the touch sensor matrix might still be rectangular, so you need to handle touch events that fall outside the visible circle by ignoring them or mapping them to the nearest valid point. From a hardware perspective, this display uses a MIPI interface with the HX8399 driver IC, which supports 16.7 million colors (8-bit per channel) and a typical refresh rate of 60 Hz. The round shape means you have to manage the pixel data carefully: the driver IC expects a rectangular frame buffer of 1080x1080, but only the pixels within the circle are lit. So, you can either send black pixels for the corners (which wastes bandwidth) or use a custom display controller that crops the image. For a circular UI, you typically send a full 1080x1080 image with the corners set to black or transparent, but the display's physical mask will hide those areas anyway. However, for power efficiency, you might want to minimize the number of lit pixels, as each pixel consumes about 0.1 mW at typical brightness (based on LCD backlight power of around 500 mW for a 5-inch panel). So, if you only light the circular area, you save about 21.5% power compared to lighting the full square. Now, let's talk about UI layout strategies. The circular shape forces you to think in polar coordinates (radius and angle) rather than Cartesian (x, y). Common UI patterns for circular displays include radial menus, where options are arranged around the circumference, and centered content, like a watch face or a gauge. For a 5-inch display, the physical diameter is about 127 mm (5 inches), so the visible circle has a diameter of 127 mm. This gives you a lot of real estate compared to a smartwatch (which is usually 1.2 to 1.5 inches). You can fit multiple elements: for example, a central widget of 300 pixels radius (about 35 mm diameter) leaves 240 pixels of annular space around it. The angular resolution is high: at the outer edge (radius 540 pixels), the circumference is about 3393 pixels (2π * 540), so you can place up to 3393 distinct touch targets if each is 1 pixel wide, but practical touch targets need at least 44 pixels (about 3.5 mm) for comfortable finger interaction, per Apple's HIG. That means you can fit about 77 touch targets around the circumference (3393 / 44). But for readability, text should be at least 16 pixels tall (about 1.3 mm), which is fine for this PPI. A key design consideration is the safe zone. Since the display's circular edge is not perfectly sharp (there's a bezel of about 1-2 mm), you should keep critical UI elements at least 20 pixels away from the outer edge to avoid being obscured by the bezel shadow. Also, the display's viewing angle is typically 80 degrees in all directions (for IPS panels), but for a circular display, the edges are at a steep angle relative to the viewer's line of sight if the display is flat. If the display is mounted in a curved housing, you might need to adjust brightness and contrast for edge pixels. The HX8399 driver supports gamma correction, so you can apply a radial gradient to compensate for edge darkening. For example, you can increase the brightness of pixels near the edge by 10-15% to maintain uniform appearance. Now, let's dive into specific UI components and their data-driven design. For a circular UI, the most common element is a progress ring or a circular gauge. To render a smooth arc, you need to calculate the pixels along the circumference using Bresenham's circle algorithm or a trigonometric approach. For a 1080x1080 display, a full circle arc of 1 degree corresponds to about 9.4 pixels on the circumference (3393 / 360). So, for a 90-degree arc, you have about 848 pixels to work with, which is enough for fine granularity. If you're displaying a percentage, each percentage point (1% of 360 degrees) is 3.6 degrees, or about 34 pixels, which is readable. For a gauge with a needle, the needle should be at least 2 pixels wide for visibility, and the pivot point should be at the center (540, 540). The needle length can be up to 500 pixels to leave a margin. Another common element is text. For circular text, you have two options: text along a circular path, or text that is always oriented upright. For the latter, you need to position each character individually, which is computationally intensive. For a 5-inch display, you can use a font size of 24 to 36 pixels for body text, which gives about 15 to 22 characters per line if the line is centered and spans the full diameter (1080 pixels). But since the text is constrained to a circle, the maximum line length is actually the chord length at a given radius. For example, at radius 400 pixels, the chord length at the center is 800 pixels (since the chord is the diameter of the circle at that radius), which can fit about 33 characters at 24 px. However, near the top and bottom of the circle, the chord length shrinks. So, you should avoid placing long text near the edges. A practical approach is to use a single line of text centered horizontally, with a maximum width of 800 pixels, and ensure the text is within the circle by checking that the bounding box of the text fits within the circle. For touch buttons, circular buttons are more natural than rectangular ones. A circular button of radius 50 pixels (about 4 mm) is comfortable for touch, but you should add a hit area of at least 44x44 pixels (the standard touch target). For a circular button, the hit area can be a circle of radius 22 pixels, but for better accuracy, use a square hit area of 44x44 pixels centered on the button. You can place buttons around the circumference, like a radial menu. For example, you can have 8 buttons equally spaced at 45-degree intervals, each with a radius of 100 pixels from the center, and each button's center is at (540 + 100 * cos(θ), 540 + 100 * sin(θ)). The button size should be at least 44 pixels in diameter, so a radius of 22 pixels. With 8 buttons, the angular spacing is 45 degrees, and the arc distance between button centers at radius 100 pixels is about 78.5 pixels (2π * 100 / 8), which is enough to avoid overlap. Now, let's talk about data visualization on a circular display. For a dashboard, you might want to show multiple gauges. Since the display is 5 inches, you can fit up to 4 small gauges in the corners of the circle, but they will be clipped if they extend beyond the circle. A better approach is to use a central gauge with secondary information in the annular region. For example, a speedometer with a needle in the center, and around it, you can display temperature, battery level, and time as small icons. The annular region from radius 300 to 500 pixels has an area of about 0.5 million pixels (π * (500^2 - 300^2)), which is enough for 4-6 small widgets. Each widget can be a circle of radius 80 pixels, placed at specific angles. For instance, at 0 degrees (right), you can place a battery icon; at 90 degrees (top), a temperature reading; at 180 degrees (left), a time display; and at 270 degrees (bottom), a notification icon. The angular spacing of 90 degrees gives enough room for each widget. For animations, the circular shape introduces challenges. The refresh rate of 60 Hz means you have 16.67 ms per frame. Rendering a smooth rotation of a radial menu requires calculating new positions for each element every frame. For a menu with 8 items, you need to update 8 positions per frame, which is trivial for a modern microcontroller (like an STM32 or ESP32) but can be heavy if you're using a full OS like Android or Linux. The MIPI interface typically uses 4 lanes, with a data rate of up to 1 Gbps per lane, so the total bandwidth is 4 Gbps. For a 1080x1080 display at 60 Hz with 24-bit color, the raw data rate is 1080 * 1080 * 24 * 60 = 1.68 Gbps, which is well within the bandwidth. So, you can stream full-resolution video without issues. But for circular UI, you only need to update the pixels within the circle, which is about 78.5% of the total, so you can reduce the data rate to about 1.32 Gbps. However, the driver IC still expects a full frame buffer, so you have to send the entire 1080x1080 image, but you can use a technique called "partial update" if the driver supports it. The HX8399 does support partial display mode, where you can specify a window of pixels to update. This is useful for updating only the circular area, but you still need to manage the corners. Let's get into the software implementation. If you're using a platform like LVGL (LittlevGL), it has built-in support for circular displays. You can set the display's horizontal and vertical resolution to 1080x1080, and then use a custom draw callback that clips all drawing operations to a circle. LVGL uses a concept of "display buffer" and "flush callback" where you can modify the pixel data before sending it to the display. For example, you can create a mask that sets all pixels outside the circle to black. This is done by checking the distance from the center: if (x - 540)^2 + (y - 540)^2 > 540^2, then set the pixel to 0. This is computationally expensive if done per pixel, but you can optimize by using a precomputed lookup table or by using hardware acceleration (like a GPU). For a 1080x1080 image, checking each pixel is about 1.16 million operations, which at 60 Hz is 69.6 million operations per second. A typical ARM Cortex-M7 at 400 MHz can do this in software, but it will consume a lot of CPU cycles. Alternatively, you can use a DMA controller to copy a precomputed circular mask to the frame buffer. For touch input, the capacitive touch panel typically has a resolution of 1080x1080 as well, but the touch controller might report coordinates in the full square. You need to map touch coordinates to the circular area. If a touch event occurs outside the circle (i.e., (x - 540)^2 + (y - 540)^2 > 540^2), you should ignore it or snap it to the nearest point on the circle. Snapping involves finding the angle of the touch point relative to the center, and then setting the radius to 540. For example, if the touch is at (800, 800), the angle is atan2(800-540, 800-540) = atan2(260, 260) = 45 degrees, and the snapped point is (540 + 540 * cos(45°), 540 + 540 * sin(45°)) = (540 + 382, 540 + 382) = (922, 922). This is useful for radial menus where you want to detect which segment the user touched. Now, let's talk about power consumption. The display's backlight is typically LED-based, consuming about 500 mW at full brightness. The LCD panel itself consumes about 50 mW for the driver IC. So total power is around 550 mW. If you're designing a battery-powered device, you can reduce power by dimming the backlight to 50% (250 mW) and using a dark background (since LCD pixels are always backlit, but you can reduce the backlight brightness). For a circular UI, you can also use a technique called "local dimming" if the backlight is segmented, but most 5-inch displays have a single backlight. So, the best way to save power is to use a dark theme with fewer lit pixels. However, since the LCD is transmissive, the backlight is always on, so the pixel color doesn't affect power consumption significantly. The only way to save power is to reduce the backlight brightness or use a lower refresh rate (e.g., 30 Hz for static content). For mechanical integration, the display module has a physical diameter of about 130 mm (including the bezel), and the active area is 127 mm. The thickness is typically 2-3 mm for the LCD panel plus 1-2 mm for the touch panel. You need to design a housing that holds the display securely and provides a circular cutout. The display's MIPI connector is usually a 30-pin FPC (flexible printed circuit) with a pitch of 0.5 mm. You need to route the FPC to your main board, and the cable length should be kept under 100 mm to avoid signal degradation. The MIPI signals are high-speed, so you need to use impedance-controlled traces (100 ohms differential) and keep the trace length matched. The HX8399 driver supports a maximum clock frequency of 500 MHz, but for 1080x1080 at 60 Hz, the pixel clock is about 70 MHz (1080 * 1080 * 60 * 1.2 for overhead = 84 MHz, so you need a clock of about 84 MHz). This is within the range of most microcontrollers. Finally, let's look at testing and validation. You should test the circular UI on the actual display to ensure that no critical elements are clipped. Use a test pattern that draws concentric circles at radii of 100, 200, 300, 400, and 500 pixels, and check if the display shows them correctly. Also, test the touch accuracy by placing touch targets at known positions and measuring the reported coordinates. The touch panel's linearity should be within 1% of the display size, so for a 1080-pixel display, the error should be less than 10 pixels. You can calibrate the touch panel by using a 4-point calibration (top, bottom, left, right) and mapping the touch coordinates to the display coordinates. For a circular display, you might also need to calibrate the center point, as the touch panel's zero point might not align with the display's center due to mechanical tolerances.