LCD display [Advise needed]

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Posts: 20
Joined: Mon May 22, 2017 11:59 am

LCD display [Advise needed]

Post by matto » Tue Jun 13, 2017 3:15 pm

Hello everyone!

Earlier this year I have been working on a project for an off-road motorcycle tripmaster (an odometer with some added rally functions). I made it based on Arduino: (sorry, it's in spanish).

But I quickly found a lot of things I'd want to improve. Programming in C++ is a pain. Even simple stuff like trying to get the length of an array is a non trivial task and the program memory is very limited, so I've decided to move to MicroPython for the new version.

As you can see in the blog, I used two 7 segment LCD displays for the existing version, but for the new one I'd like to use a graphical matrix display. That way I can show more information and make it more usable.

The problem I'm facing right now is that I can't find a suitable display that has available drivers for MicroPython. I have made some progress using the Nokia 5110 display with the invaluable help of mcauser, but the screen size is way too small for what it's needed.
I guess I could accomplish the task by using 2 displays, but even then they might be smaller than I'd like to.

In a perfect scenario, this is the display I would use:
  1. Higly readable on direct sunlight (this is the most important)
  2. Backlight needed for tunnels and night rides
  3. Draw big numbers (the common 2x16 screens don't work for this purpose, so I think it has to be a "graphic" and not "character" display)
  4. Draw custom characters (this is not mandatory, but nice to have)
  5. SPI and/or I2C protocol (this is not mandatory, but nice to have so I have more available GPIOs for other purposes)
  6. Have existing driver for MicroPython (I don't have the knowledge to write an entire driver, so this point is important)
  7. Not too small (I'm afraid that the Nokia 5110 is too small, even using 2 of them. Maybe something around 128x64?)
  8. Display controller board included (I think most displays have it)
  9. Cost less than 30€
  10. Stock availability (I might need to buy a bunch of these)
I know, this could easily be a letter to Santa Claus, but I see a lot of these kind of screens have drivers for Arduino! Even the not-so-powerful Uno can handle big dot matrix displays, but then I also understand the limitations of using an interpreted language.

Do you have some advice or know about an option?
Any ideas are welcome. At this point I'm stuck and spending a lot of time googling around to find a candidate, but I'm not having much luck.

Thanks a lot!

Posts: 20
Joined: Mon May 22, 2017 11:59 am

Re: LCD display [Advise needed]

Post by matto » Tue Jun 13, 2017 4:39 pm

I was thinking that maybe a combination of this display (it has a review of good direct sunlight readability at the bottom): ... tegory/41/

with this adapter that converts it to I2C: ... 78419.html

might be a good solution, but it still leaves the problem of how to drive it from MicroPython.
I'm open to other alternatives anyway.

User avatar
Posts: 1385
Joined: Thu May 28, 2015 5:54 pm

Re: LCD display [Advise needed]

Post by deshipu » Tue Jun 13, 2017 7:59 pm

I had a go at writing a driver for that display for MicroPython, but it didn't work, and I shelved the project. I can't remember right now what the problem was, but I do remember I got it to work with Arduino.

However, have you considered using a simple 14-segment display, such as this one: ?
It uses HT16K33 chip, which communicates over I2C and has a MicroPython library (that I wrote). It's not LCD, but it's very bright and readable (you can change its brightness from python).

Posts: 20
Joined: Mon May 22, 2017 11:59 am

Re: LCD display [Advise needed]

Post by matto » Tue Jun 13, 2017 8:06 pm

I was mainly looking for a dot matrix display because I'd like to show different values in the same screen, and some have to be bigger than the others.
Also, the system has a few configuration parameters that have to be set by the user, so I was planning on making a menu (the previous version has one, but very basic). That's why I'm no longer considering segment displays.

Thanks for the input!

User avatar
Posts: 490
Joined: Mon Jun 15, 2015 8:03 am

Re: LCD display [Advise needed]

Post by mcauser » Tue Jun 13, 2017 10:13 pm

The 5110 LCD is ideal for battery projects as it consumes little power. The resolution 84x48 is restrictive though. If you are buying a few of them, get them from the same provider. I have a few with slightly different shades of backlight. Just enough to be noticible and annoying.

You can get 128x64 OLED displays but the physical size is smaller than the Nokia. For a motorcycle odometer, it's probably a bit small.

There's a 240x320 TFT display that deshipu has a driver for. Full colour, but refresh speed and readability in full sunlight may be a problem.

You can get huge 7 segment displays, like 5x10cm per digit. A few of these would be ideal for an odometer. Low power, bright, no need for backlight, rugged. Controlled with either a max7219 or a ht16k33.

There is a compact dual-quad (8 digit) 7 segment board powered by a max7219. A few in series would give you a lot of room for information. The same driver works with 8x8 led matrices. If you have information that is best rendered as a graph than a number, this may be an option.

LED bar graphs for a fuel gauge? 10 led segments with 256 shades. Some come in green-yellow-red. Ideal for high readability, no backlight, linear data.

You can get 128x64 graphic LCDs, which are similar physical dimensions to a 20x4 character LCD. The yellow/black versions would give better readability in full sun than blue/white LCDs. This would give you a large area for custom graphics. The pixels are large enough to be readable from a distance. The pixel layout is similar to the OLED and the Nokia, so if you trial each display, you can share code.

The character LCDs based on hd44780 come in a few sizes. 8x8, 16x1, 16x2, 16x4, 20x2 and 20x4. That is character sizes. Each char is 5x8, and you can only have 8 custom chars in ram, so rather limited. Great for lots of ascii text.

The graphic LCDs, char LCDs and TFTs differ from the OLEDs as the pixels block light rather than emit. You need a backlight to be able to read them in most cases.

E-ink displays are low power, readable in full sun but have a slow refresh rate and are very expensive in comparison.

There's a lot of different displays! Each with their own strengths and weaknesses.

Which one is best for a bike HUD? Well... it depends on a few things. What information you want to display. How readable it needs to be. How rugged it needs to be. How fast it needs to refresh. How many MCU pins it needs. Your budget. Reliability - so you are safe if it crashes/reboots. Are there any laws / compliance you need to follow?

What about using a mobile phone / tablet as the display with a microcontroller over usb reading the sensors? Android maybe, Apple nope.

Posts: 20
Joined: Mon May 22, 2017 11:59 am

Re: LCD display [Advise needed]

Post by matto » Wed Jun 14, 2017 8:12 am

Hey! thanks for the elaborate answer :)

I have made various tests with the displays I have around, and I've completely discarded OLED because when in direct sunlight it's like they are off. Almost completely black. I was thinking in something LCD based, like the Nokia 5110, which under the same test it looks pretty good. The only setback is it's size.

I have made a mockup so you can see what I'd like to show in the screen in a perfect world:


As you can imagine, 7 segment displays and even character displays are not a good option for this particular project.

The ideal refresh rate should be less than 500ms, but I think I can live with 1 second. That's why I'm still considering the 2.7" e-paper display in FAST mode. The disadvantage is the "ghosting" in the screen, but I guess it's ok. Oh, and the price, of course.

I have ordered a nice color TFT screen. It has the great advantage of having a touch panel, giving me a lot to play with. The problem is that it seems to be not so good under direct sunlight. I'll make some tests when it arrives.

The ideal candidate would be a 128x64 graphic LCD (yellow/black, as you rightly say). Perfect size, good resolution, kind of rugged, great readability and CHEAP. The problem is that there are no MicroPython drivers for this display. If you say that it could share some code with the 5110 that sounds promising, but I would not know even where to start.

An Android mobile phone is in my options. In fact, a lot of riders use them but they are constantly complaining about readability.

I am also wondering; if there is a Python driver available for a given display to work with, for example, the Raspberry Pi. How hard / possible would it be to port it to MicroPython?


User avatar
Posts: 4800
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Re: LCD display [Advise needed]

Post by pythoncoder » Wed Jun 14, 2017 8:24 am

matto wrote:...I am also wondering; if there is a Python driver available for a given display to work with, for example, the Raspberry Pi. How hard / possible would it be to port it to MicroPython?...
Before even starting check that the original is Python3 code. If it's Python 2.x it's worth porting to Python3 on its original platform before trying to shift it to MicroPython.

From there it's usually fairly easy. You need to learn the differences in the way the Pi drives peripherals such as SPI, I2C and GPIO pins and then systematically adapt the code.
Peter Hinch

Posts: 20
Joined: Mon May 22, 2017 11:59 am

Re: LCD display [Advise needed]

Post by matto » Wed Jun 14, 2017 8:34 am

Great, that could be a starting point.

User avatar
Posts: 2282
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: LCD display [Advise needed]

Post by Roberthh » Wed Jun 14, 2017 9:40 am

The best could be displays like this one:
They have a transflective version, which is readable in sunlight and can be illuminated too. And a touch overlay is also available. Problem: You have to write your own driver. I have that on my long term to-do-list. That should work well with a pyboard or an esp32 device. Seems not so difficult. The vendor has also models of 240x128 size.

Posts: 20
Joined: Mon May 22, 2017 11:59 am

Re: LCD display [Advise needed]

Post by matto » Wed Jun 14, 2017 10:37 am

Roberthh wrote:The best could be displays like this one:
That's right! I wrote them a few days ago. They have awesome displays and in a lot of sizes and shapes, but I discarded those because they told me that they don't have Python drivers for them. They are perfect for what I need and also not very expensive.

Post Reply