Extension board · Controls and displays

Character LCD display

A carrier that puts a standard 16-character, two-line LCD on two I2C wires, with backlight switching and a contrast trimmer. Text appears only when your own driver sends it.

Top view of the character LCD board: the display module outline covering most of the board, with sockets on the left and right edges.
Top view, drawn from the board’s design files. This is a drawing, not a photograph.
16 × 2HD44780-style character module
0x27I2C address as delivered
100 kHzmaximum bus clock
5 V + 3.3 Vboth taken from the socket
≈ 80 mAestimated backlight current
110 × 70millimetres, four M3 holes

Tech specs

PurposeStatus text near the machine. Not for safety messages
Display16-pin 2.54 mm module position for a 16 × 2 character LCD; a 20 × 2 module has the same signals but different size and must be cabled
InterfacePCF8574 expander at 5 V, level shifted to the 3.3 V bus; 100 kHz maximum; address 0x27, selectable down to 0x20
BacklightSwitched by the expander through 10 Ω; check your module’s own resistor and rating
Supply5 V for module and backlight, 3.3 V for the bus
ConnectorsTwo Gadgeteer type I sockets (Samtec SHF-105, 1.27 mm) and one Qwiic
Size110 × 70 mm, four M3 holes on a 100 × 60 mm pattern
Works withSmoothieboard V2 Prime header GG electrically; no firmware driver
LicenceOpen hardware, CERN-OHL-S-2.0

Every figure with its basis is in the electrical specifications appendix; hole positions are in the mounting dimensions appendix.

Board tour

The numbers on the drawing match the list below it. The board is shown from the component side.

  1. 1
    Input socket I IN (J1) — SDA on contact 8, SCL on 9, 5 V on 2.
  2. 2
    Chain socket CHAIN (J2) — Continues the bus.
  3. 3
    Qwiic connector (J3) — The bus on a four-way 3.3 V cable. Qwiic alone does not supply 5 V to the display.
  4. 4
    LCD module position (DS1) — The module solders here with a pin header.
  5. 5
    Contrast trimmer (RV1) — Turn until characters are clearly visible.
  6. 6
    I/O expander (U1) — PCF8574 with the common bit order: RS, R/W, E, backlight, data 4 to 7.
  7. 7
    Level shifters (Q1, Q2) — Connect the 3.3 V bus to the 5 V expander.
  8. 8
    Backlight switch (Q3, R8) — Transistor and series resistor.
  9. 9
    Address links (JP10 to JP12) — Closing a link clears that address bit.
  10. 10
    Pull-up links (JP1, JP2) — Closed as delivered.
  11. 11
    Mounting hole — One of four M3 holes.
Point at a number, or tap it, to read what the part is; the same text is in the list. On a small screen, scroll the drawing sideways.

Pinout

Check contact numbering, and the module’s pin 1 position, before applying power.

J1: input socket (I IN)

ContactSignalUsePrime header GG
13.3 VBus side supply3.3 V
25 VDisplay and backlight5 V
3 to 7Passed throughNot usedPH2, PH4, PC0, PF15, PH3
8SDAI2C dataPF0 (I2C2_SDA)
9SCLI2C clockPF1 (I2C2_SCL)
10GNDGroundGND

DS1: display module

Module pinSignal
1, 2Ground, 5 V
3Contrast from RV1
4, 5, 6RS, R/W, E (expander P0, P1, P2)
11 to 14Data 4 to 7 (expander P4 to P7)
15, 16Backlight anode (through 10 ohm), cathode (switched by P3)

What you need

A 16 x 2 moduleStandard 16-pin parallel type, 5 V.
A pin headerTo solder the module to DS1.
A ten-way cable1.27 mm Gadgeteer ribbon cable, which also brings 5 V.
Your own driverNone is supplied.

Get started

Minimum wiring: contact 1 to contact 1, 3.3 V; contact 2 to contact 2, 5 V; PF0, contact 8 to contact 8, SDA; PF1, contact 9 to contact 9, SCL; contact 10 to contact 10, ground. Prime header GG (J38) LCD board J1 contact 1contact 13.3 V contact 2contact 25 V PF0, contact 8contact 8SDA PF1, contact 9contact 9SCL contact 10contact 10ground
Five connections.
  1. Check the module

    Compare its pin order, size, hole positions and backlight rating with the board.

  2. Solder it

    Fit the module to DS1 with a pin header and spacers.

  3. Connect and power

    Plug J1 into header GG and power up.

    Turn RV1 until a row of faint blocks appears, the sign of an uninitialised module.

  4. Initialise

    Your driver starts the display in 4-bit mode at address 0x27 and writes text.

Configuration

You wantModuleExample
Show textNoneNo SmoothieV2 driver for this display backpack

There is nothing to add to config.ini.

How it works

The 3.3 V bus is shifted to 5 V and an expander drives the display. J1 or J33.3 V I2C Q1, Q2level shift U1 PCF8574eight outputs DS1 LCDcharacters
One signal path.

A character display wants parallel signals. The expander turns I2C bytes into the four data lines and three control lines, and uses its eighth output to switch the backlight. It runs from 5 V to suit common modules; two transistors let the 3.3 V bus talk to it safely.

Solder links

Choose a free address when other PCF8574 devices, such as a keypad, share the bus.

Solder links as delivered: JP1 closed; JP2 closed; JP8 closed; JP9 closed; JP10 open; JP11 open; JP12 open. JP1 · closedSDA pull-up JP2 · closedSCL pull-up JP8 · closedchain SDA JP9 · closedchain SCL JP10 · openaddress bit 0 JP11 · openaddress bit 1 JP12 · openaddress bit 2
The links as delivered. Close one with a small blob of solder across both pads; open it by removing the solder or cutting the copper between the pads.
LinkWhat it doesAs delivered
JP1Connects the SDA pull-upClosed
JP2Connects the SCL pull-upClosed
JP8Continues SDAClosed
JP9Continues SCLClosed
JP10Closed subtracts 1 from address 0x27Open
JP11Closed subtracts 2Open
JP12Closed subtracts 4Open

Chaining

Further I2C devices can follow on J2, each with its own address.

The controller's ribbon cable goes to the connector I IN of the character LCD board. Inside the board each of the ten pins runs through a solder link to the connector CHAIN, where a second ribbon cable continues to the next board. A closed link passes its pin on, an open link stops it. Controller one ten-pin port character LCD board I IN CHAIN pin 7, free passed on pin 8, SDA passed on pin 9, SCL passed on one solder link per pin Next board sees what is passed on
Chaining: one port of the controller serves two boards. Pin 1 of I IN leads to pin 1 of CHAIN, pin 2 to pin 2, and so on, each through its own solder link. The three lines stand for the ten pins and show the links as delivered. Two boards must never drive the same pin, and a pin that one board uses for a signal is not free for the next. All three continue to the next board; pin 7 is wired straight through.
ContactSignalOn CHAIN
1, 2, 10Power and groundPassed on
3 to 7FreePassed on
8, 9I2CPassed on through closed links

Troubleshooting

SymptomLikely causeWhat to check
Blank screenContrast, no 5 V, or backlight offTurn RV1; test 5 V; enable backlight
Only a row of blocksDisplay not initialisedCheck address and driver
No answer on the busAddress links or wiringTest points SDA5, SCL5
Garbled charactersClock too fast or wrong bit orderUse 100 kHz and the bit order above
Backlight dim or hotModule resistor differsCheck the module backlight rating
Light Meaning
Display backlight Switched on by expander output P3

Still stuck? Read how to ask for help or see the general troubleshooting guide.

Downloads

FileWhat it is
Schematic (PDF)The circuit diagram
Parts list (CSV)Every component with its value, footprint and part number where one is chosen
Board drawing (PNG)The top view used on this page
3D view, top (PNG)Rendered from the design files; the display module model is approximate
3D view, angled (PNG)Rendered from the design files; the display module model is approximate

Appendix: mounting dimensions

For drilling a mounting plate or designing an enclosure. Positions are hole centres, in millimetres, measured from the top-left corner with the board seen from the component side. Compare the module’s own mounting holes with the part you buy.

Mounting drawing of the character LCD board, component side: outline 110 by 70 millimetres with 4 mounting holes. Hole positions are listed in the table below. COMPONENT SIDE · millimetres 110 70 0, 0 X Y 1 5.00, 5.00 2 105.00, 5.00 3 5.00, 65.00 4 105.00, 65.00 Numbered rings are mounting holes. Positions are hole centres, X then Y, from the marked corner.
Board outline 110 × 70 mm, corners rounded to a 1 mm radius, board thickness 1.6 mm. Drawn from the design files, component side up, in the same orientation as the board tour.
HoleX (mm)Y (mm)DiameterUse
15.005.003.2 mm, not platedMounting, M3 screw
2105.005.003.2 mm, not platedMounting, M3 screw
35.0065.003.2 mm, not platedMounting, M3 screw
4105.0065.003.2 mm, not platedMounting, M3 screw

Appendix: electrical specifications

Every figure is a design value, a calculated or simulated value, or a manufacturer’s data sheet value, as the last column says. A dash means no figure is given.

ParameterApplies toLowerNominalUpperBasis
SuppliesJ1—3.3 V and 5 V—Design
Module logic current5 V——4 mAModule data sheet
Backlight current5 V——80 mAEstimate from module data
I2C clockU1——100 kHzPCF8574 data sheet
Low level, 5 V sideSDA, SCL—0.04 V0.4 VSimulated
Rise time, 5 V sideSDA, SCL—0.41 µs1 µsSimulated

Component stress limits

PartLimitUse on this board
BacklightSet by the moduleVerify resistor and current for your module
Capacitors10 V and 16 V5 V

Appendix: simulation

The level shifter was simulated with ngspice.

Each simulated value (yellow mark) against its allowed range (green band). Low level on the 5 V side43.4 mV Rise time on the 5 V side (400 kHz limit 300 ns; ...414 ns
Simulated value (yellow) against the limit used for it (green). Each bar has its own scale.
ResultSimulated valueLimitOutcome
Low level on the 5 V side43.4 mVat most 400 mVWithin
Rise time on the 5 V side (400 kHz limit 300 ns; module bus 100 kHz limit 1000 ns)414 nsat most 1 µsWithin

Not simulated: the display module and backlight; the transistor model is generic.

Appendix: datasheet

The first page of each data sheet. Click a page to open the PDF.

First page of the GDM1602K character module datasheet
GDM1602K character module — Xiamen Ocular, 1 pages.
First page of the TC1602A character module datasheet
TC1602A character module — Tinsharp, 18 pages.
First page of the PCF8574 remote 8-bit I/O expander datasheet
PCF8574 remote 8-bit I/O expander — Texas Instruments, 39 pages.
First page of the BSS138 N-channel MOSFET datasheet
BSS138 N-channel MOSFET — onsemi, 8 pages.

See all boards on the extension boards page.

This is a wiki! If you'd like to improve this page, you can edit it on GitHub.