Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.
LCD I2C
Introduction
The 16×2 LCD (Liquid Crystal Display) is a widely used alphanumeric display module capable of showing 16 characters per line on 2 lines. It is based on the Hitachi HD44780 controller, which provides a simple command-based interface for displaying characters, symbols, and custom graphics.To reduce the number of GPIO pins required for communication, the LCD is often connected through an I²C I/O expander, typically the PCF8574 chip. This configuration allows the LCD to communicate with the microcontroller using only two wires — SDA (Serial Data) and SCL (Serial Clock) — instead of the usual 6 to 8 parallel data and control lines.The PCF8574 acts as a bridge between the microcontroller’s I²C bus and the LCD’s parallel interface, providing:
Pin saving
Simpler wiring
Easy software control
Without it, you would need many more GPIO pins and complex wiring to operate the LCD.
Pin Configuration
LCD Pin
Glyph-C3
VCC
Power Supply
GND
GND
SDA
GPIO 21
SCL
GPIO 22
Features
Uses I²C communication — only two wires (SDA and SCL) are required.
Saves microcontroller pins — reduces pin usage from 8 (parallel) to 2.
Compatible with the HD44780 LCD controller.
Based on PCF8574 I/O expander for serial-to-parallel data conversion.
Built-in LED backlight for better visibility.
Adjustable contrast using the onboard potentiometer.
Operates on 3.3V or 5V, suitable for most microcontrollers (Arduino, ESP32, ESP8266, Raspberry Pi).
Copy adafruit_pcf8574.mpy, adafruit_bus_device/, and adafruit_character_lcd/ into lib/. This uses the common PCF8574 backpack mapping (RS=P0, EN=P2, backlight=P3, D4–D7=P4–P7) at 0x27. Check the address with the I2C scanner and use a 3.3 V backpack or level shifter if its pull-ups go to 5 V.Follow the CircuitPython setup guide and save this example as code.py on the board.
For the Pcbcupid Glyph S3 to appear under Tools > Board > esp32, the esp32 board version installed in the Arduino IDE should be greater or equal to 3.1.0.
Tools > Port and select the port connected to your GLYPH.
Tools > USB CDC on Boot >Enabled
If USB CDC on BOOT not enabled, you won’t be seeing any serial data on Arduino IDE.
Upload the Code
Click the upload button (➡️ icon) or use the shortcut CRTL + U in Arduino IDE to upload the code to the board.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"PCB Cupid","colors":{"primary":"#0D9373"},"favicon":"https://mintcdn.com/pcbcupid-bae3761c/4dXNuJjZhqL5zqVd/images/favicon_PCBcupid.png?fit=max\u0026auto=format\u0026n=4dXNuJjZhqL5zqVd\u0026q=85\u0026s=697c4189e0a983e1722bddbedde79f61","appearance":{"strict":true},"background":{"decoration":"gradient"},"navbar":{"links":[{"href":"https://spell.pcbcupid.com","label":"Circuit Spell"},{"href":"https://shop.pcbcupid.com","label":"Shop"},{"href":"/","label":"Learn"},{"href":"https://events.pcbcupid.com","label":"Events"},{"href":"https://forum.pcbcupid.com","label":"Forum"},{"href":"https://pcbcupid.com/articles","label":"Articles"},{"href":"https://pcbcupid.com/tools","label":"Tools"}]},"seo":{"indexing":"all"},"fonts":{"family":"Space Grotesk","weight":400},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":true},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode","mcp"],"display":"toc"},"thumbnails":{"appearance":"dark"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"pcbcupid-bae3761c","hasAudioNarration":false,"actualSubdomain":"pcbcupid-bae3761c","customDomains":["learn.pcbcupid.com"],"gitSource":{"type":"github","owner":"pcbcupid","repo":"pcbcupid-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae268427b458a5c875a9a81","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Documentation","count":77},{"language":"default","tag":"Modules","count":67},{"language":"default","tag":"PCB Design","count":45},{"language":"default","tag":"Examples","count":32},{"language":"default","tag":"Glyph","count":25},{"language":"default","tag":"G-Mod","count":17},{"language":"default","tag":"KiCad","count":16},{"language":"default","tag":"Basic","count":15},{"language":"default","tag":"Welcome","count":9},{"language":"default","tag":"G-Sense","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"guides/lcd-i2c","slug":"/guides/lcd-i2c","pageMetadata":{"description":"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.","title":"I2C LCD Display","sidebarTitle":"I2C LCD","href":"/guides/lcd-i2c"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,img:`img`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,OptimizedFrame,OptimizedImage,Tab,Table,Tabs,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedFrame)_missingMdxReference(`OptimizedFrame`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(OptimizedFrame,{className:`mint-w-full mint-aspect-video mint-rounded-xl`,src:`https://www.youtube.com/embed/gjp0ktQbu1Y?si=-nliDv-VtYwXXCCk`,title:`YouTube video player`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullScreen:true}),`\n`,_jsx(Heading,{level:`1`,id:`lcd-i2c`,children:`LCD I2C`}),`\n`,_jsx(_components.p,{children:_jsx(_components.img,{src:`https://files.pcbcupid.com/Documentation/Boards/Examples/LCD_I2C/PCBCUPID_I2C_LCD.avif`,alt:`LCD`})}),`\n`,_jsx(Heading,{level:`2`,id:`introduction`,children:`Introduction`}),`\n`,_jsx(_components.p,{children:`The 16×2 LCD (Liquid Crystal Display) is a widely used alphanumeric display module capable of showing 16 characters per line on 2 lines. It is based on the Hitachi HD44780 controller, which provides a simple command-based interface for displaying characters, symbols, and custom graphics.`}),`\n`,_jsx(_components.p,{children:`To reduce the number of GPIO pins required for communication, the LCD is often connected through an I²C I/O expander, typically the PCF8574 chip. This configuration allows the LCD to communicate with the microcontroller using only two wires — SDA (Serial Data) and SCL (Serial Clock) — instead of the usual 6 to 8 parallel data and control lines.`}),`\n`,_jsx(_components.p,{children:`The PCF8574 acts as a bridge between the microcontroller’s I²C bus and the LCD’s parallel interface, providing:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Pin saving`}),`\n`,_jsx(_components.li,{children:`Simpler wiring`}),`\n`,_jsx(_components.li,{children:`Easy software control`}),`\n`,_jsx(_components.li,{children:`Without it, you would need many more GPIO pins and complex wiring to operate the LCD.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`pin-configuration`,children:`Pin Configuration`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`LCD Pin`}),_jsx(_components.th,{children:`Glyph-C3`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`VCC`}),_jsx(_components.td,{children:`Power Supply`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`GND`}),_jsx(_components.td,{children:`GND`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`SDA`}),_jsx(_components.td,{children:`GPIO 21`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`SCL`}),_jsx(_components.td,{children:`GPIO 22`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`features`,children:`Features`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Uses I²C communication — only two wires (SDA and SCL) are required.`}),`\n`,_jsx(_components.li,{children:`Saves microcontroller pins — reduces pin usage from 8 (parallel) to 2.`}),`\n`,_jsx(_components.li,{children:`Compatible with the HD44780 LCD controller.`}),`\n`,_jsx(_components.li,{children:`Based on PCF8574 I/O expander for serial-to-parallel data conversion.`}),`\n`,_jsx(_components.li,{children:`Built-in LED backlight for better visibility.`}),`\n`,_jsx(_components.li,{children:`Adjustable contrast using the onboard potentiometer.`}),`\n`,_jsx(_components.li,{children:`Operates on 3.3V or 5V, suitable for most microcontrollers (Arduino, ESP32, ESP8266, Raspberry Pi).`}),`\n`,_jsx(_components.li,{children:`Displays 16 characters × 2 lines (total 32 characters).`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`typical-applications`,children:`Typical Applications`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Embedded system displays — show system status or information.`}),`\n`,_jsx(_components.li,{children:`Sensor data monitoring — display temperature, humidity, voltage, etc.`}),`\n`,_jsx(_components.li,{children:`Industrial control panels — parameter and status display.`}),`\n`,_jsx(_components.li,{children:`IoT devices — display device data or connection status.`}),`\n`,_jsx(_components.li,{children:`Educational and training projects — for learning I²C and LCD interfacing.`}),`\n`,_jsx(_components.li,{children:`Digital meters — voltage, current, and frequency measurement displays.`}),`\n`,_jsx(_components.li,{children:`Home automation systems — display time, mode, or device state.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-1-hardware-required`,children:`Step 1: Hardware Required`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`GLYPH`}),`\n`,_jsx(_components.li,{children:`LCD Display`}),`\n`,_jsx(_components.li,{children:`PCF-8574`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-2-circuit-diagram`,children:`Step 2: Circuit Diagram`}),`\n`,_jsx(`div`,{style:{textAlign:`center`},children:_jsx(OptimizedImage,{src:`https://files.pcbcupid.com/Documentation/Boards/Examples/LCD_I2C/LCD_12C%20CIRCUIT%20DAIGRAM/circuit_diagram_i2c.jpg`,width:`600`})}),`\n`,_jsx(Heading,{level:`2`,id:`step-3-code-setup`,children:`Step 3: Code Setup`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Open Arduino IDE.`}),`\n`,_jsx(_components.li,{children:`Make sure to install the library`}),`\n`,_jsx(_components.li,{children:`Copy and paste the following code into the Arduino IDE`}),`\n`]}),`\n`,_jsxs(Tabs,{children:[_jsx(Tab,{title:`Arduino Code`,id:`arduino-code`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \u003cWire.h>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \u003cLiquidCrystal_I2C.h>`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Initialize LCD: I2C address 0x27, 16 columns, 2 rows`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`LiquidCrystal_I2C`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#B5CEA8`},children:`0x`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`27`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setup`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`init`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Initialize the LCD`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`backlight`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Turn ON backlight`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Print text`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setCursor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`setCursor`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lcd`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"PCBCUPID\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` loop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Static display - nothing needed`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})}),_jsxs(Tab,{title:`CircuitPython Code`,id:`circuitpython-code`,children:[_jsx(_components.p,{children:`Copy adafruit_pcf8574.mpy, adafruit_bus_device/, and adafruit_character_lcd/ into lib/. This uses the common PCF8574 backpack mapping (RS=P0, EN=P2, backlight=P3, D4–D7=P4–P7) at 0x27. Check the address with the I2C scanner and use a 3.3 V backpack or level shifter if its pull-ups go to 5 V.`}),_jsxs(_components.p,{children:[`Follow the `,_jsx(_components.a,{href:`/documentation/welcome/prerequisites/circuitpython-setup-guide`,children:`CircuitPython setup guide`}),` and save this example as `,_jsx(_components.code,{children:`code.py`}),` on the board.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` board`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` adafruit_pcf8574`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` adafruit_character_lcd `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` character_lcd`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`expander `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` adafruit_pcf8574.PCF8574(board.I2C(), `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`address`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`0x`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`27`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`backlight `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`3`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`backlight.switch_to_output(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`value`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lcd `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` character_lcd.Character_LCD_Mono(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`6`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), expander.get_pin(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`7`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`lcd.message `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Hello`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\n`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`PCBCUPID\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` pass`})}),`\n`]})})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`step-4-upload-the-code`,children:`Step 4: Upload the Code`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Connect the Board`})}),`\n`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Connect your GLYPH board to your computer`}),`\n`]}),`\n`,_jsxs(_components.ol,{start:`2`,children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Select the Board and Port`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`Do the following settings in your Arduino IDE,`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`Tools > Board > esp32 > Pcbcupid Glyph S3`})}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`For the `,_jsx(_components.code,{children:`Pcbcupid Glyph S3 `}),` to appear under `,_jsx(_components.code,{children:`Tools > Board > esp32`}),`, the esp32 board version installed in the Arduino IDE should be greater or equal to 3.1.0.`]})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Tools > Port`}),` and select the port connected to your GLYPH.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`Tools > USB CDC on Boot >`}),` `,_jsx(_components.em,{children:_jsx(_components.strong,{children:`Enabled`})})]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`USB CDC on BOOT`}),` not enabled, you won’t be seeing any serial data on Arduino IDE.`]})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Upload the Code`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Click the upload button (➡️ icon) or use the shortcut `,_jsx(_components.code,{children:`CRTL + U`}),` in Arduino IDE to upload the code to the board.`]}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`step-5-observe-output-on-serial-monitor`,children:`Step 5: Observe Output on Serial Monitor`}),`\n`,_jsx(_components.p,{children:_jsx(_components.img,{src:`https://files.pcbcupid.com/Documentation/Boards/Examples/LCD_I2C/PCBCUPID_I2C_LCD_OUTPUT.avif`,alt:`LCD`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"description":"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.","title":"I2C LCD Display","sidebarTitle":"I2C LCD","href":"/guides/lcd-i2c"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"LCD I2C","slug":"lcd-i2c","depth":1,"children":[]},{"title":"Introduction","slug":"introduction","depth":2,"children":[]},{"title":"Pin Configuration","slug":"pin-configuration","depth":2,"children":[]},{"title":"Features","slug":"features","depth":2,"children":[]},{"title":"Typical Applications","slug":"typical-applications","depth":2,"children":[]},{"title":"Step 1: Hardware Required","slug":"step-1-hardware-required","depth":2,"children":[]},{"title":"Step 2: Circuit Diagram","slug":"step-2-circuit-diagram","depth":2,"children":[]},{"title":"Step 3: Code Setup","slug":"step-3-code-setup","depth":2,"children":[]},{"title":"Step 4: Upload the Code","slug":"step-4-upload-the-code","depth":2,"children":[]},{"title":"Step 5: Observe Output on Serial Monitor","slug":"step-5-observe-output-on-serial-monitor","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"dynamicCss":".mint-aspect-video {\n aspect-ratio: 16 / 9\n}\n.mint-w-full {\n width: 100%\n}\n.mint-rounded-xl {\n border-radius: 0.75rem\n}","subdomain":"pcbcupid-bae3761c","siteName":"PCB Cupid","title":"I2C LCD Display - PCB Cupid","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-17T08:18:02.758Z","originalFileLocation":"guides/lcd-i2c.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PCB Cupid\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"I2C LCD Display - PCB Cupid\">\u003cmeta data-mint-head property=\"og:description\" content=\"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PCB Cupid\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://learn.pcbcupid.com/guides/lcd-i2c\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://pcbcupid-bae3761c.mintlify.site/_mintlify/api/og/v2?division=Basic\u0026amp;title=I2C+LCD+Display\u0026amp;description=Connect+a+16x2+LCD+with+I2C+backpack+to+a+Glyph+ESP32+board+over+two+wires+and+print+messages+using+the+LiquidCrystal_I2C+Arduino+library.\u0026amp;theme=2c7e3818cca0f9e7f4434aa9\u0026amp;signature=be3f2a0e9940be554a4bebcefcbe02c00f9b64e0411b2663e262dc55555cd07d\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"I2C LCD Display - PCB Cupid\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://pcbcupid-bae3761c.mintlify.site/_mintlify/api/og/v2?division=Basic\u0026amp;title=I2C+LCD+Display\u0026amp;description=Connect+a+16x2+LCD+with+I2C+backpack+to+a+Glyph+ESP32+board+over+two+wires+and+print+messages+using+the+LiquidCrystal_I2C+Arduino+library.\u0026amp;theme=2c7e3818cca0f9e7f4434aa9\u0026amp;signature=be3f2a0e9940be554a4bebcefcbe02c00f9b64e0411b2663e262dc55555cd07d\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/pcbcupid-bae3761c/TFd0Eu1csuxrLpjH/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PCB Cupid\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://learn.pcbcupid.com/guides/lcd-i2c\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/lcd-i2c.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://learn.pcbcupid.com/#organization\",\"name\":\"PCB Cupid\",\"url\":\"https://learn.pcbcupid.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://learn.pcbcupid.com#website\",\"name\":\"PCB Cupid\",\"url\":\"https://learn.pcbcupid.com\",\"publisher\":{\"@id\":\"https://learn.pcbcupid.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://learn.pcbcupid.com/guides/lcd-i2c#webpage\",\"url\":\"https://learn.pcbcupid.com/guides/lcd-i2c\",\"name\":\"I2C LCD Display\",\"description\":\"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\",\"dateModified\":\"2026-10-17T08:18:02.758Z\",\"isPartOf\":{\"@id\":\"https://learn.pcbcupid.com#website\"},\"breadcrumb\":{\"@id\":\"https://learn.pcbcupid.com/guides/lcd-i2c#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://learn.pcbcupid.com/guides/lcd-i2c#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Basic\",\"item\":\"https://learn.pcbcupid.com/guides/arduino-ide-blink-led\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"I2C LCD Display\",\"item\":\"https://learn.pcbcupid.com/guides/lcd-i2c\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://learn.pcbcupid.com/guides/lcd-i2c#article\",\"headline\":\"I2C LCD Display\",\"name\":\"I2C LCD Display\",\"description\":\"Connect a 16x2 LCD with I2C backpack to a Glyph ESP32 board over two wires and print messages using the LiquidCrystal_I2C Arduino library.\",\"url\":\"https://learn.pcbcupid.com/guides/lcd-i2c\",\"mainEntityOfPage\":{\"@id\":\"https://learn.pcbcupid.com/guides/lcd-i2c#webpage\"},\"dateModified\":\"2026-10-17T08:18:02.758Z\",\"publisher\":{\"@id\":\"https://learn.pcbcupid.com/#organization\"},\"isPartOf\":{\"@id\":\"https://learn.pcbcupid.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PCB Cupid\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"PCB Cupid\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/lcd-i2c.md","siteName":"PCB Cupid","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"Examples","pages":[{"group":"Basic","pages":[{"title":"Blink LED","sidebarTitle":"Blink LED","href":"/guides/arduino-ide-blink-led"},{"title":"Analog Input and Output","sidebarTitle":"Reading Analog Input","href":"/guides/reading-analoginput"},{"title":"Battery Voltage Measurement","sidebarTitle":"Battery Measurement","href":"/guides/battery-measurement"},{"title":"I2C Scanner","sidebarTitle":"I2C Scanner","href":"/guides/i2c-scan-test"},{"title":"BH1750 Adafruit Sensor","sidebarTitle":"BH1750 Sensor","href":"/guides/bh1750adafruit-compatibility"},{"description":"Wire a 16x2 parallel LCD to a Glyph ESP32 board and print text using the LiquidCrystal library, covering pin connections and example code.","title":"Parallel LCD Display","sidebarTitle":"Parallel LCD","href":"/guides/lcd"},{"title":"I2C LCD Display","sidebarTitle":"I2C LCD","href":"/guides/lcd-i2c"},{"description":"Read direction, position, and button presses from a rotary encoder on the Glyph ESP32-C6 board using interrupts and example Arduino code.","title":"Rotary Encoder with Glyph ESP32-C6","sidebarTitle":"Rotary Encoder","href":"/guides/rotor-encoder-with-glyph-c6"},{"title":"Servo Motor Control with Glyph C6","sidebarTitle":"Servo Motor","href":"/guides/servo-motor-with-glyph-c6"},{"title":"Stepper Motor","sidebarTitle":"Stepper Motor","href":"/guides/stepper-motor-with-drv8833"},{"title":"OpenWeatherMap REST API","sidebarTitle":"REST API Weather","href":"/guides/temperature-monitoring-using-glyph"},{"title":"OLED Display Test","sidebarTitle":"OLED Display","href":"/guides/display-test"},{"title":"REST API Weather on SH1106 OLED","sidebarTitle":"REST API Weather with OLED","href":"/guides/temperaturemonitoring-glyph+sh1106oled"},{"title":"DHT Sensor One-Wire Communication","sidebarTitle":"DHT Sensor One-Wire","href":"/guides/dht-onewire-communication"},{"title":"Unipolar Stepper Motor (28BYJ-48)","sidebarTitle":"Unipolar Stepper Motor","href":"/guides/unipolar-stepper-motor"}]},{"group":"Kits","pages":[{"title":"Beginner Kit with GLYPH-C6","sidebarTitle":"Beginner Kit","href":"/guides/kits/beginner-kit"},{"title":"GLYPH Voice Kit","sidebarTitle":"GLYPH Voice Kit","href":"/guides/kits/glyph-voice"},{"title":"GLYPH MIDI Controller Kit","sidebarTitle":"GLYPH MIDI Controller","href":"/guides/kits/glyph-midi-controller"},{"title":"GLYPH Tank Kit","sidebarTitle":"GLYPH Tank Kit","href":"/guides/kits/glyph-tank"}]},{"group":"AI","pages":[{"title":"ESP32-C3 Voice Chatbot","sidebarTitle":"Voice Chatbot","href":"/guides/ai/esp32-c3-voice-chatbot"},{"title":"Z-Claw AI","sidebarTitle":"Z-Claw AI","href":"/guides/ai/z-claw"},{"title":"Edge Impulse Gesture Recognition","sidebarTitle":"Edge Impulse","href":"/guides/ai/edge-impulse"}]},{"group":"Basic Sensors","pages":[{"title":"HC-SR04 Ultrasonic Sensor","sidebarTitle":"Ultrasonic Sensor","href":"/guides/basic-sensors/ultrasonic-sensor"},{"title":"Flame Sensor Test","sidebarTitle":"Flame Sensor","href":"/guides/basic-sensors/flame-sensor"},{"title":"IR Sensor","sidebarTitle":"IR Sensor","href":"/guides/basic-sensors/infrared-sensor"},{"title":"LDR Light Sensor","sidebarTitle":"LDR Light Sensor","href":"/guides/basic-sensors/ldr"},{"title":"MQ2 Gas Sensor","sidebarTitle":"MQ2 Gas Sensor","href":"/guides/basic-sensors/mq2-sensor"},{"title":"Touch Sensor (TTP223)","sidebarTitle":"Touch Sensor","href":"/guides/basic-sensors/touch-sensor"}]},{"group":"Bluetooth","pages":[{"title":"BLE Server Demo","sidebarTitle":"BLE Server","href":"/guides/bluetooth/bluetoothglyph"}]},{"group":"WiFi","pages":[{"title":"Control a Dual Relay over Wi-Fi","sidebarTitle":"Wi-Fi Dual Relay","href":"/guides/wifi/local-webserver-to-control-relay"},{"title":"Create a Wi-Fi Access Point on Glyph","sidebarTitle":"Wi-Fi Access Point","href":"/guides/wifi/wifiaccess-point"}]},{"group":"Zigbee","pages":[{"title":"Arduino Zigbee Blink: C6 to H2","sidebarTitle":"Zigbee Blink","href":"/guides/zigbee/arduino-zigbee-blink"}]}]},{"tab":"PCB Design","pages":[{"title":"PCB Design","href":"/pcb-design/design/kicad/introduction-on-kicad"}]}]},"basePath":"","title":"I2C LCD Display - PCB Cupid","deploymentId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","buildId":"dpl_HhUetB7eHHDAmK9T1Teip38TgFx9","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-DQG3o8Eu.js","lightbox-handle-r17bVUz3.js"]}