1. Introducció
The M5Stack Official LCD Unit is a compact 1.14-inch color LCD expansion screen designed for various embedded applications. It features an ST7789V2 drive scheme and a resolution of 135x240 pixels, supporting RGB666 display (262,144 colors). The internal integration of an ESP32-PICO control core (with built-in firmware) facilitates convenient display development. Communication and firmware upgrades are handled via the I2C interface (address: 0x3E). Its magnetic back design allows for easy attachment to metal surfaces. The LCD screen extension is suitable for embedding in various instruments or control devices that need to display simple content as a display panel.
Característiques del producte:
- 1.14-inch color LCD display panel
- ST7789V2 drive scheme
- I2C communication interface
- 135x240 resolution
- Complet viewangle de ing
- Magnetic back design
- Support for I2C firmware upgrade
Aplicacions:
- Information display in various instruments or control devices
2. Contingut del paquet
Assegureu-vos que hi hagi tots els articles presents en desempaquetar:
- 1x M5Stack Official LCD Unit (Model: U120)
- 1x HY2.0-4P Cable

3. Especificacions
| Especificació | Paràmetre |
|---|---|
| Screen driver IC | ST7789V2 |
| Corrent de treball | 45.7 mA |
| Protocol de comunicació | I2C, Address 0x3E |
| Mida de la pantalla | 1.14 polzades |
| Pas de píxels | 0.1170 (H) x 0.1170 (V) mm |
| Resolució | 135 x 240 píxels |
| Viewcapaç | Complet view |
| Temperatura de funcionament | 0 °C a 60 °C |
| Pes net | 8.5 g |
| Pes brut | 20 g |
| Mida del producte | 48 x 24 x 8 mm |
| Mida de l'embalatge | 67 x 52 x 12.5 mm |
| Material de la caixa | Plàstic (PC) |
PinMap:
| M5Core (PORT A) | Unit LCD | GPIO22 | GPIO21 | 5V | GND |
|---|---|---|---|---|---|
| SCL | SCL | ||||
| SDA | SDA | ||||
| 5V | 5V | ||||
| GND | GND |
Esquema:

4. Configuració i connexió
The M5Stack LCD Unit communicates via I2C. Connect the HY2.0-4P cable to the unit and your M5Stack Core or compatible development board's Port A (I2C) interface. Ensure correct pin alignment for SCL, SDA, 5V, and GND as indicated on the unit.

The unit features a bottom magnet for easy mounting on metallic surfaces.

5. Instruccions de funcionament
The Unit LCD is controlled via I2C commands. The internal ESP32-PICO core handles the display logic, making it easier to integrate into your projects.
Displaying Content:
The unit supports various display modes, including text, graphics, and images. The 135x240 pixel resolution allows for clear visual feedback.

Communication with Unit LCD:
You can send commands and receive data to the Unit LCD using I2C communication. The I2C address for the Unit LCD is 0x3E. The Unit LCD uses a command-based protocol. You send commands to the Unit LCD, and it executes them. The Unit LCD has a built-in frame buffer, which is memory based on the standard syntax. The ESP32-PICO (4M) microcontroller inside the unit handles the display operations. The display supports RGB666 (262,144 colors).
There are two main types of commands:
- Drawing commands: These commands are used to draw various shapes, text, or images on the LCD.
- Configuration commands: These commands are used to configure the LCD's settings, such as brightness, contrast, or display orientation.
After sending a command, you can send another command to perform further operations. You should use the I2C write function to send commands to the Unit LCD. You should use the I2C read function to read data from the Unit LCD. You should check the return value of the I2C functions to ensure that the communication is successful.
Llista d'ordres:
| Comandament | Len | Descripció | Input params |
|---|---|---|---|
| 0 x 00 | 1 | WRITE_REG_8BIT | [0] 8-bit register address [1] 8-bit register value |
| 0 x 01 | 1 | READ_REG_8BIT | [0] 8-bit register address |
| 0 x 02 | 1 | SET_BRIGHTNESS | [0] Brightness value (0-255) |
| 0 x 03 | 1 | SET_ROTATION | [0] Rotation value (0-3) |
| 0 x 04 | 1 | SET_COLOR_DEPTH | [0] Color depth (1-16) |
| 0 x 05 | 1 | SET_FONT | [0] Font index (0-N) |
| 0 x 06 | 1 | SET_TEXT_WRAP | [0] Text wrap (0=off, 1=on) |
| 0 x 07 | 1 | SET_TEXT_SIZE | [0] Text size (1-N) |
| 0 x 08 | 1 | SET_TEXT_COLOR | [0] Red (0-255) [1] Green (0-255) [2] Blue (0-255) |
| 0 x 09 | 1 | SET_BACKGROUND_COLOR | [0] Red (0-255) [1] Green (0-255) [2] Blue (0-255) |
| 0x0A | 1 | CLEAR_SCREEN | Sense paràmetres |
| 0x0B | 1 | DRAW_PIXEL | [0] X coordinate [1] Y coordinate [2] Red (0-255) [3] Green (0-255) [4] Blue (0-255) |
| 0x0C | 1 | DRAW_LINE | [0] X1 [1] Y1 [2] X2 [3] Y2 [4] Red (0-255) [5] Green (0-255) [6] Blue (0-255) |
| 0x0D | 1 | DRAW_RECTANGLE | [0] X [1] Y [2] Width [3] Height [4] Red (0-255) [5] Green (0-255) [6] Blue (0-255) |
| 0x0E | 1 | FILL_RECTANGLE | [0] X [1] Y [2] Width [3] Height [4] Red (0-255) [5] Green (0-255) [6] Blue (0-255) |
| 0x0F | 1 | DRAW_CIRCLE | [0] X [1] Y [2] Radius [3] Red (0-255) [4] Green (0-255) [5] Blue (0-255) |
| 0 x 10 | 1 | FILL_CIRCLE | [0] X [1] Y [2] Radius [3] Red (0-255) [4] Green (0-255) [5] Blue (0-255) |
| 0 x 11 | 1 | DRAW_TRIANGLE | [0] X1 [1] Y1 [2] X2 [3] Y2 [4] X3 [5] Y3 [6] Red (0-255) [7] Green (0-255) [8] Blue (0-255) |
| 0 x 12 | 1 | FILL_TRIANGLE | [0] X1 [1] Y1 [2] X2 [3] Y2 [4] X3 [5] Y3 [6] Red (0-255) [7] Green (0-255) [8] Blue (0-255) |
| 0 x 13 | 1 | DRAW_STRING | [0] X [1] Y [2] String length [3] String data (ASCII) |
| 0 x 14 | 1 | DRAW_IMAGE | [0] X [1] Y [2] Width [3] Height [4] Image data (RGB565) |
| 0 x 15 | 1 | DRAW_IMAGE_ALPHA | [0] X [1] Y [2] Width [3] Height [4] Image data (RGB565) [5] Alpha data (8-bit) |
| 0 x 16 | 1 | DRAW_IMAGE_RGB888 | [0] X [1] Y [2] Width [3] Height [4] Image data (RGB888) |
| 0 x 17 | 1 | DRAW_IMAGE_RGB888_ALPHA | [0] X [1] Y [2] Width [3] Height [4] Image data (RGB888) [5] Alpha data (8-bit) |
| 0 x 18 | 1 | ROLL | [0] X offset [1] Y offset |
| 0 x 19 | 1 | SET_CURSOR | [0] X coordinate [1] Y coordinate |
| 0x1A | 1 | GET_CURSOR_X | Sense paràmetres |
| 0x1B | 1 | GET_CURSOR_Y | Sense paràmetres |
| 0x1C | 1 | PUSH_SPRITE | [0] X [1] Y [2] Width [3] Height [4] Sprite data (RGB565) |
| 0x1D | 1 | WAIT_DISPLAY | Sense paràmetres |
Example (Arduino):
#include <M5UnitLCD.h>
M5UnitLCD display;
M5Canvas &canvas(&display);
static constexpr char text[] = "Hello world ! こんにちは世界! this is long long long sample. 有限無限、五劫の擦り切れ、海砂利水魚の、水行末・雲来末・風来末、鳴り響く鎚を打ち、散りゆく塵を払い、バイバイ・バイバイ・バイバイのシューリンガン、シューリンガンのグーリンダイ。グーリンダイのポンポコピーのポンポコナーの、長久命の転回。";
static constexpr size_t text_len = sizeof(text) / sizeof(text[0]);
int textpos = 0;
int scrollstep = 2;
void setup() {
display.init();
display.setRotation(2);
canvas.setColorDepth(1); // mono color
canvas.setFont(&fonts::LgfxJapanMinchoP_32);
canvas.setTextWrap(false);
canvas.setTextSize(2);
canvas.createSprite(display.width() + 64, 72);
}
void loop() {
int32_t cursor_x = canvas.getCursorX() - scrollstep;
if (cursor_x <= 0) {
textpos = 0;
cursor_x = display.width();
}
canvas.setCursor(cursor_x, 0);
canvas.scroll(-scrollstep, 0);
while (textpos < text_len && cursor_x < display.width()) {
canvas.print(text[textpos++]);
cursor_x = canvas.getCursorX();
}
display.waitDisplay();
display.pushSprite(&display, 0, (display.height() - canvas.height()) >> 1);
}6. Actualització del firmware
The Unit LCD supports firmware upgrades via the I2C interface. This allows for updates and improvements to the unit's functionality.
Method 1: Using ESP32 Downloader
Connect the Unit LCD to an ESP32 development board (e.g., M5Stack Core) and use the ESP32 Downloader tool to flash new firmware. This method requires a USB-to-serial converter or a development board with built-in USB-to-serial capabilities.

Method 2: Update via I2C (Over-the-Air or via another MCU)
Firmware can also be updated directly via I2C from another microcontroller. This method is suitable for in-system programming or when a dedicated ESP32 Downloader is not available.

7. Manteniment
The M5Stack LCD Unit is designed for durability. To ensure its longevity:
- Mantingueu la unitat neta i lliure de pols i deixalles. Feu servir un drap suau i sec per netejar-la.
- Eviteu exposar la unitat a temperatures o humitat extremes.
- Manipuleu amb cura per evitar danys físics a la pantalla o als connectors.
- Ensure proper power supply (5V) to prevent damage to the internal components.
8. Solució De Problemes
- La pantalla no s'encén:
- Check power connections (5V and GND).
- Verify the I2C communication lines (SCL, SDA) are correctly connected.
- Ensure the host microcontroller is powered on and sending commands.
- Incorrect display or artifacts:
- Confirm the I2C address (0x3E) is correctly set in your code.
- Check for proper initialization of the display driver (ST7789V2).
- Review your display commands for correct parameters (e.g., coordinates, colors).
- Try updating the firmware to the latest version.
- No response via I2C:
- Verify the I2C bus is not busy or experiencing conflicts with other devices.
- Check the physical connections of the I2C lines.
- Ensure the host microcontroller's I2C peripheral is correctly configured.
9. Consells d'usuari
- When using the magnetic back, ensure the surface is clean and free of metallic particles that could scratch the unit.
- For custom applications, consider using the provided Arduino example code as a starting point for display initialization and basic operations.
- Consulteu regularment la pàgina oficial de M5Stack website or community forums for updated firmware and libraries to enhance functionality and resolve potential issues.
10. Garantia i Suport
For warranty information and technical support, please refer to the official M5Stack weblloc web o contacteu directament amb el servei d'atenció al client. Conserveu el rebut de compra per a qualsevol reclamació de garantia.





