What should I expect in I2C LCD capability

I want to start using NANO boards in more more projects, and will need to pick some keypad and LCD displays for general I/O. But I’d like to use I2C interfaces for these to minimize pins used. So I’d like to hear from others what limitations to expect, especially for the LCD. For example, is a “text only” display the best I can hope for? I imagine any complex graphics beyond a spinning “slash” won’t be easy or will be impossible, but it would be nice to at least add a static LOGO if bit mapped images are possible.

As a born cheapskate, I’ll probably do some shopping on AliExpress where prices are great, but solid information in English will be rare. So I’m hoping to get a feel for other’s experience regarding what I can expect and what is probably out of reach?

Thanks in advance.

There are many choices for what you want. 0.96" 128x64 OLED displays are very inexpensive and easy to program. If you're not married to using I2C, the old Nokia 5110 LCD displays (84x48 pixels) are very inexpensive and low power, but they use the SPI bus. You could also get a small color LCD like the ST7735R (128x160x16bpp). Those are SPI too.

Think about your requirements:

  1. Alpha versus dot matrix
  2. Transflective / requires backlight / light emitting (OLED)
  3. Size
  4. Power usage
  5. Price

Luckily there are a lot of inexpensive options that will probably do what you need.

bitbank:
There are many choices for what you want. 0.96" 128x64 OLED displays are very inexpensive and easy to program. If you're not married to using I2C, the old Nokia 5110 LCD displays (84x48 pixels) are very inexpensive and low power, but they use the SPI bus. You could also get a small color LCD like the ST7735R (128x160x16bpp). Those are SPI too.

Think about your requirements:

  1. Alpha versus dot matrix
  2. Transflective / requires backlight / light emitting (OLED)
  3. Size
  4. Power usage
  5. Price

Luckily there are a lot of inexpensive options that will probably do what you need.

Thanks. I don't think using 3 wires (SPI) would bother me a lot if it opened more options. I don't think I've used an SPI bus yet, but it should be worth exploring.

I mainly need alpha/num for the kind of I/O I'm thinking of initially. Basically just to couple with a keypad and enable a user to key in numbers representing various device settings. Or I could create simple menus. But looking ahead, should I ever decide to make some kind of salable product, it would be nice to at least display a little eye candy. I guess I was thinking that once I made the jump to a dot matrix display, any kind of serial interface probably would require too many separate commands sent to create a smooth motion display.

Equally a concern, even if it worked, it might mean a great deal of the little NANO's program space would be used up on eye candy. But maybe I'm underestimating both the NANO, and the smarts built into some of these cheap displays. I need to see what others have done, and what successes/disappointments they've had along the way.

If you aren't married to the AVR you could use an ESP8266 based board.
They are about the same size (some are smaller), and have GOBs of FLASH and RAM so you likely will not have resource issues ever again in that respect.
Having built-in wifi is also really nice for IoT type projects.
Cost is also about the same.

--- bill

bperrybap:
If you aren't married to the AVR you could use an ESP8266 based board.
They are about the same size (some are smaller), and have GOBs of FLASH and RAM so you likely will not have resource issues ever again in that respect.
Having built-in wifi is also really nice for IoT type projects.
Cost is also about the same.

--- bill

Yeah I've just recently discovered those ESP8266 boards, and am considering their use for, as you say, IoT additions to projects. But with CPU boards like that so cheap, I think its better to "distribute" the processing of my projects. Let the 8266 just handle I/O through "the air" so to speak, and let the little NANO board concentrate on whatever task the project calls for.

In any case when it comes to LCDs (or even keypads) its likely many of those components will have their own CPU as well. At least that's what I'm hoping to hear. If the LCD is smart (and still cheap), than maybe I can pre-program some of those eye-candy graphics I mentioned into the LCD's processor off line, so my little NANO's can get/display project settings and such.

But right now, I'm just looking to hear what LCD goodies people have discovered. Doesn't have to be I2C, but any serial interface that keeps the pins used to a minimum will do.

Dropping my two-cents in -
I have a pro-mini running the .96" OLED on the SPI; a great display for custom graphics and text. However, the large library leaves little room for expansive code in the pro-mini; the nano appears to have the same amount flash.

“the nano appears to have the same amount flash.”

It should - they both use the same '328P processor.

Want more flash? Jump to '1284P, 128K flash, or '2560, with 256K flash.

CrossRoads:
Want more flash? Jump to '1284P, 128K flash, or '2560, with 256K flash.

Some boards with that flash/ram is the Teensy++ (AVR) or Teensy 3.1 (ARM) for around $20 USD but
NodeMCU modules (ESP8266) have 4MB-32MB flash for about $3-4 USD :smiley:

— bill

JMeller:
Dropping my two-cents in -
I have a pro-mini running the .96" OLED on the SPI; a great display for custom graphics and text. However, the large library leaves little room for expansive code in the pro-mini; the nano appears to have the same amount flash.

I had a feeling that would be the case. Just how much available space does it typically eat up? I assume you mean this one:

And I don't suppose it would be worth the time to try to strip it down to just the functionality I'd want? If driving a display takes the lion's share of code space and resources, I guess the NANO would be a poor match. But I wasn't thinking of going that far. Maybe a 96 x 32 single color display would be plenty, and if I can make a small bitmap logo that would be enough.

But... should I assume though that once I pick to a display with graphic ability, the library now has to waste flash space holding bitmaps for a whole character set? I guess I'd hoped that at least one or two fonts would already be built into the LCD's hardware and internal memory, so I'd only need bit maps for maybe a special case (like a simple LOGO design).

I faintly remember stripping my code to the basics and using constant char* as much as feasibly possibly. Unless senior members chime in and state otherwise, I doubt the nano (or mini) is the correct choice for graphics w/ expansive code. I would heed bperrybap's advice; I concur because I know the esp8266 has a vast amount of flash with a small footprint.

It depends on what you are planning to do. Yes the AVR even a m328 with only 32k flash and 2k ram can control a LCD including a graphical LCD but you are correct that flash must be used to hold bitmaps and usually fonts as well.
Color displays like the ILI9341 are inexpensive ($4-$5) really nice and even have SD card h/w on them which could be used for holding graphic images.
You could do quite a bit with something like the Nano even on a color display like that.
But you will always have to pay close attention to code size and RAM usage when using a grahical display on that type of processor.
Also because the AVR can't directly access flash it makes your code wonky and painful having to use the AVR proprietary PROGMEM stuff to get to data stored in FLASH. Other processors don't have that issue and can access the flash directly through pointers which can make things easier to code.

However, when you have much more powerful processor along with 4MB to 32MB of flash and 96k of RAM and wifi it opens up a entirely different way of doing things. Like using a web interface with a browser on smart phone instead of actual displays and button/keypad inputs.

Although I have seen some very impressive projects like a smart sprinkler system that used a web interface over ethernet along with a simple LCD display for status.
The web pages were fairly simple but very effective.
But that was done a few years ago before parts like the ESP8266 was available.
Today if I were to start a project like that, I'd use either a ESP8266 module or a Rasperry Pi zero W.
ESP NodeMCU or Wemos Mini modules are under $5 and the zero is about $10 but is often on sale for $5.
It might be easier on the Raspberry Pi since you can use a real operating system along with full tools and a choice of many different modern languages and even debug it on your linux desktop before you move the code over to the Pi zero. (or even hook a monitor and keyboard to the Pi and use the native desktop for development)

Or some home automation projects that used AVR based nodes to wirelessly communicate back to an msqtt server.

It really depends on what you want to do and your budgets.
By "budget" I don't necessarily mean just money.
Yes things like intelligent displays can get pricey which relates to money,
but then things like the ESP modules can use up to 200ma which is not so good if looking at a battery powered project.
And the backlight on a GLCD can pull as much as 400ma.
ESP modules offer gobs of storage and speed at a very low cost but are 3v vs the AVR is 5v with a much higher output current capability.
If you need 5V or higher output current, then ESP modules are not a good fit.

You really have to look at the project and kind of look over everything as a whole to help determine a direction.

