Skip to content
Galaxy Diner Atlanta Galaxy Diner Atlanta Est. 1993 · Open 24/7 Open Now

From the Diner

How to integrate a 5 inch round display into a smart mirror?

admin — Galaxy Diner Atlanta

Integrating a 5 Inch Round Display into a Smart Mirror: A Practical Guide

To integrate a 5 inch round display into a smart mirror, you need to physically mount the display behind a two-way mirror, connect it to a single-board computer like a Raspberry Pi 4 or 5, and configure software to output the correct circular resolution, typically 1080x1080 pixels. The specific display you choose, such as the 5 inch 1080x1080 round tft display, uses a MIPI DSI interface with the HX8399 driver IC, which requires careful wiring and driver setup. This display has a 5.0-inch diagonal, a 1080x1080 resolution, and a 60Hz refresh rate, with a brightness of 400 cd/m² typical, making it suitable for indoor smart mirror applications where ambient light is controlled. The physical dimensions include an outer diameter of 130.0 mm and an active area diameter of 108.0 mm, with a thickness of 1.5 mm without the backlight assembly. The display module weight is approximately 45 grams, which is light enough for adhesive mounting but requires a bezel or frame for structural support. The viewing angle is 85 degrees in all directions, which is critical for a mirror where users look from various angles. The interface uses a 30-pin FPC connector with a 0.5mm pitch, and the pinout includes power (3.3V for logic, 5.0V for backlight), ground, and MIPI DSI data lanes (4 lanes) plus clock. The backlight is LED-based, drawing 120 mA at 5V, so total power consumption is around 0.6W for the backlight plus 0.3W for the logic, totaling under 1W, which is manageable for a Raspberry Pi's 5V/3A power supply. The display module's operating temperature range is -20°C to +70°C, which is fine for indoor use but not for outdoor mirrors exposed to extreme heat or cold.

For the smart mirror enclosure, you need a two-way mirror, also called a one-way mirror or teleprompter glass, which has a reflective coating on one side and a transparent glass on the other. The typical transmission rate for a two-way mirror is 30% to 50%, meaning only 30-50% of the display's light passes through, so the display brightness must be high enough to overcome this loss. With a 400 cd/m² display, the effective brightness after the mirror is 120 to 200 cd/m², which is acceptable for a dim room but may be too low for a brightly lit bathroom. You can compensate by using a higher brightness display, but the 5 inch round TFT is already at the upper end for round displays in this size. The mirror should be cut to a circular shape with a diameter of at least 150 mm to allow for a bezel or frame that hides the display edges. The display is mounted behind the mirror, with the active area centered behind the reflective area. The distance between the display surface and the mirror back should be as small as possible, ideally 1-2 mm, to avoid parallax issues where the image appears offset. Use a foam adhesive spacer or a 3D-printed bracket to hold the display in place, ensuring no light leaks around the edges. The bezel can be a wooden or metal ring with an inner diameter of 130 mm and an outer diameter of 150 mm, painted black to match the mirror frame. The entire assembly should be housed in a wooden or acrylic box with a depth of at least 50 mm to accommodate the display, the Raspberry Pi, and any wiring. The Raspberry Pi 4 Model B has dimensions of 85.6 mm x 56.5 mm x 17 mm, so it fits easily behind the display. The power supply for the Raspberry Pi should be a 5V/3A USB-C adapter, and the display backlight power can be drawn from the Pi's 5V pin, but a separate 5V regulator is recommended to avoid voltage drops. The MIPI DSI interface on the Raspberry Pi uses a 15-pin FPC connector, but the display uses a 30-pin connector, so you need a custom adapter board or a ribbon cable with a 30-pin to 15-pin converter. The HX8399 driver IC is supported by the official Raspberry Pi kernel as of kernel version 5.10, but you may need to compile a device tree overlay to enable the specific resolution and timing. The timing parameters for the 5 inch round display include a horizontal front porch of 20 pixels, horizontal back porch of 20 pixels, vertical front porch of 4 lines, vertical back porch of 4 lines, and a pixel clock of 66.7 MHz, which is derived from the 1080x1080 resolution at 60Hz. The MIPI DSI clock frequency is 500 MHz, which is within the Raspberry Pi's DSI controller capability. The display supports 24-bit RGB color depth, so you can render full-color images and text.

Software configuration is the next critical step. You need to install Raspberry Pi OS (Bookworm or later) and enable the DSI interface by editing the /boot/config.txt file. Add the following lines: dtoverlay=vc4-kms-v3d, dtoverlay=vc4-kms-dsi-7inch, but for a round display, you need a custom overlay. The overlay should include the display timings, the resolution, and the rotation if needed. For a round display, you also need to enable a circular mask in the software to hide the square corners of the framebuffer. This can be done using a compositor like Wayland with a custom shader, or by using a Python script that draws a circular overlay on top of the display. The framebuffer resolution is set to 1080x1080, but the actual visible area is a circle with a diameter of 1080 pixels, so you need to crop or mask the corners. The Raspberry Pi's GPU can handle this with a simple fragment shader that sets the alpha channel to 0 for pixels outside the circle. The formula for the circle is (x - 540)^2 + (y - 540)^2 <= 540^2, where x and y are pixel coordinates. You can implement this in a Wayland compositor like Weston or in a custom OpenGL application. For a simpler approach, you can use a Python script with the Pygame library that creates a window with a circular mask and displays content like weather, time, or calendar. The script should run at startup and render the content at 60fps. The content can be fetched from APIs like OpenWeatherMap for weather data, or from a local JSON file for static information. The display's 1080x1080 resolution gives a pixel density of 285 PPI, which is sharp enough for text and icons at a typical viewing distance of 30-50 cm. The aspect ratio is 1:1, so you need to design the UI in a square format, with the circular mask applied. The usable area inside the circle is 916,000 pixels, which is about 78% of the total square area, so you have plenty of room for a clock, date, temperature, and a few icons. The font size should be at least 24 pixels for readability, and icons should be 32x32 or 48x48 pixels. The color scheme should be high contrast, like white text on a black background, because the two-way mirror reduces contrast. The display's contrast ratio is 800:1 typical, but after the mirror, it drops to around 200:1, so avoid gray-on-gray designs.

Hardware integration requires attention to mechanical and electrical details. The display's backlight is driven by a constant current LED driver, which is integrated into the display module. The backlight pins are labeled LED+ and LED-, and you need to connect them to a 5V power source with a current limit of 120 mA. The Raspberry Pi's 5V pin can supply up to 1.2A, so it's safe to use, but add a 100-ohm resistor in series to limit inrush current. The MIPI DSI data lines are differential pairs, so they must be routed with controlled impedance of 100 ohms differential. If you use a ribbon cable, keep the length under 10 cm to avoid signal degradation. The display's FPC connector is a 0.5mm pitch, 30-pin, so you need a matching connector on the adapter board. The Raspberry Pi's DSI connector is a 0.5mm pitch, 15-pin, so the adapter board must map the signals correctly. The pin mapping for the 5 inch round display is as follows: pin 1 is VDDIO (3.3V), pin 2 is VDD (3.3V), pin 3 is GND, pin 4 is D0_N, pin 5 is D0_P, pin 6 is GND, pin 7 is D1_N, pin 8 is D1_P, pin 9 is GND, pin 10 is D2_N, pin 11 is D2_P, pin 12 is GND, pin 13 is D3_N, pin 14 is D3_P, pin 15 is GND, pin 16 is CLK_N, pin 17 is CLK_P, pin 18 is GND, pin 19 is RESET, pin 20 is TE (tearing effect), pin 21 is GND, pin 22 is LED+, pin 23 is LED-, pin 24 is GND, and pins 25-30 are unused or reserved. The Raspberry Pi's DSI connector uses a different pinout, so you need to cross-reference the two. The adapter board should include a 3.3V regulator if the display requires more current than the Pi's 3.3V pin can supply (the Pi's 3.3V pin is rated for 500 mA, and the display logic draws about 100 mA, so it's fine). The RESET pin should be connected to a GPIO pin on the Pi, typically GPIO 17, so you can reset the display during initialization. The TE pin is optional but can be used for tearing effect synchronization; connect it to a GPIO input if needed. The display's I2C interface for touch is not present on this model, so you only need the MIPI DSI lines. The total wiring is 15-20 wires, so use a small breadboard or a custom PCB to keep the connections tidy. The display module's back of the board has a ground plane, so avoid shorting pins with the Raspberry Pi's metal casing. Use Kapton tape or a plastic spacer to insulate the board from the Pi. The Raspberry Pi should be mounted vertically behind the display to save space, using standoffs and screws. The heat sink on the Pi's CPU is recommended because the closed enclosure can trap heat; the Pi 4's CPU can reach 80°C under load, so add a small fan if the ambient temperature is above 30°C. The display itself generates minimal heat, less than 1W, so no additional cooling is needed.

