3 wires interface for LCD display using Arduino

This post is based on the work made previously by tomek in wiring LCD displays using 4 bits. The basic idea is to group the 7 pins that are needed to drive the LCD in only 3 using a shift register. This is a cheap alternative to serial LCDs.

The schematic shows that wiring the LCD is a simple operation. It has been drawn in a way that makes it possible to develop this as part of a single sided PCB including a variable resistor to control the LCD’s contrast. Note that the pin-out of the LCD module may differ slightly from the pin-out depicted; some LCD modules have pins 15 and 16 on the left side, before pin 1.

In this picture we see the actual connections on a breadboard. Everything runs on the power from the USB powered board.

NewLiquidCrystal Code

As part of the Arduino Miniconf at linux.conf.au 2012, freetronics released the pebble v2 with identical Shift Register wiring than this page, and Attendee Marc MERLIN wrote a NewLiquidCrystal driver for this hardware: http://marc.merlins.org/perso/arduino/post_2012-01-23_LiquidCrystal-driver-support-LCD3Wire-hardware-_pebble-and-others_.html

This driver should work for all LCD3Wires based hardware, and was based on the excellent work from Francisco Malpartida who modified the original LiquidCrystal library to provide support for different hardware drivers. His work is available here: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home . This is the work Marc based his driver on to provide full LiquidCrystal support to LCD3Wires hardware by writing LiquidCrystal_SR_LCD3.cpp.

Original (obsolete) code

Below is the original code originally written to talk to this hardware setup. It does not work out of the box with arduino 1.0, and the library is much less featureful than LiquidCrystal. It is left here for historical purposes.

The code below includes a couple of functions that will print integer numbers to the LCD, as well as single characters.

Also available is a library: Attach:LCD3WireLibrary.zip. To remain command-compatible with the LCD4BitLibrary, this library does not contain the number-formatting code which is included in the code below.

An updated version of the library (Attach:LCD3WireLibrary.0.2.zip) inherits from the Print class, giving an improved print() function.

Note: these libraries aren’t compatible with IDE 1.0 – you will get compiling errors.

3 wires interface for LCD display using Arduino schematic

To get the original version working on IDE 1.0 you have to copy/paste WConstants.h and wiring.h from IDE 0023 into arduino-1.0\hardware\arduino\cores\arduino

To get the 0.2 version working on IDE 1.0 do the same thing as above and then make the following changes in the LCD3WireLibrary.h and LCD3WireLibrary.cpp files:

In the header file change “virtual void write(uint8_t);” to “virtual size_t write(uint8_t);”

[box color=”#985D00″ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12″ float=”right” head=”Major Components in Project” headbg=”#FFEB70″ headcolor=”#985D00″]Arduino
LCD[/box]

For more detail: 3 wires interface for LCD display using Arduino


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top