Hobby Components SmartLCD User manual

SmartLCD Backpack Module for
1602 & 2004 LCD Displays
HCMODU0162
Revision 1.1.0

DISCLAIMER
This document is provided "as is". Hobby Components Ltd makes no warranties, whether express,
implied or statutory, including, but not limited to, implied warranties of merchantability and fitness for a
particular purpose, accuracy or lack of negligence. Hobby Components Ltd shall not, in any
circumstances, be liable for any damages, including, but not limited to, special, incidental or consequential
damages for any reason whatsoever.
The Arduino name is a protected trademark of Arduino and its partners. Our products are not directly
connected to Arduino and are derivatives of the Arduino open source (Creative Commons CC-SA-BY
License). Any help or technical support should be directed to Hobby Components Ltd.
(www.hobbycomponents.com).
COPYRIGHT NOTICE
This manual, including content and artwork is copyright of Hobby Components Ltd and may not be
reproduced without written permission. If you paid for or received a copy of this manual from a source
Page 2 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Table of Contents
Description 5
Terminal Mode: 5
AT Command Mode: 5
I2C Mode: 6
Features 6
Terminal mode 6
Serial AT command mode 6
I2C Mode 6
Specification 7
General Operating Conditions 7
Attaching the SmartLCD to a display 8
Interface 10
Clear (Factory Reset) 10
Setting the SmartLCD to 16x2 or 20x4 character mode 11
Mode (UART Terminal/AT mode) 12
External 5V Power 12
I2C Interface 12
Serial UART Interface 13
Terminal mode 13
AT command mode 14
Software 15
I2C 15
Master to slave write format 15
I2C commands 16
Print character (0x00) 17
Clear screen (0x01) 17
Set cursor position (0x02) 17
Display State (0x03) 18
Display Cursor (0x04) 18
Cursor Blink (0x05) 18
Backlight State (0x06) 19
Print Custom Character (0x07) 19
Define Custom Character (0x08) 19
Cursor Direction (0x09) 20
Initialise The Display (0x0A) 21
Clear Button State (0x0B) 21
Play Note (0x0C) 21
Page 3 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Set I2C address (0x0D) 22
Contrast (0x0E) 23
Display Software Version (0x0F) 23
Clear Error State (0xFB) 23
I2C Status Register 24
I2C ADC Register 25
Serial UART – AT Command Mode 26
AT 27
AT+PR=String 27
AT+CLR 27
AT+RC=Row,Col 28
AT+DS=State 28
AT+DC=State 28
AT+DB=State 29
AT+BL=Level 29
AT+PC=Index 29
AT+SC=Index,Row0,Row1,Row2,Row3,Row4,Row5,Row6,Row7 30
AT+CD=Direction 30
AT+BR=Baud 31
AT+TO=Time 31
AT+INI 32
AT+BT? 32
AT+BP? 33
AT+BCL 33
AT+AD? 33
AT+BE=Note,Time 34
AT+CT=Level 35
AT+FV? 35
Serial UART – Passive Mode 36
Optional Features - LCD Keypad 37
Optional Features – Wireless access 38
Page 4 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Description
The SmartLCD backpack module is designed to be interfaced directly to the parallel
interface of commonly available 16x02 and 20x04 LCD alphanumeric displays using the
Hitachi HD44780 controller (see hobby components items HCMODU0013, HCMODU0038,
& HCMODU0039 for compatible displays). Once soldered to the rear of one of these
displays the SmartLCD backpack module turns these displays into intelligent serial devices
which can then be controlled via either a serial UART or I2C interface. It also requires no
software or libraries to initialise the display, output text to the screen or control the features
of the module, which reduces development time and frees up much needed resources in
your microcontroller or development board.
For customers wishing to purchase the SmartLCD backpack already fitted to a suitable
display these are available from Hobby Components in both 16x02 and 20x04
configurations:
Hobby Components 1602 SmartLCD (SKU: HCMODU0122)
Hobby Components 2004 SmartLCD (SKU: HCMODU0163)
The SmartLCD module adds three types of interface to the parallel LCD:
Terminal Mode:
This is the out-of-the-box state (mode jumper fitted) and with no configuration required will
turn a 16x2 or 20x4 LCD into a serial UART terminal display. Just connect any device with
a serial UART interface (9600 default BAUD rate) to the SmartLCDs UART header and the
SmartLCD will automatically output any ASCII printable text it receives to the LCD. As well
as printable text the SmartLCD also supports several ASCII control codes such as line
feed, carriage return, backspace, delete etc.
AT Command Mode:
In AT command mode (mode jumper removed) the SmartLCD module can be controlled
using simple text based ‘AT’ commands via its serial UART header. AT command mode
adds a significantly greater level of control of the LCD, including precise positioning of text,
backlight and contrast controls, custom characters, etc. As they are simple serial text
commands they can be sent to the module using a microcontroller's serial print function
such as an Arduinos built-in Serial.println() function.
Page 5 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

I2C Mode:
Serial I2C mode gives the same level of control as AT command mode but also takes
advantage of the I2C two-wire serial interface protocol. In this mode the module is
addressable, allowing for multiple modules to be daisy-chained from a microcontrollers I2C
interface.
For Arduino users wanting to take advantage of this mode we have written a library
(SmartLCD) and example sketches to make controlling the SmartLCD module from your
own sketches as simple as possible. The library will give full control of the SmartLCD using
a set of straightforward library commands. The SmartLCD library can be downloaded from
the software section of our support forum here:
https://forum.hobbycomponents.com/viewtopic.php?f=58&t=2206
Features
Turns a 16x2 or 20x4 alphanumeric character display into a smart serial device.
In terminal mode no software or drivers are required to initialise or control the module.
Software backlight control with 11 brightness levels.
Software contrast control.
External keypad with buzzer support (optional extra, see item HCKITS0058).
Single 5V operation.
Terminal mode
Compatible with 5V serial UART devices (9600 baud default) – no microcontroller
required.
Automatically displays any printable ASCII text.
Responds to a number of additional extended ASCII control codes.
Serial AT command mode
Software control of all module features via simple AT text commands.
Software configurable baud with 8 different speeds (9600 BAUD default).
Access to external keypad and buzzer.
I2C Mode
Control multiple displays from one I2C bus.
Software control of all module features via simple I2C commands.
I2C address configurable via software from 0x08 to 0x77 (default 0x27).
Built-in 10K pull-up resistors for clock SCL and data SDA lines.
Access to external keypad and buzzer.
Page 6 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Specification
Model number: HCMODU0162
Supply voltage: 5V
Display type: Supports 16 x 2 or 20 x 4 alphanumeric HD44780 LCDs
Supply current: 9.8mA
Interfaces: I2C, serial UART and external keypad
Module dimensions: 42mm x 23.5mm
General Operating Conditions
Parameter
Symbol
Condition
Min
Typ
Max
Unit
Supply voltage
Vdd-Vss
---
4.5
5
5.5
V
Supply current
Idd
Backlight 100%
26
27
28
mA
Idd
Backlight 0%
6
6.5
7
mA
Digital output pins low level voltage
IOOVl
Vdd = 5V IOIdd = 1mA
---
Vdd – 0.2
---
V
Vdd = 5V IOIdd = 10mA
---
Vdd – 1.1
---
V
Digital output pins sink/source current
IOOIdd
Vdd = 5V
---
---
10
mA
Digital input pins low level voltage
IOIVl
Vdd = 5V
-0.3V
---
0.3 x Vdd
V
Digital input pins high level voltage
IOIVh
Vdd = 5V
0.7 x Vdd
---
Vdd + 0.3
V
SCL clock low time
tw(SCLL)
---
4.7
---
---
us
SCL clock high time
tw(SCLH)
---
4.0
---
---
us
SDA and SCL rise time
tr(SDA)
tr(SCL)
---
---
---
1000
ns
SDA and SCL fall time
tf(SDA)
tf(SCL)
---
---
---
300
ns
Capacitive load for each I2C bus line
Cb
Vdd = 5V
---
---
400
pF
Keypad (analogue in) conversion voltage range
Vain
---
Vss
---
Vdd
V
Keypad (analogue in) internal sampling capacitor
CADC
---
---
3
---
pF
Keypad (analogue in) conversion error
EtADC
Vdd = 5V RAIN < 10KΩ
---
---
1
LSB
Operating temperature
Topr
---
0
---
50
°C
Page 7 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Attaching the SmartLCD to a display
The SmartLCD backpack module can be attached to a suitable LCD display by soldering
the module to the display's parallel interface header using the pin header strip supplied
with the module. Note that the SmartLCD module is only compatible with 16 character by 2
line and 20 character by 4 line alphanumeric LCD displays using a Hitichi HD44780 (or
HD44780 compatible) controller. For compatible displays please see Hobby Components
items:
16x02 character transmissive parallel LCD with blue backlight (SKU: HCMODU0013)
https://hobbycomponents.com/displays/184-1602-parallel-lcd-module-blue-backlight
16x02 character transflective parallel LCD with yellow backlight (SKU: HCMODU0038):
https://hobbycomponents.com/displays/328-1602-parallel-lcd-module-yellow-backlight
20x04 character transmissive parallel LCD with blue backlight (SKU: HCMODU0039):
https://hobbycomponents.com/displays/478-2004-parallel-lcd-module
To attached the SmartLCD module to the LCD display, first insert the supplied header strip
in to the reverse side of the LCDs parallel interface by inserting the header strip through
the LCD displays pads from the reverse side of the LCD as shown:
Then solder the header strip to the LCDs pads on the display side of the LCD making sure
the header strip remains flat against the displays PCB on the rear side:
Page 8 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Next, flip the display back over to the rear side and insert the SmartLCD modules parallel
interface header onto the header pins with the component side of the SmartLCD module
facing away from the back of the LCD and towards you making sure that the SmartLCDs
parallel interface is correctly aligned with the header pins:
Any excess pins protruding from either the LCD or SmartLCD module headers can be
optionally trimmed usings a pair of wire snips after soldering.
Note: By default the SmartLCD is configured for a 16 character by 2 line display. If you
have fitted the SmartLCD to a 20 character by line display you will need to initialise the
display to 20x4 display mode to take advantage of the 20x2 LCDs additional character
resolution. To do this see the ‘Clear (Factory Reset)’ section.
Page 9 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Interface
Interfacing to the Smart LCD can be done via the right-angled header pin or solder pads
found around the edges of the Smart LCD module. The following sections provide
descriptions and examples for each interface.
Clear (Factory Reset)
The SmartLCD is capable of storing a number of user configuration settings in the
non-volatile memory. This allows the module to retain these settings even after power is
removed. The two pads marked ‘CLEAR’ provide a means of restoring the module back to
its factory default settings. Should you wish to reset the display simply connect power to
the module whilst shorting the two pads together.
Page 10 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

After power is applied to the module it will perform a simple factory test and reset its
configuration settings to their default values. While the display is performing this process
the screen will show various test information. At the end of the test the display will show
confirmation of the default I2C address and serial baud rates. Once the reset process is
complete you can then remove the link and restart the module.
Setting the SmartLCD to 16x2 or 20x4 character mode
Whilst performing a factory reset the SmartLCD can also be configured to either 16x2 or
20x4 display modes. By default the SmartLCD will be initialised into 16x2 mode when a
factory reset is made.
If you have fitted the SmartLCD to a 20x4 display the SmartLCD can be set to 20x4 mode
by connecting the ‘C’ pin on the SmartLCDs I2C interface header to any GND pin whilst
performing a factory reset as described above:
Whilst performing the initialisation process the SmartLCD will confirm that it is in 20x4
mode by displaying ‘20x04 Mode’ on the display.
Once the factory reset process is complete both the ‘Clear’ and GND connection to the I2C
‘C’ pin can be removed. The SmartLCD will remain in 20x4 mode even after power is
removed from the display and can only be changed back to 16x2 mode by performing a
factory reset with the I2C ‘C’ pin left unconnected.
Page 11 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Mode (UART Terminal/AT mode)
The mode header allows selection of the serial interface operating mode. Using the
supplied jumper allows for selection between passive terminal mode (jumper fitted) and AT
command mode (jumper removed). See the UART Interface section below for more
information about these modes.
External 5V Power
Besides powering the SmartLCD module from any of the interface headers, the module
can also be powered via a GND (0V) and 5V connection to solder pads marked ‘G’ and
‘5V’. This provides a convenient way to power the module from an external 5V power
source.
I2C Interface
Allows two way communication with the Smart LCD from an I2C master device. When
connected to the I2C interface the Smart LCD will behave as a standard I2C slave device
with a default 7 bit I2C address of 0x27. This default address can be changed via a
software I2C command (see command section). The module also includes built-in 10K
pull-up resistors on the SDA and SCL bus communication lines. Using the I2C interface
gives full control of all the Smart LCD’s display and control features.
Page 12 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Example: Interfacing to the I2C interface of an Uno development board
Serial UART Interface
Allows two way communication with the SmartLCD from a standard serial UART device
using 5V TTL logic levels. When using the UART to access the device there are two
selectable modes of operation:
Terminal mode
Passive mode can be selected by connecting the supplied jumper across both MODE
header pins. In this mode the SmartLCD will automatically display any printable ASCII text
received via its UART Rx pin. This allows the module to be used as a simple terminal
display. In this mode access to most of the Smart LCD's control features are not available,
however the module will respond to some extended ASCII control codes providing limited
screen control. See the software section of this manual for a list of ASCII extended control
characters compatible with this module.
Page 13 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

