edit

Grove - LCD RGB Backlight

enter image description here

Done with tedious mono color backlight? This Grove enables you to set the color to whatever you like via the simple and concise Grove interface. It takes I2C as communication method with your microcontroller. So number of pins required for data exchange and backlight control shrinks from ~10 to 2, relieving IOs for other challenging tasks. Besides, Grove - LCD RGB Backlight supports user-defined characters. Want to get a love heart or some other foreign characters? Just take advantage of this feature and design it! This product is a replacement of Grove - Serial LCD. If you are looking for primitive 16x2 LCD modules, we have green yellow backlight version and blue backlight version on sale also.

Note

This document works for Grove-LCD RGB Backlight Version 1.0, 2.0 and 4.0.

Version

Product Version Changes Released Date
Grove-LCD RGB Backlight V1.0 Initial June 2012
Grove-LCD RGB Backlight V2.0 Optimize PCB layout Nov 2013
Grove-LCD RGB Backlight V4.0 Optimize PCB layout Sep 2016

Features

  • RGB Backlight
  • I2C communication
  • Built-in English fonts
  • 16x2 LCD

Tip

More details about Grove modules please refer to Grove System

Specification

Item Value
Input Voltage 5V
Operating Current <60mA
CGROM 10880 bit
CGRAM 64x8 bit
LCD I2C Address 0X3E
RGB I2C Address 0X62

Note

There are 4 I2C addresses and we use 2 I2C addresses for LCD and RGB.

Platforms Supported

Arduino Raspberry Pi BeagleBone Wio LinkIt ONE

Caution

The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Application Ideas

  • Human Machine Interface
  • Smart House
  • Sensor Hub

Here are some projects for your reference.

Edison Wi-Fi Address WiFi Enabled Greenhouse Grove Lucky Dumpling
enter image description here enter image description here enter image description here
Make it Now! Make it Now! Make it Now!
Toothbrushing Instructor LinkIt ONE Pager LinkIt ONE IoT Demo
enter image description here enter image description here enter image description here
Make it Now! Make it Now! Make it Now!

Getting Started

Note

If this is the first time you work with Arduino, we firmly recommend you to see Getting Started with Arduino before the start.

Play With Arduino

Hardware

  • Step 1. Prepare the below stuffs:
Seeeduino V4.2 Base Shield Grove-LCD RGB Backlight
enter image description here enter image description here enter image description here
Get One Now Get One Now Get One Now
  • Step 2. Connect Grove-LCD RGB Backlight to I2C port of Grove-Base Shield.
  • Step 3. Plug Grove - Base Shield into Seeeduino.
  • Step 4. Connect Seeeduino to PC via a USB cable.

Note

If we don't have Grove Base Shield, We also can directly connect Grove-LCD RGB Backlight to Seeeduino as below.

Seeeduino Grove-LCD RGB Backlight
5V Red
GND Black
SDA White
SCL Yellow

Software

  • Step 1. Download the Grove-LCD RGB Backlight Library from Github.
  • Step 2. Refer How to install library to install library for Arduino.
  • Step 3. Here are 12 examples in the library as below.

    • Autoscroll
    • Blink
    • Cursor
    • CustomCharacter
    • Display
    • fade
    • HelloWorld
    • Scroll
    • SerialDisplay
    • setColor
    • setCursor
    • TextDirection
  • Step 4. Please follow below picture to select example HelloWorld and upload the arduino. If you do not know how to upload the code, please check how to upload code.

Here is the code of HelloWorld.ino.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <Wire.h>
#include "rgb_lcd.h"

rgb_lcd lcd;

const int colorR = 255;
const int colorG = 0;
const int colorB = 0;

void setup() 
{
    // set up the LCD's number of columns and rows:
    lcd.begin(16, 2);

    lcd.setRGB(colorR, colorG, colorB);

    // Print a message to the LCD.
    lcd.print("hello, world!");

    delay(1000);
}

void loop() 
{
    // set the cursor to column 0, line 1
    // (note: line 1 is the second row, since counting begins with 0):
    lcd.setCursor(0, 1);
    // print the number of seconds since reset:
    lcd.print(millis()/1000);

    delay(100);
}
  • Step 4. We will see the hello world on LCD.

