Arduino Giga R1 WiFi LCD I2C

by DIYables in Circuits > Arduino

9 Views, 0 Favorites, 0 Comments

Arduino Giga R1 WiFi LCD I2C

arduino-giga-r1-wifi-lcd-i2c-cover.jpg

This is a compact build guide. The full tutorial, with the wiring diagram and a line-by-line walkthrough of the code, is here: https://newbiely.com/tutorials/arduino-giga/arduino-giga-r1-wifi-lcd-i2c

This guide shows how to wire and program an I2C LCD with the Arduino Giga R1 WiFi. The I2C backpack cuts the wiring from the usual 12 pins down to 4 (GND, VCC, SDA, SCL), making it much easier to add a character display to a project. The example covers basic text output, cursor positioning, and the library calls needed to drive the display.

Supplies

Wiring

arduino-giga-r1-wifi-lcd-i2c-wiring-diagram.jpg

Connect GND on the LCD I2C module to GND on the Giga R1 WiFi, and VCC to the Arduino 5V pin, which can source up to 800mA. Connect SDA to the Arduino's SDA2 pin (pin 9) and SCL to SCL2 (pin 8). Use the 3.3V LCD I2C display recommended for this board; most LCD I2C modules on the market are 5V and, while the Giga's I2C pins are 5V tolerant, a 3.3V display is the safer choice.

How It Works

The LCD I2C module combines a standard HD44780-compatible character LCD with a PCF8574 I2C interface chip that converts I2C commands into the parallel signals the LCD controller expects. Built-in 4.7kΩ pull-up resistors on the module make it compatible with the Giga's hardware I2C controller without extra components. The display is addressed as a 16x2 grid using zero-based coordinates, from (0,0) at top-left to (15,1) at bottom-right, and setCursor(column, row) selects where the next printed character goes.

Code

The sketch includes the DIYables_LCD_I2C library, which handles the I2C protocol, LCD initialization, and character encoding internally. You create a DIYables_LCD_I2C object with the I2C address plus the number of columns and rows, call its init function to set up the display, then use setCursor(column, row) to position the cursor and print() to write text at that position.

arduino-giga-r1-wifi-lcd-i2c.ino - the sketch from the tutorial, unchanged.

#include <DIYables_LCD_I2C.h>

DIYables_LCD_I2C lcd(0x27, 16, 2, Wire2); // LCD on Wire2

void setup() {
lcd.init(); // initialize the lcd
lcd.backlight();
}

void loop() {
lcd.clear(); // clear display
lcd.setCursor(0, 0); // move cursor to (0, 0)
lcd.print("DIYables");
lcd.setCursor(0, 1); // Move the cursor to column 0, row 1 (second row)
lcd.print("www.diyables.io");
delay(2000); // display the above for two seconds

lcd.clear(); // clear display
lcd.setCursor(0, 0); // move cursor to (0, 0)
lcd.print("Int: ");
lcd.print(1234); // Print integer
lcd.setCursor(0, 1); // Move to the beginning of the second row
lcd.print("Float: ");
lcd.print(56.76); // Print float
delay(2000); // display the above for two seconds
}

Full Tutorial

The complete tutorial, wiring diagram and code explanation: https://newbiely.com/tutorials/arduino-giga/arduino-giga-r1-wifi-lcd-i2c