AT command mode
In AT command mode full access to the SmartLCD's features is available by simple AT
text based commands. This includes outputting text and control of the screen, plus full
access to the SmartLCD's features. For a list of available AT commands and how to use
them please see the software section of this manual.
Example: Connecting the SmartLCD to a computer via a USB to serial adapter.
Page 14 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Software
Control of the SmartLCD can be made via the serial I2C and UART interfaces. In both
cases full access to all the SmartLCD's features are available. I2C interface control and
printing to the screen can be done via simple multi-byte I2C commands from a I2C master
device. Serial UART interface control and printing to the screen is done by text based AT
commands. The next sections of the document will describe how to communicate and
control the SmartLCD via these interfaces.
I2C
The SmartLCD will respond to data sent from an I2C bus master device. By default the
SmartLCD has a slave address of 0x27 and will ignore data sent to any other I2C address.
It supports both read and write operations that allow the bus master to send predefined
commands to the SmartLCD, and also to read back the state of the I2C and status
registers.
Master to slave write format
When writing to the SmartLCD from an I2C master, the format of the data consists of a 7
bit address byte (plus 1 R/W bit), a command byte. Following the command byte there
may be one or more parameter bytes depending on the type of command sent in the
command byte. Both the command and parameter bytes must be sent in the same write
session.
Page 15 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

I2C commands
Command
Code (hex)
Parameter Number
Parameter
Param Min
Param Max
Print character
0x00
1
ASCII code for character to be printed
0x20
0x7E
Clear screen
0x01
NA
NA
NA
NA
Set cursor position
0x02
1
Row index
0x00
0x03
2
Column index
0x00
0x4F
Display state
0x03
1
0x00 (LCD OFF) or 0x01 (LCD ON)
0x00
0x01
Display cursor
0x04
1
0x00 (Cursor OFF) or 0x01 (Cursor
ON)
0x00
0x01
Cursor blink
0x05
1
0x00 (Blink disabled) or 0x01 (Blink
enabled)
0x00
0x01
Backlight state
0x06
1
On time in 10% increments
0x00
0x0A
Print custom character
0x07
1
Custom character index
0x00
0x07
Define custom character
0x08
1
Custom character index
0x00
0x07
2
Character row 0 bitmap
0x00
0x1F
3
Character row 1 bitmap
0x00
0x1F
4
Character row 2 bitmap
0x00
0x1F
5
Character row 3 bitmap
0x00
0x1F
6
Character row 4 bitmap
0x00
0x1F
7
Character row 5 bitmap
0x00
0x1F
8
Character row 6 bitmap
0x00
0x1F
9
Character row 7 bitmap
0x00
0x1F
Cursor direction
0x09
1
0x00 = Left to right or 0x01 = Right to
left
0x00
0x01
Initialise the display
0x0A
NA
NA
NA
NA
Clear button state
0x0B
NA
NA
NA
NA
Play note
0x0C
1
Note
0x00
0x0B
2
Duration in 10ms increments
0x00
0xFF
I2C address
0x0D
1
I2C address
0x08
0x77
Contrast
0x0E
1
Contrast level (0 = max, 255 = min)
0x00
0xFF
Display firmware version
0x0F
NA
NA
NA
NA
Page 16 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Table2: I2C command lookup table
Print character (0x00)
Writes a single printable ASCII character to the screen at the current cursor position. Once
the character is printed the cursor is then automatically moved to the next character
position.
Parameter(s):
The command has one parameter which specifies the ASCII character code to print.
Printable characters range between 0x20 (‘ ‘) and 0x7E (‘~’).
Clear screen (0x01)
Clears the entire screen. Issuing a clear command will also set the position of the cursor to
row 0 and column 0.
Parameter(s):
None.
Set cursor position (0x02)
Sets the row and column position of the cursor where row 0, column 0 is the top left
character position of the screen.
Page 17 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Parameter(s):
There are two parameters, the first sets the cursor row position. Note that on a 16 x 2 line
display only rows 0 to 1 are visible.
The second parameter sets the cursors column position. Note that on a 16 x 2 line display
only columns 0 to 15 are visible. On a 20 x 4 line display only columns 0 to 19 are visible.
Display State (0x03)
Turns the screen on or off. Note that when turned off only the LCD panel will be switched
off, the backlight will remain on if it is already enabled.
Parameter(s):
The command has one parameter which specifies the state of the LCD. A value of 0 will
turn the LCD off, and a value of 1 will turn the LCD on.
Display Cursor (0x04)
Sets the visible state of the cursor. When visible, the cursor will appear as a single line of
pixels below the current selected character row.
Parameter(s):
The command has one parameter which specifies the visible state of the cursor. A value of
0 will make the cursor invisible, and a value of 1 will make the cursor visible.
Cursor Blink (0x05)
Page 18 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Enables or disables blinking of the cursor.
Parameter(s):
The command has one parameter which specifies the blink state. A value of 0 will disable
blinking, and a value of 1 will enable cursor blinking.
Backlight State (0x06)
Sets the brightness of the backlight.
Parameter(s):
The command has one parameter which specifies the brightness of the backlight in 10%
increments where 0 = backlight off and a value of 10 = 100% on.
Print Custom Character (0x07)
Prints one of the eight custom (user defined) characters to the screen at the current cursor
position. Note that the custom character to be printed must have been previously defined
using the write custom character command (0x08).
Parameter(s):
The command has one parameter that specifies which of the eight custom characters (0 to
7) to print to the screen.
Define Custom Character (0x08)
Page 19 Smart LCD Backpack Module Manual | ©Hobbycomponents.com

Writes a user defined 5 x 8 pixel bitmap to one of the eight custom characters. Note that
on 16x02 and 20x04 displays the eighth character row is not visible. After writing to one of
the custom characters it is necessary to reset the cursor position before any further
characters can be written to the screen.
Parameter(s):
The command has 9 parameters. The first specifies which of the eight (8) custom
characters (0 to 7) to write the bitmap data too.
Parameters 2 to 9 contain the 5 pixel bitmap information for each of the 8 rows of the
custom characters.
Example bit pattern
Cursor Direction (0x09)
Sets the direction in which the cursor will move after a character is printed to the screen.
Parameter(s):
The command has one parameter that specifies which direction to move the cursor. A
value of 0 will move the cursor from left to right, and a value of 1 will move the cursor from
right to left.
Page 20 Smart LCD Backpack Module Manual | ©Hobbycomponents.com
This manual suits for next models
3
Table of contents
Other Hobby Components Control Unit manuals
Popular Control Unit manuals by other brands

Honeywell
Honeywell VP522A quick start guide

Innomaker
Innomaker HIFI DAC HAT user manual

Hubbell
Hubbell GAI-TRONICS 379-003 E3 IP MRM manual

BENDIX
BENDIX E-12-E-15 BRAKE VALVE manual

National Instruments
National Instruments PXI-2503 Specifications

Savant
Savant GPM-CP2R20120-21 Quick Reference and Installation Guide