Testing and calibration are essential for a polished smart mirror. After assembling the hardware and booting the Raspberry Pi, you should see the circular display output. If the display is black or garbled, check the MIPI clock frequency and the timing parameters. Use the command "dmesg | grep dsi" to see if the kernel detects the display. The HX8399 driver IC should show up as a DSI device. If the display shows a square image, you need to enable the circular mask. Test the mask by displaying a white circle on a black background; the corners should be black. If the mask is off-center, adjust the x and y offsets in the shader. The display's brightness can be adjusted by changing the backlight PWM duty cycle. The Raspberry Pi's PWM0 pin (GPIO 18) can be used to control the backlight brightness via a transistor or a dedicated LED driver. The display's backlight does not have a PWM input, so you need to use a MOSFET to switch the LED+ line. A simple circuit with a 2N7000 MOSFET and a 10k-ohm resistor can control the brightness from 0% to 100%. The PWM frequency should be above 1 kHz to avoid flicker. The display's response time is 20 ms (rise) and 15 ms (fall), which is fine for static content but may show ghosting for fast-moving animations. For a smart mirror, the content is mostly static, so this is not an issue. The color accuracy is decent with a typical gamma of 2.2, but you can calibrate it using a colorimeter if needed. The display's color gamut is 70% NTSC, which is adequate for icons and text but not for photo editing. The viewing angle is 85 degrees, so the image remains visible when you look at the mirror from the side, but the brightness drops to 50% at 85 degrees. The mirror's reflective coating also affects the viewing angle; at extreme angles, the mirror reflection dominates, so the display content becomes less visible. To mitigate this, use a high-contrast UI with bright colors and avoid dark backgrounds. The mirror's reflective surface should be cleaned with a microfiber cloth before assembly to avoid dust spots that look like dead pixels. The display's surface is glass, so it can be cleaned with isopropyl alcohol, but avoid getting moisture on the FPC connector. The final assembly should be tested for light leaks by shining a flashlight around the edges; any leaks should be sealed with black electrical tape or silicone sealant. The smart mirror can be mounted on a wall or a stand, with the Raspberry Pi connected to Wi-Fi for internet access. The display's power consumption is low, so it can run 24/7 without significant heat buildup. The total cost of the display, Raspberry Pi, mirror, and enclosure is around $150 to $200, depending on the mirror quality and frame material. The 5 inch round display is a cost-effective choice for a compact smart mirror, offering a high resolution and a small footprint that fits in a bathroom or a hallway. The integration process requires basic soldering skills and Linux knowledge, but the result is a functional and stylish smart mirror that shows useful information at a glance.

Hungry yet? Three decades on Ponce.

The chrome is warm and a booth is open — 24 hours a day, every day of the year.