--- bill

bperrybap:
You really have to look at the project and kind of look over everything as a whole to help determine a direction.

--- bill

Thanks Bill. Quite often I build simple devices using analog OP amps and simple logic. Timers and controllers for things like garden lights, pool pumps, solar water heaters, etc. Things that require so little intelligence a CPU seems hardly worth the effort. But now with things like NANO clones and even ESP8266 clones baerly costing a dollar, I'm inclined to re-design a lot of these older circuits. Just the fact that what used to be accomplished by 4 or 5 potentiometers, which get dirty and fail, can now all be done in software, makes it a wise choice, as long as the cost is low. With a wi-fi board, I can even build web based control panels and set up a web server, to control these things remotely. Or for local control, I can have a little keypad and an LCD to program in settings.

So most of these projects I have in mind are pretty simple. Like I alluded, the only reason to go for a super display would be to add some eye candy, in case one of these "simple" projects needed to look good for a prototype of a project.

So all that to say, most of my actual PROJECTs right now are pretty simple as far as their processing requirements. Hence, the focus on NANO's. So I'm just trying to see how much functionality + GLITZ I can get out of the most visible thing on the device, the LCD display, and trying to learn whats reasonable. Its starting to sound like I should just concentrate on alpha/num displays for now, where the fonts are built it, and the only flash space I have to sates is for the query strings needed to guide a user through device settings. Unless there are some LCDs with built in font and flash, which can be programmed offline with logos and such, graphical LCDs are probably not in the cards.

There are some intelligent glcd modules out there but they tend to be a bit pricey compared to the raw glcd module.
These guys make some: Matrixorbital Support Site - Graphic LCD

--- bill

I hate to hijack my own thread, but I now realize I have to step back and ask a much more basic question about LCD displays. Cost is always a concern to me, so I have to look at the low cost suppliers on ebay, aliexpress, maybe Banggood, etc. When I type I2C and LCD Display as search terms into ebay, I see plenty of alternatives, many in reasonable price categories. But not a single one of these sellers mention including a shred of documentation, nor a link to a manufacturer's site that works. I guess I'm spoiled... when I buy a chip, like a digital potentiometer for example, that responds to I2C or another serial standard, there is a data sheet with ALL YOU NEED to program it. What am I missing here? Devices without documentation are near worthless, no?

I2C is inherently slow. It is designed for small traffic between integrated circuits on a pcb.

I2C backpacks work fine for a 16x2 or 20x4 LCD. I2C is faster than a human can read.
A complex graphics display requires a lot of traffic. Typically in the 100000s just to clear a screen.

An intelligent display has its own MCU and receives high level commands e.g. on I2C, SPI, UART.
Look at Nextion or FTDI for this sort of thing.

TFT Controllers from Raio combine LCD control with intelligent commands. It can be dramatic how fast and well some graphics operations perform. There are also features.

Oh, chips have datasheets. Intelligent displays have manuals.
Everything requires effort from the programmer.

Lingerie Vendors on Ebay seldom know much about the electronic items they sell.
They may or may not even be experts in Lingerie.

David.

PeterPan321:
I guess I'm spoiled... when I buy a chip, like a digital potentiometer for example, that responds to I2C or another serial standard, there is a data sheet with ALL YOU NEED to program it. What am I missing here? Devices without documentation are near worthless, no?

For super low cost, the trade off is that often you get little if any support or documentation.
For example, suppose you already have the datasheet for a device or you know where to get one or already have code to work with it, wouldn't you be willing to buy the part at a much reduced cost even it came without documentation or support?
So when wanting low cost, you often have to know what you want and be choosy on who you buy it from.

I use ebay all the time for low cost parts but I have a few strict rules I follow.
The #1 rule being, I never buy from a vendor that isn't showing photos of the actual product he is selling.
It is surprising how many vendors cheat and don't post photos of their product and in many cases you can see that their photos are of multiple different products and in some cases the photos are of a product that they are not selling.
As soon as I see that, I move on no matter how tempting the low price is.

