Skip to content
Shop

AI04 LCD

Explore with your favorite AI

Gemini & other AI

Copy this page’s context into your AI to explore how it works and what you can build.

Open Gemini

Copy the prompt, then paste it into Gemini’s message box.

View prompt

AI04, photo 1AI04, photo 2AI04, photo 3

Combined with an MCU (microcontroller) leaf, this leaf lets you display text and numbers on the LCD (liquid crystal display) and accept input from two switches. Add a sensor leaf to view its measurements on the display.

The LCD unit connects to the MCU leaf over I2C. One switch connects to an MCU digital input pin, and the other connects to the I2C Expander’s P1 pin. To reduce power consumption, you can turn off LCD power through a load switch controlled by the I2C Expander.

The display has 8 characters per line and 2 lines. Hello, World! (13 characters) does not fit on one line. For your first display, follow Display text with AP01B + AI04A + AZ01C for assembly, library installation and uploading.

ItemDescription
Dimension  W30.8×D30.5×H5.3mm
ItemDescription
Part numberAQM0802A-RN-GBW
Display format8x2 Character
Viewing area (WxH)27x10.5mm
Dot size (WxH)0.45x0.5mm
Dot pitch (WxH)0.5x0.55mm
Character size (WxH)2.45x4.35mm
Character pitch (WxH)2.95x4.9mm
Viewing direction6:00 O’Clock
Driving method1/16Duty,1/5Bias
Controller ICST7032I-0D(Sitronix) or compatible
Display modeSTN (Gray)/Positive/Reflective
InterfacesI2C (Address: 0x3E)

ItemDescription
Part numberPCA9557RGVR
InterfaceI2C (Address: 0x1A or 0x1E)

Enable LCD power through the I2C I/O Expander before initializing the LCD. Calling lcd.begin() alone does not operate the leaf’s power switch.

Device7-bit I2C addressPurpose
I2C I/O Expander (PCA9557)0x1A or 0x1ELCD power control and switch input
LCD controller (ST7032)0x3EDisplay settings and character data

The AVR LCD sample uses expander address 0x1A and performs these steps:

  1. Start I2C with Wire.begin().
  2. Configure P0 as an output with i2c_write_byte(0x1A, 0x03, 0xFE).
  3. Enable LCD power with i2c_write_byte(0x1A, 0x01, 0x01).
  4. Call lcd.begin(8, 2), lcd.setContrast(30) and lcd.clear() in that order, then display text.

i2c_write_byte() is a function defined in the sample. Use the linked page for the complete sketch. If your expander responds at 0x1E, set the sample’s I2C_EXPANDER_ADDR to that address.

Finding an address with an I2C scan or successfully sending a command does not establish that LCD power, initialization and contrast are ready for display. First check the power steps above and try the sample with its specified library. The sample intentionally turns LCD power off for 3 seconds, during which the display goes blank.

When controlling the ST7032 directly without the library, follow the datasheet initialization procedure, including the delay after power becomes stable, instruction-table selection, contrast, power and follower settings, and delays between commands. The linked library enables the follower and waits 200 ms inside begin(), then sets contrast and enables the booster in setContrast() (library implementation). Copying isolated commands can leave out required settings or delays.

ItemDescription
Switch1Connected to pin 2
Switch2Connected to I2C Expander P1 pin

The samples use arduino_ST7032 by tomozh (ST7032.h). Download the ZIP from GitHub, then install it through Sketch → Include Library → Add .ZIP Library in Arduino IDE. See the installation steps.

LCD_ST7032 and ST7032_asukiaaa are different implementations. Choose the library specified by the sample, rather than relying on a similar name.

  • Rev A1.0: First edition, August 2019

© 2026 トリリオンノード研究会 All Rights Reserved.

Privacy and analytics

Leaf photo