Peuchele bio photo

Peuchele

Pedí pollo que yo pago la diferencia!

Email

LCD to I2C

If you are trying to convert your 16×2 display to I2C, you’ve probably googled and found many resources on the Internet. But if you happen to have a MGD1602B series LCD module, this may be your lucky day, because I’ve already designed a board in Eagle Cad for this purpose. Keep reading and download converter schematic and board. All for free, as (almost) always. Bonus: Eagle Cad library (.lbr) for this LCD module.

First of all, please note that I didn’t invent anything new except for the board itself that was designed for this specific LCD module.

The circuit was stolen from Mario_H’s page. In this page you will also find an Arduino library to drive the LCD via I2C.

MGD1602B Series LCD module

This generic 16×2 module has the following pinout. Please always verify if your LCD match this one, there are a lot of line displays out there from different manufacturers and specs totally different.

The + and – are pins 15 and 16 respectively.

MGD1602B Pinout
MGD1602B Pinout

In this peculiar LCD pins 15 and 16 are not following the linear order of the rest of the pins from 1 to 14!

MGD1602B Pin distribution
MGD1602B Pin distribution

And here is the MGD1602B-NS(W)-BBS BACK AZUL Datasheet, just in case.

Converter board

Converter Schematic Converter Board

Arduino Duemilanove connection

SDA (inner board pin, not being 5v) -> A4

SCL (outer board pin, not being ground) -> A5

Testing code (using LiquidCrystal_I2C library)

Note that the address is 0x38 (all 3 address pins grounded).

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x38, 16, 2);  // set the LCD address to 0x20 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd
  // Print a message to the LCD.
  lcd.backlight();
  lcd.print("Hello, world!");
}

void loop()
{
}

Download converter schematic, board and LCD eagle library

lcd-i2c on GitHub

Good luck!