loading

select color display for esp32

by:LCD Mall     2020-08-06
This instructables shows some information about selecting a color display for the ESP32 item.
The content is intended to be updated from time to time and I will add more details if I find a new display or library update.
You can also help me enrich my content by leaving a comment below.
You can run a variety of IoT projects without any display.
However, some kind of IoT project not only provides data in a single direction (IoT to server)
They can also collect real-time information from servers or the Internet for display.
For example, my previous instructures, ESP32 photo clock, which downloads the current minute photo from the Internet, decodes the JPEG photo and displays it.
There is a variety of real-time information on the server or on the Internet. g.
In addition to room temperature, server CPU usage, weather forecast, news, stock price, reminder download file completion, your Youtube Channel View:> Many Arduino items are displayed in monochrome, one of the reasons is the limited resources of the MCU.
The 320 pixel width, 240 pixel height and 8-bit color of each RGB color channel means 230 KB for each full screen picture.
But normal Arduino (ATmega328)
Only 32 kB of flash memory, very time consuming (over a second)
Read data from SD card and draw to color display.
However, ESP32 changed the game.
It has faster processing power (
16 MHz vs 240 MHz dual core)
More RAM (
2 KB vs more than 200 KB)
And more flashes (32 KB vs 4 MB)
Therefore, it is able to display with more colors and higher resolution images.
At the same time, it can also carry out some processes such as JPEG decoding that require RAM, which is a very important function for displaying the information collected by the Internet.
There are many types of interfaces for color displays: Serial Peripheral interfaces (SPI), 6-bits, 8-bits, 16-bits, 18-
Bilateral Investment Treaty and NeoPixel!
SPI dominates the amateur electronics market, most likely because there are fewer wires needed to connect.
Most of the displays in my drawer also have only SPI pins, so this instruction set is on the SPI display.
Note: NeoPixel matrix is a very special color display type.
If you are interested in NeoPixel matrix display, here are some of my instructions for using it: two parts need to be considered when selecting a color display for esp32.
Hobby electronics has a variety of color displays: LCD, ips LCD, OLED with different resolutions and different driver chips.
The LCD can have a higher image density, but the OLED has a better visual angle, and the ips LCD can have both at the same time.
OLED has higher energy efficiency for each lit pixel, but it may burn-in problems.
Color OLED works under 14v which means you need a dedicated step
Up circuit, but it\'s not a problem if you just use it when it breaksout board.
LCD can be directly in 3 in most cases.
3 V, same working voltage as ESP32, so you can consider not using the break out board to make thinner products.
Software support, on the other hand, affects your choices.
You can develop ESP32 programs using Arduino IDE or you can use ESP-directly-IDF. But since ESP-
The IDF does not have much display library and there is not much display hardware support, so I will focus only on the Arduino display library.
For beginners, I think buying adafruit (
Or similar suppliers)
Good seamless experience with hardware and Arduino libraries (
Although I don\'t have a budget to try it all).
The performance of the Tft _ espi Library is better, but the configuration needs to be changed in the library folder.
Ucglib and UTFT-
ESP is a bit slow to run, but it supports a lot of hardware and is a popular library, and you can find that many Arduino projects use it.
Let\'s start our comparison from the color display in my drawer.
The ST7735 is a very popular LCD driver model with a resolution of 128x128 and 128x160.
This may be due to the popularity of it, there are many manufacturers that produce compatible products, but they are not fully compatible.
There are some changes in the initial code, the color order can be RGB or BGR, and there are also some Pixel changes in the y coordinate range.
Some libraries distinguish it by a red, green or black label, but the label color is not always correct.
The worst case scenario is to try the tag option one by one until you can see a good result.
The 3rd images above are an example of using the error tag option where you can find 3 pixel height noise bars at the top.
The ST7735 also has other odd size color displays with a resolution range of 128x160, E. G. g.
The picture above is 0.
96 \"color display 128x64 \".
Thanks to the popularity of wearable devices, I can find more small size ips LCD in the market this year.
The picture above is a 0.
96 \"80x160 IPS color LCD with ST7735 driver chip.
As you can see in the 3rd image, you can treat it as a 128x160 color display in the code, but actually only the middle part is displayed.
The fourth picture is a display without a breakout board. It is very thin and very small. It is very suitable for wearable items!
Note: All ips LCD have a common function, the color of the display is inverted, and most libraries can fix it by turning on the reverse option.
I think this is the color monitor with the lowest resolution you can find in the market, it is 0.
96 \"96x64 color OLED.
OLED has a big advantage that pixels consume energy only when it lights up.
On the other hand, even if you are showing a black screen, the LCD backlight is always full of power.
As a result, OLED can help save some power on projects powered by batteries.
I am trying to use it in my previous instructures: is 1.
The 5 \"128x128 color OLED is ideal for smart-watch-
Like a wearable project.
The biggest obstacle to choosing this should be that the price tag is about 4 times that of a regular LCD.
This is the highest resolution color oled I can find in the amateur electronics market, it is 1.
69 \"160x128 color OLED.
Due to the size of the breakout board, I don\'t know how to use it yet. It is a 2.
2 \"176x220 color LCD.
There are relatively few projects using this chip and resolution.
It may be caused by the success of its chip family brother ILI9341 (0.
2 \"larger in size but close to double in resolution).
I think ILI9341 is the most popular LCD driver chip in the amateur electronics market.
In most cases, it has a resolution of 240x320 and a screen size of 2. 0\" to 3. 2\".
Some breakout boards are built in.
Touch screen function.
With this, you can find a lot of projects in GitHub.
The ILI9341 breakout board is a great choice if you want to buy the first LCD.
It is also easy to find ordinary LCD without breakthrough board in the market.
Here are some of the projects that I use ILI9341: it\'s IPS version 2.
4 \"LCD with ILI9341 driver chip.
The display results are very good, but the supplier does not offer the breakout board option, so you need to route it yourself.
ST7789 is also a common driver chip in the ESP32 community.
One of the reasons is that the official development kit of ESP32 uses it.
Like ILI9341, the ST7789 can also drive a resolution of 240x320.
I don\'t have the 240x320 ST7789 display in my hand, the picture above is 1.
3 \"color LCD with 240x240 IPS.
This is also the color display with the highest pixel density in my drawer.
Like a normal LCD, it can be operated directly in 3.
3 V, so it is very good for making ultra-thin wearable devices. This is a 3.
0 \"240x400 IPS color LCD.
This is the only widescreen LCD I have seen in my hobby electronics market. This is a 3.
5 \"320x480 color LCD.
This resolution is a burden for a normal MCU, and it takes a second to fill full screen with Ucglib.
There are many display libraries that support various hardware.
I chose 4 of the most popular Arduino libraries for comparison: the above figure is a list of hardware support for each library.
Choosing which library to display speed is one of the most important things we consider.
For this comparison, I chose the tft _ espi PDQ test.
I have made some efforts to rewrite the PDQ tests that can be run in 4 libraries.
All tests will run in the same 2. 8\" ILI9341 LCD.
To simplify the comparison process, the same connection mode is used for all displays.
Here is my connection summary: you can find the code on Github: I found in this instructures that tft _ espi is the most promising display library for ESP32, I have put some effort into increasing support for all the monitors I have on hand.
The newly added Display support in the above figure is marked with the red letter M, which is my enhanced version: selling various display modules in the hobby electronics market, they also have good support at the software level.
Their display libraries are all built based on a parent class called Adafruit _ GFX, so I call it the Adafruit GFX family.
This library generally supports most Arduino hardware (also ESP32).
In Arduino Library Manager, you can see all family members by simply searching for \"adafruit display.
If you want to install it, say ILI9341, just select \"Adafruit ILI9341\" and click install \".
Remember to install its dependency Library \"Adafruit GFX Library \".
This library method signature is very similar to Adafruit GFX, but it is customized
Manufactured for ESP8266 or esp32.
I think the source code is optimized for ESP32, so the PDQ results are much faster than other libraries.
You can search for \"TFT-
Then click install \".
Note: The most difficult part to use this library is to configure this library before using it.
The configuration file is located in the library folder and should be \"Arduino/libraries/tft _ espi/user_setup \".
\"H under your own document folder \".
It has a lot of comments to help you do this, please complete the configuration step by step as per the comments.
This is my user_setup.
H for ILI9341: you can install it in Arduino library manager by searching for \"Ucglib\" and then clicking \"install. UTFT-
ESP is based on Rinky-
Added support for ESP8266 and ESP32.
You can install it by downloading it on Github: then copy the \"UTFT\" folder to the Arduino library folder. ref.
: ILI9341 can run at 40 MHz SPI speed, it needs to make some code changes in the library folder.
The above picture is the result of fine tuning.
Here is the code change summary: The Library has defined spi_default _ freq as 40000000 for the ESP32 board.
You can also change the frequency when init: user_setup.
Hsrc/clib/ucg _ dev _ ice _ ili9341.
Chardware/esp/HW_ESP.
HST7735 and ILI9341 are the most popular monitors, which are better options for beginners.
You may notice that the LCD has a big weakness, the visual angle, some colors are lost outside the visual angle, and the screen becomes unreadable.
If you have enough budget, there is a better viewing angle for OLED or ips LCD.
Speedtft _ espi has the best performance, followed by adafit.
In most cases, we look at how to use the code base by searching for samples on the network.
I try to search for four Library keywords in Github, Adafruit is the most popular, UTFT second.
Only the Adafruit GFX series is fully configurable at the user code level, and the other 3 libraries need to be configured in the library folder.
Adafruit also has a very good portal with lots of detailed posts to teach you how to use their products.
ILI9341 should be the most valuable monitor for beginners.
The Adafruit GFX library should be the easiest to use for beginners, because the tft _ espi has a very similar method signature, so it is very easy to switch to a faster library later.
The OLED needs 14v to light up the pixels, so it is not easy to decoupling the breakout board.
On the other hand, LCD (also IPS LCD)
Usually in 3.
3 V, same as esp32.
In most cases, only LED control circuits are required between the LCD and the esp32i. e.
Transistors and several resistors.
So it\'s relatively easy to do this.
It is very important to read the data sheet before deciding not to use the splitter board.
You can find pin layout, pin spacing size, sample circuit connections, and maximum ratings in the datasheet.
The maximum voltage is particularly important, you should stick together according to the rating, otherwise you will blow up the LCD.
The chip can be in 3.
3 V, but the LED may be 2. 8 -3.
Therefore, it needs some electronic equipment in the middle, and most data tables have sampling circuits.
You can ask your seller to send you a soft copy of the data sheet or simply google it with the model.
My special tip: I like to weld the FPC cable of the same pin spacing size as the LCD to help connect with the MCU.
I used this technique in these instructions: you read through the data sheet of the color display and you may find that most color displays can support 18-bit color depth (
6 bits per RGB channel).
18-bit color depth can have better image quality than 16-bit color depth (
5 red and blue channels, 6 green channels).
However, only Ucglib actually runs at 18-bit color depth (262,144 colors)
, The other 3 libraries are running in 16-bit color depth (65,536 colors).
This is because the 18-bit color depth actually needs to transfer 3 bytes (24 bit)
For each pixel of data, this means that the data transferred and stored in memory needs to be increased by 50%.
This is one of the reasons why Ucglib is running slower, but it can have better image quality. Ref.
Custom message
Chat Online 编辑模式下无法使用
Leave Your Message inputting...
Thank you for your message! We are LCD Mall, committed to providing customers with high-quality services and products. Our salesperson will contact you as soon as possible. If you have urgent questions, please feel free to contact us directly through WhatsApp or email: WhatsApp: 86-13713689582/ info@AllTouchDisplay.com .