But in general, it isn't that bad as you can usually look up a datasheet for the chipset used on the product so having a full datasheet for the product is seldom necessary.

And when it comes to a graphic LCD, you will want to make sure that the chipset used has a ready to go library as writing a graphic lcd library is a HUGE effort.
I spent a few years doing one called openGLCD and Oliver has also spent many years on his U8glib and U8g2 libraries. Adafruit has lots into their GFX library as well.

What can make a big difference on low cost LCDs in terms of updating the dipslay, is the interface used to update the LCD and the library design and how the code was written.
From a h/w perspective SPI is much faster than I2C.
And direct parallel i/o is usually faster than SPI.

However, the way the Arduino core library pin i/o functions and API were designed, particularly with the code implementation used on IDE bundled AVR core, things can get very slowed down when using an AVR.
So it isn't always obvious what LCD h/w will be faster, especially when using an AVR.

For example, my hd44780 library can update a text based LCD faster over 100khz I2C than the IDE bundled LiquidCrystal library can update the same text based LCD using a 4 bit parallel connection.

I think at this point a good value for some eye candy is the ILI9341 color display.
Lots of Arduino support for it and many projects out there using it.
It uses SPI so it is fairly fast to update and most lcd modules/shields/PCBs also include a socket for a SD card.
Prices start at about $5 USD on ebay.

--- bill

I think at this point a good value for some eye candy is the ILI9341 color display.
Lots of Arduino support for it and many projects out there using it.
It uses SPI so it is fairly fast to update and most lcd modules/shields/PCBs also include a socket for a SD card.
Prices start at about $5 USD on ebay.

The Red ILI9341 SPI boards require 3.3V GPIO signals. You must use level shifters.

ILI9341 displays that are mounted on Shields are designed to be 5V tolerant.
e.g. from Adafruit, WaveShare, Mcufriend, ...

David.

Well thanks everyone! All these comments have been very informative! Based on all I've read, I've learned that for my currently planned small application projects, it will be wise (at least for now) to avoid the eye candy I was originally hoping for, and start with some simple 16 x 2 or 24 x 2 character displays, such as the cheap HD44780 boards I see on ebay that come with I2C interface boards. I've learned that the documentation on these is usually wrong, but at least I've found articles here on the forum of people who have figured out the correct I2C addresses for these and documented what you have to do to get them to work.

It may seem like I'm backing away or chickening out a lot from my earlier hopes, but I now realize that graphic displays that are cheap are not going to have built in fonts, image memory, or smart "blit" libraries for moving graphics around, and attempting to do all that with a NANO is not going to leave much code space or resources for an actual project task. LOL!

So for now I'm going to get back to my basic original goal, which is to have a simple way to display settings in my projects, with manageable overhead, and minimum resource usage. I can always revisit this and try my hand at a fancier display in the future!

Thanks again for all the advice and help!

PeterPan321:
I was originally hoping for, and start with some simple 16 x 2 or 24 x 2 character displays, such as the cheap HD44780 boards I see on ebay that come with I2C interface boards. I’ve learned that the documentation on these is usually wrong, but at least I’ve found articles here on the forum of people who have figured out the correct I2C addresses for these and documented what you have to do to get them to work.

If you are going that route, then you may want to take a look at my hd44780 library.
It can offer a “plug and play” solution for that type of LCD h/w as it can auto locate the i2c address and auto configure the pin mappings used on the PCF8574 backpack.
It is available in the IDE library manager. (don’t install it using a zip file)
See the github page for more information: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
Also, see the wiki there for some additional information.

— bill

bperrybap:
If you are going that route, then you may want to take a look at my hd44780 library.
It can offer a "plug and play" solution for that type of LCD h/w as it can auto locate the i2c address and auto configure the pin mappings used on the PCF8574 backpack.
It is available in the IDE library manager. (don't install it using a zip file)
See the github page for more information: https://github.com/duinoWitchery/hd44780
Also, see the wiki there for some additional information.

--- bill

Thanks! I've ordered a few from Aliexpress, so by the time the slow boat from China delivers it, I should have some test code set up and ready to go.