I2C-adapter voor 1602 of 2004 LCD-displays, voor wie met 2 datadraden wil aansturen.
SKU: OT2021-D48 Número do artigo: AA134 EAN: 4897916523855 Localização: D04.08
Alternativa
LCD 1604 display com retroiluminação azul 16x4 caracteres
€ 7,30
Ver esta alternativa
Como ligar o Adaptador I2C para LCD 1602/2004 a um Arduino UNO ou ESP32, com um sketch de exemplo que podes carregar já.
This project shows how to connect and display text on a 1602 LCD module with an I2C backpack. It initializes the display, turns on the backlight, and prints a greeting along with a live uptime counter. Adjust the potentiometer on the back of the module if the text contrast is too high or low.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : 1602 I2C LCD Display Demo
* Board : Arduino UNO (arduino:avr:uno)
* Parts : 1602 LCD I2C DISPLAY
* Libraries : LiquidCrystal I2C 1.1.2
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Most 1602 I2C modules use address 0x27 or 0x3F
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Hello, Arduino!");
lcd.setCursor(0, 1);
lcd.print("Uptime: 0s");
Serial.println(F("1602 LCD display initialized."));
}
void loop() {
static unsigned long seconds = 0;
delay(1000);
seconds++;
lcd.setCursor(8, 1);
lcd.print(seconds);
lcd.print("s ");
Serial.print(F("Uptime (s): "));
Serial.println(seconds);
}
Bibliotecas necessárias: LiquidCrystal I2C 1.1.2
Wiring diagram and example code generated by Codey.online — https://www.codey.online
This project displays a welcome message and an uptime counter on a 1602 I2C character LCD. A 4-channel bidirectional logic level shifter is used to safely bridge the 3.3V I2C signals of the ESP32 to the 5V logic required by the LCD backpack. Once powered, the LCD will initialize and update the running seconds every second.
/*
* ==================================================================
* Generated by Codey.online — https://www.codey.online
* ==================================================================
* Project : ESP32 1602 I2C LCD Display Demo
* Board : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
* Parts : 1602 LCD I2C DISPLAY
* Libraries : LiquidCrystal I2C 1.1.2
*
* Codey Online is an AI-powered browser IDE for Arduino and ESP32.
* Describe your project and Codey writes the code, draws the wiring
* diagram and uploads it to your board, straight from the browser.
* This code is free to use, modify and share, without warranty.
* ==================================================================
*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address (commonly 0x27 or 0x3F) for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(115200);
// Initialize I2C communication (SDA = GPIO 21, SCL = GPIO 22)
Wire.begin(21, 22);
// Initialize the LCD
lcd.init();
lcd.backlight();
// Print greeting
lcd.setCursor(0, 0);
lcd.print("ESP32 LCD Demo");
lcd.setCursor(0, 1);
lcd.print("Uptime: 0s");
Serial.println("1602 LCD Initialized!");
}
void loop() {
// Update uptime counter every second
static unsigned long lastUpdate = 0;
if (millis() - lastUpdate >= 1000) {
lastUpdate = millis();
unsigned long seconds = millis() / 1000;
lcd.setCursor(8, 1);
lcd.print(seconds);
lcd.print("s ");
Serial.print("Uptime: ");
Serial.print(seconds);
Serial.println(" s");
}
}
Bibliotecas necessárias: LiquidCrystal I2C 1.1.2
Wiring diagram and example code generated by Codey.online — https://www.codey.online
Com este módulo, você pode adicionar uma interface de comunicação I2C / IIC ao seu display LCD 1602 ou 2004, permitindo que sejam necessários apenas 2 fios de dados para controlar o seu display LCD.
• Tensão de alimentação: 2,5 - 6 V
• suporta o protocolo I2C
• Definição do endereço do dispositivo (A0 / A1 / A2)
• Ligar/desligar a retroiluminação
• Ajuste de contraste possível
• Dimensões (CxLxA): 41,5 x 19 x 15,3 mm
Dimensões
Comprimento: 4,55cm
Largura: 1,9cm
Altura: 1,5cm
| Dimensões | 41,5 x 19 x 15,3 mm |
|---|---|
| Largura | 1,9 cm |
| Comprimento | 4,55 cm |
| Tensão de alimentação | 2,5 - 6 V |
| Altura | 1.5 cm |
Melhor do que 16 cabos
Funciona como esperado!
Não ficas satisfeito? Tens 30 dias após a receção para devolver o produto.
Tudo sobre devoluções
Adaptador I2C para LCD 1602/2004