element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi Projects
  • Products
  • Raspberry Pi
  • Raspberry Pi Projects
  • More
  • Cancel
Raspberry Pi Projects
Documents Building a Low Power Compact LCD Display
  • Blog
  • Documents
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi Projects to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 22 Apr 2016 4:41 PM Date Created
  • Last Updated Last Updated: 10 May 2021 6:52 PM
  • Views 11813 views
  • Likes 20 likes
  • Comments 50 comments
Related
Recommended

Building a Low Power Compact LCD Display

(Note: For a follow-up project which uses a larger screen, click here:Building a 3.5 Digit Low Power LCD Module  )

image

Introduction

Sometimes a really simple, low power display is needed. A lot of information can be shown on even a 7-segment display!

 

This LCD board project could be useful for such purposes. The three 7-segment digits (and two decimal places total, between the digits) can show percentages, hexadecimal values, voltages and current readings. Plenty of characters can be represented too.

 

Up to four of these displays can be connected to a single I2C bus so (for example) a power supply project could use one display for voltage and another for current, for two channels. To save costs for smaller projects a single display could be used to show more than one item of information using  a button press or periodic cycling of data on the display.

image

 

The reflective LCD that is used has no backlight but has very good contrast and in tests had excellent visibility even in dim light. The power consumption is extremely low and this makes it ideal for portable projects which might need to run for years on batteries without charging. The entire bill-of-materials is less than £5GBP (or lower if multiple displays are purchased).

The schematic and plot (gerber) files and source code is attached to this post. I had 20 PCBs made for less than the cost of a pizza.

image

As a quick test I tried it using a Raspberry Pi just counting up from 0.0 to 99.9. With very little effort it would be possible to use it to display Pi stats – for example temperature, or the IP address (one byte at a time) upon start-up. It is easy to get any script to write to the display from the command line.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Features Summary

  • 3.3V or 5V capable
  • Ultra-low current consumption (24uA at 3.3V)
  • Extremely compact; 32x21mm
  • Just a 4 wire connection; I2C Interface, 0V and VDD (3.3V or 5V)
  • Individually addressable segments for alphanumeric and other symbol use
  • Quick to assemble; less than a dozen parts
  • Low cost; about £5GBP in quantities of 1

 

Parts List

RefCodeMnfr Part #DescriptionQtyGBP Each
LCD118389301838930LCD-S301C31TRLCD-S301C31TRLCD 3-digit11.85
U124004602400460PCF85176TLCD Driver11.18
C317591221759122MC0603B104K500CT100N 0603 x7r10.01
R1, R320733492073349MCMR06X1002FTLMCMR06X1002FTL10K Res 060320.01
R2, R4, R5D.N.F.00.00
R6, R793319729331972MC0063W060352K7MC0063W060352K72.7k Res 060320.01
J1159341515934152211S-06G2211S-06GSIL header 6-way10.26
Optional177848177848D01-99012 01PCB pin sockets 12-way21.18
Optional229985622998560552-2-15-01-21-27-10-00552-2-15-01-21-27-10-0PCB pin sockets (alternative)240.07

 

Additional components for 5V operation

RefCodeMnfr Part #DescriptionQtyGBP Each
U223143722314372TPS70925DBVTTPS70925DBVTLDO 2.5V Voltage Regulator10.82
C119073431907343C1608X7R1C105K080AC1u 0603 X7R10.04
C217355421735542GRM21BR71E225KA73LGRM21BR71E225KA73L2.2u 0805 X7R10.24

 

How it Works

There are different types of LCDs, but in general they require an alternating current (AC) signal to turn on segments. Some use a square wave, others require multiple voltage levels in order to achieve high segment density with low pin count through multiplexing.

The particular LCD chosen requires a square wave, and has the benefit of providing high contrast digits. Reflective displays offer high contrast but have the disadvantage that they are opaque from the underside and cannot be lit from behind so require either ambient light to be visible or a side light.

 

Some microcontrollers feature LCD driving capability but there is a classic integrated circuit from NXP that is useful to offload the task from microcontrollers and allow the use of an I2C bus for interfacing. That IC is the PCF8576 which has been around for more than two decades. NXP have a more recent IC called PCF85176 (it appears to be backwards-compatible) and that is the one used for this project because it has very low power consumption requirements and a higher speed I2C bus capability than its predecessor.

Nothing else is needed apart from a few resistors and capacitors.

 

The LCD needs a few volts peak voltage in order to function. For 5V operation a linear regulator provides the lower voltage to run the LCD.

 

Building It

image

Order the boards from a PCB firm (the files are attached to this post). Once the PCBs arrive, the first step is to solder the PCF85176 chip. It is quite small (0.5mm spaced pins) but hand-soldering is still possible. A hot plate and solder paste would be another option. I just used a normal soldering iron (2mm tip) and no-clean flux (cleaned up afterwards) and thin solder.

 

The hardest part is perfect alignment. The way I do it is to tape the IC onto the PCB first. Then, inspect the pins using a magnifying lens. If it looks incorrect, peel the tape from one end but keep the IC attached to the tape. Move the tape and re-stick it onto the PCB. It becomes quite easy to align the IC and secure it in this manner, just moving the tape from one side at a time.

 

Next, apply a small amount of no-clean flux and start soldering. Any bridges will fall away if you re-heat with the iron, but if the bridge is persistent then use de-soldering braid. The soldering iron needs a bit of solder applied to the tip in order to get the solder-wicking effect when using the braid.

 

Optionally use pin sockets (or SIL sockets) so that the LCD does not need to be soldered. It is highly recommended that sockets are used to protect the LCD and also because it would be difficult to unsolder the LCD if there was a problem with the PCF85176 that needed examining.

After all the parts have been soldered clean the board using an IPA solution and then examine each pin on the PCF85176 under a lens (push each pin gently with the side of a scalpel blade) to verify all is well.

image

 

If the display only needs to operate from 3.3V then you don’t need to solder the linear regulator IC and its associated capacitors. If multiple displays on the same I2C bus are needed then the addresses are programmed using two 10k resistors that can be soldered in different positions (see the source code for a table which indicates this).

image

 

The attached files are slightly improved to the boards that I used, in that there is a white space for labelling them if multiple displays are needed for a single project.

 

After checks for any short circuits, the LCD can now be connected up to the Pi.

image

 

Software

As a quick test some C code was written for the ‘Pi. It was tested using a Pi 2 but should work on others, there is nothing special to the code.

To enable I2C on the ‘Pi, add the following line to /boot/config.txt (you need to be root user to do this):

dtparam i2c_arm=on

 

Reboot the Pi and then type (as root user):

modprobe i2c_dev

 

To make it persistent across reboots you can add the following (as root user) to the /etc/modules file:

i2c-dev

 

Grab the code from github. To compile the code type the following:

gcc -c i2cfunc.c -o i2cfunc.o
ar rcs libi2cfunc.a i2cfunc.o
gcc lcd3-test.c -L. -li2cfunc -o lcd3-test

 

To run it, type:

./lcd-test

 

Currently the code can display decimal points, digits 0-9 and space.

To use it, call the print_line() function. Here are some examples:

print_line(" 0.0");
print_line("1.23");
print_line("   "); // clear the screen

 

image

 

The I2C interface is a standard, and it would be very easy to port the code across to any microcontroller/Arduino/etc.

 

Summary

NXP’s I2C LCD chip continues to be useful after two decades. The cost, size and low power consumption are attractive for some use-cases. Although this project uses surface mount components they are cheap enough that it could be a useful board to practice with. The very low power consumption means that a couple of AA batteries should last for five years or more with the display always on.

 

image

 

Advanced Use: Extending the Character Set

Many characters are possible with 7-segment displays.

image

Three bytes represent which segments are to be activated. Refer to the diagram to see the bit mappings.

image

 

To extend the character set to display hyphens or alphabet characters, the following array needs to be extended:

 

const char bit_table[]=
{
  0x38, 0x00, 0x86,    0x00, 0xbe, 0x00,    0x86, 0x00, 0x38,    /* 0 */
  0x08, 0x00, 0x02,    0x00, 0x0a, 0x00,    0x02, 0x00, 0x08,    /* 1 */
  0x30, 0x00, 0x46,    0x00, 0x76, 0x00,    0x46, 0x00, 0x30,    /* 2 */
  0x18, 0x00, 0x46,    0x00, 0x5e, 0x00,    0x46, 0x00, 0x18,    /* 3 */
  0x08, 0x00, 0xc2,    0x00, 0xca, 0x00,    0xc2, 0x00, 0x08,    /* 4 */
  0x18, 0x00, 0xc4,    0x00, 0xdc, 0x00,    0xc4, 0x00, 0x18,    /* 5 */
  0x38, 0x00, 0xc4,    0x00, 0xfc, 0x00,    0xc4, 0x00, 0x38,    /* 6 */
  0x08, 0x00, 0x06,    0x00, 0x0e, 0x00,    0x06, 0x00, 0x08,    /* 7 */
  0x38, 0x00, 0xc6,    0x00, 0xfe, 0x00,    0xc6, 0x00, 0x38,    /* 8 */
  0x18, 0x00, 0xc6,    0x00, 0xde, 0x00,    0xc6, 0x00, 0x18     /* 9 */
};

 

The first group of three bytes indicates the segments that need to be turned on for the digit in the leftmost position, the second group of three refer to the center digit and the last three refer to the rightmost digit. If ASCII sequence is not followed then modify the char_prog function accordingly.

 

To enable the extra characters, the print_line function case statement checks can be extended.

Attachments:
export-lcd3.zip
export-lcd3-rev2.zip
export-lcd3-rev2-with-board-outline.zip
  • low_power
  • eagle
  • eagle-cad
  • lcd
  • rpiintermediate
  • lcd display
  • eagle_cad
  • raspberry_pi
  • display
  • nxp
  • raspberry_pi_projects
  • feature_tutorial
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • Jan Cumps
    Jan Cumps over 8 years ago in reply to shabaz +5
    Works fully now I'll create a follow up blog with the ported code.... edit: done - Building a Low Power Compact LCD Display - Port to Hercules Safety Microcontroller
  • DAB
    DAB over 9 years ago +4
    Great post Shabaz. You provide good information on how to use different LCD screens and interface them to a MCU. DAB
  • Jan Cumps
    Jan Cumps over 8 years ago +4
    I'm going to play along. I'll first try to talk to it with a Bus Pirate v4. Then as a low power reception indicator for a Sub-1GHz range test...
  • shrutip
    shrutip over 5 years ago

    Hi,

    I am trying to use PCF85176H for my 7 segment LCD (2 Rows, 4 Digits each). Need to use 1:3 multiplexing mode of operation  Can anyone please guide to generate lookup table?  I am using the same library and able to turn ON display but with existing lookup table it displays incorrect values as expected....

     

    Below is Pin interface & Circuit:

    image

     

     

    image

     

    Thanks & Regards....

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to colporteur

    The display I'm showing in the animation is approx 3 * 3 cm. A 1*1 cm viewport would give 40*40 pixels

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to colporteur

    Hi Sean,

     

    Depending on how experimental you want to go, an electronic zoetrope-type thing could be possible. I'm picturing something with lots of transparencies, like the circular ViewMaster things.. and rotating that with a stepper motor, with everything embedded in a model wall, or behind, and just a square visible with a frame around it. Sync'd with a white backlight, it should look like a flickering color TV maybe. But it could be a lot of effort : (

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 6 years ago in reply to Jan Cumps

    An idea I would suggest myself except for the modeling community expectation of realism.

     

    I created an arc welder that flashed on and off. Not good enough they said. In the end, light from four colours of LEDs flashing randomly, with random on and off duration, passed through a piece of fibre strand to hand of the miniature character, made muster.

     

    I saw the post on small displays and like a dog seeing a squirrel, I yanked on the leach to go have a look to see if there was a match.

     

    Sean

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to colporteur

    Maybe you could simulate colour television by using a monochrome display and replacing the backlight with an rgb led?

    Cunning modulation and mixing of the 3 colours of the led may give the impression of colour tv ...

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 6 years ago in reply to shabaz

    My plan is to display and black and white western or charlie chaplin slap stick skit. The picture would default to the old TV Indian head television test pattern when not running. Maybe some flicker and horizontal rolling before the tubes warm up.

     

    You are correct in the build using only a part of a larger screen. Blending large screens into the background is difficult. Smaller screen pose less problems and provide greater options.

     

    Sean

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to colporteur

    Ohh I see. Wow, that's tiny. I've not seen a ballpark 1x1cm viewing area colour display : (

    I do vaguely remember making a model building as a GCSE project for D&T, and I think I used an LED, flickering, behind tissue-paper, to simulate the glow from a TV.. not very sophisticated unfortunately : (

    Maybe if the LCD was inside (say) a model wall, and only part of it was visible, it may look like a smaller TV mounted on the wall. I think you'll have no issue with frame rate, since you'll only be writing instructions to update a fraction of the display content - there may even be commands to scroll content, but I didn't check that.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur over 6 years ago in reply to shabaz

    I'm looking to display graphics (i.e. video) in a 1cm X 1cm viewing area. The goal is to simulate content playing on a TV, positioned in a miniature room. The smaller the physical screen size, the more flexibility there is for installation.

     

    Sean

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 6 years ago in reply to shabaz

    Regarding colour displays: I've developed for the TFT coulour display on the TI Eduational BoosterPack MKII.

    There was a driver library for the energia ecosystem and msp43x controller family that I ported to a Hercules CPU - not too hard to adapt it for another controller if you know its SPI API.

    128 x 128 pixels, with text, graph and bitmap  instructions.

     

    image

    Also: mind blown about your PRU library, shabaz.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago in reply to colporteur

    Hi Sean!

     

    I'm not currently working on colour graphic displays, but there's a couple of old blog posts that might be approximately what you're looking for.

    OLED

    For extremely high quality, I tried an OLED display (it was 160x128 resolution, and 1.45" active area) and the display was bright and great at all viewing angles.

    It is described here:

    BBB - Small OLED Graphic Display

    The display is available from aliexpress, but is expensive ($15). The source code at that blog post was written for BeagleBone Black, but is very easy to port to Pi, and it would be feasible to run a couple of them (or more) from a single Pi, if you wanted to replicate eyes.

     

    TFT LCD

    Small lower-cost graphic TFT LCD non-IPS displays are available, described here: BBB - Connecting up an LCD

    The TFT LCD is $7 but compared to OLED, the TFT LCD has the issue of contrast fading off when viewing at some angles.

    Also, unfortunately my source code at that blog post is in assembler (for a specialist CPU inside the BeagleBone Black) but could be translated to C or Python etc for the Pi. C would be better, for higher-speed updates. Again, multiple displays could be run from the Pi.

     

    If you're doing animations, then both of these options are fine if you're happy with update rates of single-digit Hertz (maybe 10-15Hz at best, at a guess). They are not really for 24fps video for instance.

    In contrast most of the off-the-shelf TFT LCD HATs for the Pi only allow a single display to be connected, but will allow for video.

     

    The Adafruit animated eyes product looks like a close option to OLED. It does look like very high quality output, since it is an IPS panel, and higher-res than the OLED display mentioned earlier. I suppose at $20 per display, it costs about the same as an OLED+custom PCB would cost.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube