The LCD backpack (aka. K107) board interfaces any HD44780-based LCD (this is the vast majority of LCD’s you will encounter) with a three-wire serial interface, consisting of +5volts, ground and serial data. The board uses a programmed PIC chip, created by Maryland EE professor Peter Anderson, to convert serial commands (e.g. Serial.print(“Freeduino”) ) into LCD text.

This boards turns any inexpensive (HD44780-compatible) LCD into a serial LCD.

Hook up power, ground and data and you’re good to go. No fussy libraries or handfuls of wires. Peter Anderson’s feaure set is really robust. You can check the command summary and sample code below.

This board is engineered for microcontrollers. Brian Riley of has a similar board but his includes an inverter option. If you need to hook up an LCD directly to a computer RS232 serial port get his board.

LCD Serial Backpack by ModernDevice

Board is currently available through Modern Device.

Custom Character Definitions
The character strings found below can be used to define custom characters when using the K107 backpack.

  1. 040E0E0E0E1F0004 => BELL
  2. 00000103161C0800 => CHECKMARK

Command Summary

Reference adopted from

Some commands require a delay to ensure proper transmission.

Command / Comments

Suggested Pause


Send Text

Serial.print(“Hello World!”);


Home Cursor



Destructive Backspace

Serial.print(“?b”); // backspace


Set Cursor Style:  0= none 2= blinking 3=underline

(“?c0”); // turn cursor off


Clear Screen



Beep (requires speaker on pin 6)



Backup Cursor (Non-destructive backspace)



Forward cursor



Up cursor



Down cursor



Clear cursor line



Carriage Return



CRLF, carriage return & line feed,
cursor at start of next line, line cleared



Set tabs at # spaces

100 ms

// set tab to 7 spaces


Tab, advance one tab position



Position cursor on x column, (two characters are required), first column is column 0

// cursor to column 10


Position cursor at y row, first row is row 0,
one digit only (no leading zero)

// cursor to row 4


Display a “?”



Send direct command to LCD



Backlight Intensity – sets PWM value, two hex digits req. (00 to FF)

100 ms

// backlight on full brightness


Define Character “?D#1A001A001A001A00” D# = character
# 0-7 then 8 two character hex digits representing
(5 bit values top to bottom)

100 ms

// custom character 3
// every other line black


Print a custom character
numerals 0-7 are valid

5 ms

// print custom character 3


High output on auxiliary digital pins: valid numbers are 4,5,6

// aux pin 4 HIGH


Low output on auxiliary digital pins: valid numbers are 4,5,6


// aux pin 4 LOW


Configure for LCD geometry. Supported formats:
2X16, 2X20, 2X24, 2X40, 4X16 and 4X20.

// configure driver for 2 x 16 LCD

Ganging up commands is OK, except for commands requiring a following  pause

Serial.print(“?x01?y1?fHello World”);
// cursor to beginning of line 1
// clear screen, print “Hello World”

Enhanced Commands


Enter BIG Number Mode (numbers only!) “?>3” X # = 3 or 4 ,

# represents number of characters displayed. (20×4 LCD’s only)

100 ms

// enter big number mode, 4 character option.


Exit BIG number mode “?<“



Define custom boot screen line # = 0 – 3

100 ms



“?S0” – display no screen on boot.
“?S1”  – display the configuration setting on boot
“?S2” – display the user custom text screen on boot.

Serial.print(“?S2); // custom boot screen

?* display boot screen at any time Serial.print(“?*); // show boot screen


pixel · 02/03/2012 at 15:31

The LCD geometry is definitely your problem. LCD’s use addresses to reference each character position on the display but the addresses from line to line are not sequential. For example on a 4×16 LCD the addresses work like this:

0x00-0x15 – Line 1
0x32-0x47 – Line 2
0x16-0x31 – Line 3
0x48-0x63 – Line 4

You will notice that when you reach the end of the line and keep printing characters they start appearing on line 3 NOT line 2 because of how the address space is organized. This also causes all kinds of problems when the K107 thinks it is using a different sized display than it actually is because all the positioning the K107 does is based on these address ranges.

Now to actually solve the problem you will need to tell the K107 board that it is driving a 4×20 so that it knows how to ‘chop up’ the address space. For the K107 this is super simple and only needs to be configured once when you plug in a new LCD with a different geometry. It remembers the geometry between disconnects.

To set the geometry for your display you need to send the “?G” command (which is explained above) with the number of lines followed by the width of the display (in characters). So for a 4×20 display you would send the string “?G420” at which point you should be all set.

Hopefully that should fix things.

Leave a Reply

%d bloggers like this: