A while back, I bought a cheap i2c LCD module for my arduino off of ebay. It is a "funduino" module.
I was unsure of how to use it and it came without any documentation so I searched the internet for answers. Wiring it up is pretty straight forward, the Arduino i2c ports are fixed:
Here is a mapping from the Arduino to the back of the module.
- A4 -> SCL
- A5 -> SDA
- 5V -> VCC
- GND -> GND
Additionally, this module has a wrongly labelled backlight enable jumper. On the opposite side of the main connector there are two more pins labelled GND and VCC. Shorting these causes the backlight to turn on, if the backlight() function was called on the LiquidCrystal_I2C object in your sketch.
The standard LiquidCrystal Arduino library does not work with this i2c module. I found a module named
LiquidCrystal_I2C which works and provides the same interface. Instead of constructing a LiquidCrystal object, you build a LiquidCrystal_I2C object and pass it the module's i2c address as the first parameter. In addition the module still requires the original parameters. For my module, the following snippet initializes it:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity
void setup() {
lcd.begin(16, 2);
lcd.backlight();
lcd.print("Hello World");
}
While writing up these notes, I found that the last argument (the polarity argument) must be POSITIVE to enable usage of the backlight.