Arduino: LCD with native I2C support and AIP31068L Driver (replacement for Liquid Crystal I2C)
Surenoo and Grove offer Liquid Crystal Displays with native I2C support using an AIP31068. Also variants with RGB backlights are available. The AIP31068 uses a similar character set like the well known HD44870 ROM A00.
The Character Set of the AIP31068L LCD
The character set of the AIP31068L is similar to the Hitachi HD44780U A00 ROM.
The "Noiasca Liquid Crystal" library does a character mapping from UTF-8 to the existing characters in the LCD ROM. As example some special characters in the second row of the display:
(Degree, Division, middle Point, n with tilde, Pound, Yen, Tilde, Sqareroot, Proportional to, Infinity, Left Arrow, Right Arrow, Backslash)
You can read more about this character mapping in the Introduction or in the German section of this site. For the beginning you should know that you don't need to enter the octal ROM addresses of the special characters manually and these print can be done by a simple:
lcd.print("°÷·ñ£¥~√∝∞←→\\");
The Hardware Driver for Native Wire/I2C Displays
The library offers a basic class for native wire/I2C displays. It uses the 8bit mode and slightly adopted wait times after commands according to the datasheet.
The necessary #include and the constructor are:
#include <Wire.h> #include <NoiascaLiquidCrystal.h> #include <NoiascaHW/lcd_wire.h> LiquidCrystal_Wire lcd(lcdAddr, cols, rows);
Remember to add a Wire.begin() to your setup() like in the examples, as this will not be done in the library.
Arduino Library for the Surenoo RGB LCD
The Surenoo RGB LCD uses a dedicated PCA9633 at I2C address 0x60 as backlight LED driver.
The necessary specific constant, #include and the constructor for the Surenoo display are:
const byte lcdAddr = 0x3E; #include <NoiascaLiquidCrystal.h> #include <NoiascaHW/lcd_wire.h> LiquidCrystal_Wire_RGB lcd(lcdAddr, cols, rows);
You can set the RGB color with
lcd.setRGB(255, 128, 64);
the method always takes 3 parameters for red green and blue each value can be 0..255.
Hack for the Sureeno RGB LCD
To get a reliable communication with the Surenoo RGB LCD, my display needed a small hardware hack: I've added a 100nF decoupling capacitor between GND and VCC.
The Grove Display
The Grove RGB Display uses a different I2C address for the RGB IC. Therefore you have to hand over the RGB address 0x62 as second parameter to the display.
The necessary #include and the constructor are:
const byte lcdAddr = 0x3E; const byte rgbAddr = 0x62; #include <NoiascaLiquidCrystal.h> #include <NoiascaHW/lcd_wire.h> LiquidCrystal_Wire_RGB lcd(lcdAddr, rgbAddr, cols, rows);
Additional (and modified) methods for the Surenoo and Grove displays with PCA9633
Backlight controls will be done by the three RGB colors. After startup the activation of the backlight will switch to a medium "greyisch" look (127, 127, 127).
You can set the RGB color with
lcd.setRGB(255, 128, 64);
To switch off the backlight
lcd.noBacklight();
To reactivate the previous colors switch on the backlight:
lcd.backlight();
You can dim your backlight, it's like "control the brightness". The value can range from 0 - 255:
lcd.setBacklight(255);
You can set a 1Hz blink mode completely done by the RGB chip. This means it will not need resources from the Arduino for blinking:
lcd.blinkBacklight(); // blink the backlight
To stop the backlight blinking call
lcd.noBlinkBacklight(); // stop blinking backlight
Build in Examples
All examples regarding displays with native I2C interface (like the Surenoo RGB or the Grove RGB) can be found in the example folder 05_wire.
Your own Character Converter
If you need a different converter for the characters you can hand over a callback function as optional last parameter.
Obviously - you also have to implement the callback function to do all the magic.
See the general example "50 Convert" how to write your own character converter.
German Umlauts
For my German readers: the default constructor enables the support for the small letters ä ö ü and ß. The large German umlauts Ä Ö Ü (with diaeresis) will be converted to their counterpart A O U. If you want to try other variants, you can hand over different callback converter functions:
LiquidCrystal_Wire_RGB lcd(addr, cols, rows, csPin); // Ä becomes A //LiquidCrystal_Wire_RGB lcd(addr, cols, rows, csPin, convert_ae); // Ä becomes Ae //LiquidCrystal_Wire_RGB lcd(addr, cols, rows, csPin, convert_small); // Ä becomes ä //LiquidCrystal_Wire_RGB lcd(addr, cols, rows, csPin, convert_special); // Ä becomes Ä
Summary
The Wire class in "Noiasca Liquid Crystal" enables you to run LCDs with native I2C interface using an AIP31068. For the Surenoo LCD and Grove display the support of the RGB backlight controll with a PCA9633 was added.