Play With Raspberry Pi

Hardware

  • Step 1. Prepare the below stuffs:
Raspberry pi GrovePi_Plus Grove-LCD RGB Backlight
enter image description here enter image description here enter image description here
Get One Now Get One Now Get One Now
  • Step 2. Plug the GrovePi_Plus into Raspberry.
  • Step 3. Connect Grove-LCD RGB Backlight to I2C port of GrovePi_Plus.
  • Step 4. Connect the Raspberry to PC through USB cable.

Software

  • Step 1. Follow Setting Software to configure the development environment.
  • Step 2. Git clone the Github repository.
1
2
cd ~
git clone https://github.com/DexterInd/GrovePi.git
  • Step 3. Excute below commands to use the Grove-LCD RGB Backlight to display.
1
2
cd ~/GrovePi/Software/Python/grove_rgb_lcd
python grove_rgb_lcd.py

Here is the grove_rgb_lcd.py code.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import time,sys

if sys.platform == 'uwp':
    import winrt_smbus as smbus
    bus = smbus.SMBus(1)
else:
    import smbus
    import RPi.GPIO as GPIO
    rev = GPIO.RPI_REVISION
    if rev == 2 or rev == 3:
        bus = smbus.SMBus(1)
    else:
        bus = smbus.SMBus(0)

# this device has two I2C addresses
DISPLAY_RGB_ADDR = 0x62
DISPLAY_TEXT_ADDR = 0x3e

# set backlight to (R,G,B) (values from 0..255 for each)
def setRGB(r,g,b):
    bus.write_byte_data(DISPLAY_RGB_ADDR,0,0)
    bus.write_byte_data(DISPLAY_RGB_ADDR,1,0)
    bus.write_byte_data(DISPLAY_RGB_ADDR,0x08,0xaa)
    bus.write_byte_data(DISPLAY_RGB_ADDR,4,r)
    bus.write_byte_data(DISPLAY_RGB_ADDR,3,g)
    bus.write_byte_data(DISPLAY_RGB_ADDR,2,b)

# send command to display (no need for external use)    
def textCommand(cmd):
    bus.write_byte_data(DISPLAY_TEXT_ADDR,0x80,cmd)

# set display text \n for second line(or auto wrap)     
def setText(text):
    textCommand(0x01) # clear display
    time.sleep(.05)
    textCommand(0x08 | 0x04) # display on, no cursor
    textCommand(0x28) # 2 lines
    time.sleep(.05)
    count = 0
    row = 0
    for c in text:
        if c == '\n' or count == 16:
            count = 0
            row += 1
            if row == 2:
                break
            textCommand(0xc0)
            if c == '\n':
                continue
        count += 1
        bus.write_byte_data(DISPLAY_TEXT_ADDR,0x40,ord(c))

#Update the display without erasing the display
def setText_norefresh(text):
    textCommand(0x02) # return home
    time.sleep(.05)
    textCommand(0x08 | 0x04) # display on, no cursor
    textCommand(0x28) # 2 lines
    time.sleep(.05)
    count = 0
    row = 0
    while len(text) < 32: #clears the rest of the screen
        text += ' '
    for c in text:
        if c == '\n' or count == 16:
            count = 0
            row += 1
            if row == 2:
                break
            textCommand(0xc0)
            if c == '\n':
                continue
        count += 1
        bus.write_byte_data(DISPLAY_TEXT_ADDR,0x40,ord(c))

# example code
if __name__=="__main__":
    setText("Hello world\nThis is an LCD test")
    setRGB(0,128,64)
    time.sleep(2)
    for c in range(0,255):
        setText_norefresh("Going to sleep in {}...".format(str(c)))
        setRGB(c,255-c,0)
        time.sleep(0.1)
    setRGB(0,255,0)
    setText("Bye bye, this should wrap onto next line")
  • Step 4. We will see the Grove-LCD RGB Backlight display as Going to sleep in 1...

FAQ

Resources

Projects

Particle + Grove LCD RGB Backlight = Realtime Clock: Connect Grove LCD RGB Backlight to Particle using I2C to display time.

LCD RGB Grove module:

Tech Support

Please submit any technical issue into our forum.