esp32 tft lcd arduino quotation
were missing for my display (hailege, 2,8 tft, spi, il9431, https://www.amazon.de/-/en/gp/product/B07YTWRZGR/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1). so it might just be that the led backlight isnt being turned on. but of course the tip might not help with the st7796s.
This project uses the SPIFFS (ESP32 flash memory) to store images used as background. You"ll need to upload these to the ESP32 before you upload the sketch to the ESP32. For this you"ll need the ESP32 Sketch Data Upload tool.
You can download this from Github: "https://github.com/me-no-dev/arduino-esp32fs-plugin". Follow the instructions on the Github to install the tool:Download the tool archive from releases page.
Before you upload the data folder to the ESP32, you"ll first have to select the right partitioning scheme.Go to Tools -> Board and select ESP32 Dev Module.
Extract and rename the extracted folder to "Bluetooth-System-Monitor". This is so the Arduino IDE does not complain that the folder and the sketch do not have the same name. If this happens, you will get a popup asking you if it should move the sketch. The dangerous thing here is, that it will only move the sketch and not the Data folder. This will result in errors when uploading!
Firstly, depending on the board you are using (with resistive touch, capacitive touch, or no touch) you will have to uncomment the correct one. For example, if you are using the ESP32 TouchDown uncomment: "#define ENABLE_CAP_TOUCH". If you are using a DevKitC with separate TFT, uncomment "#define ENABLE_RES_TOUCH".
Go ahead and upload the Bluetooth-System-Monitor.ino sketch to the ESP32. The settings under tools besides the Partition Scheme can be left to the default (see image). Go to "Sketch" and select "Upload". This may take a while because it is a large sketch.
The wiring may seem a bit daunting at first. But don"t let all the wires scare you. It is pretty straight forward. The images above will help you when you wire your TFT + Touchscreen to your ESP32. This is also decision making time. There are few options when it comes to connecting the two together. You can use a breadboard, you can use prototyping board or you can order a PCB specifically to connect the ILI9488 + touch to the 38-pin ESP32 DevKitC. I"d like to point out that the breadboard option is only an option for testing your connections and screen. It is not very practical to have on your desk and loose connections can cause problems.
If you like to order a PCB designed to make it easy to connect the ESP32 to the TFT screen, you can download the gerber files here: https://github.com/DustinWatts/ESP32_TFT_Combiner
In this Arduino touch screen tutorial we will learn how to use TFT LCD Touch Screen with Arduino. You can watch the following video or read the written tutorial below.
As an example I am using a 3.2” TFT Touch Screen in a combination with a TFT LCD Arduino Mega Shield. We need a shield because the TFT Touch screen works at 3.3V and the Arduino Mega outputs are 5 V. For the first example I have the HC-SR04 ultrasonic sensor, then for the second example an RGB LED with three resistors and a push button for the game example. Also I had to make a custom made pin header like this, by soldering pin headers and bend on of them so I could insert them in between the Arduino Board and the TFT Shield.
Here’s the circuit schematic. We will use the GND pin, the digital pins from 8 to 13, as well as the pin number 14. As the 5V pins are already used by the TFT Screen I will use the pin number 13 as VCC, by setting it right away high in the setup section of code.
I will use the UTFT and URTouch libraries made by Henning Karlsen. Here I would like to say thanks to him for the incredible work he has done. The libraries enable really easy use of the TFT Screens, and they work with many different TFT screens sizes, shields and controllers. You can download these libraries from his website, RinkyDinkElectronics.com and also find a lot of demo examples and detailed documentation of how to use them.
After we include the libraries we need to create UTFT and URTouch objects. The parameters of these objects depends on the model of the TFT Screen and Shield and these details can be also found in the documentation of the libraries.
So now I will explain how we can make the home screen of the program. With the setBackColor() function we need to set the background color of the text, black one in our case. Then we need to set the color to white, set the big font and using the print() function, we will print the string “Arduino TFT Tutorial” at the center of the screen and 10 pixels down the Y – Axis of the screen. Next we will set the color to red and draw the red line below the text. After that we need to set the color back to white, and print the two other strings, “by HowToMechatronics.com” using the small font and “Select Example” using the big font.
In order the code to work and compile you will have to include an addition “.c” file in the same directory with the Arduino sketch. This file is for the third game example and it’s a bitmap of the bird. For more details how this part of the code work you can check my particular tutorial. Here you can download that file:
Those results indicate there is no communication happening with the display chip for some reason. Since the TFT_eSPI library is not used for the test this indicates that the library will not be able to talk to the chip either.
This might not work but try it: The displays are fitted with a regulator (U1 on PCB) which is designed to accept 5V input and output 3.3V to the display. These are normally "Low Drop Out" (LDO) which means that if you connect 3.3V to them they still output about 3.0V and this is sufficient for the display chip. Your board may be fitted with a regulator that has a higher voltage loss, so it is worth trying to power the display from 5V connected to the VCC pin. The other option is to bypass the regulator U1 by soldering a link (or adding a big blob of solder) to short across J1 pads. This then links VCC direct to the TFT chip and thus VCC must only be 3.3V (5V with that link will damage the chip).
What I had done initially was that I had reduced the LCD SPI frequency to 5MHz or 10MHz. For some reason, I was trying to run the LCD at a lower SPI frequency, but still touch would not work. I even tried to reduce the touch frequency, even that did not work.
After all these discussions here and my last experience where I would get delayed touch inputs, I set the LCD SPI frequency to 40MHz and Touch SPI frequency set the default 2.5MHz. And that seems to have worked!
The one thing surely that did not work was the 36pin NodeMCU-32S version of ESP32 dev board. That we checked multiple times on multiple board and did not work with the 36pin version board.
I"ve tested the TFT_eSPI-Library with an ESP32 DEV Module (ESP-WROOM-32) and a 2,8" SPI TFT Module with ILI9341 without touch. Everything was fine. For cabling and setup i used the Youtube-video from XTronical "ILI9341 TFT LCD to ESP32 -Full HOW TO ..."
The reason I like to use e-paper displays is that they have some unique characteristics. E-Paper or Electronic paper are displays that unlike traditional LCD or OLED displays does not emit light but reflect light. It is like the ink on the paper. This characteristic makes e-paper displays very comfortable to read, and they have excellent readability under direct sunlight. Another great thing about e-paper displays is that they can hold static text and images for months without electricity! Yes, that’s correct, the display can show text and images even when it is off! That makes e-paper displays ideal for low powered projects!
Let’s now see how to use this 2.9” E-Paper display with the ESP32 board. The display offers a resolution of 296x128pixels and it uses the SPI interface to communicate with the microcontroller. You can use any 3.3V microcontroller you wish. I prefer to use the ESP32 board which is inexpensive and very powerful. I am using this DOIT ESP32 development board. There is a newer version of the board, this one, which offers more pins, which works as fine with the display as well using the same pins.
It is a 3.3V display so Vcc must be connected to the 3.3V output of the ESP32 Board. The next pin is GND and it goes to GND. The third pin is named DIN and it goes to Digital Pin 23. The fourth pin is CLK and it goes to Digital Pin 18. The fifth pin (CS) goes to digital pin 5, the 6th pin to digital pin 22, the 7th pin to digital pin 21 and the last pin to digital pin 4. That’s it; we are now ready to load a sketch to the ESP32 and watch the display in action.
Let’s now go to the computer to see the software side of the project. We are using the GxEPD library in this example. As you can see, at the setup function I am displaying some text, and then I display some bitmap images one after another. The bitmap images are converted to data arrays using the Image2LCD software. I will show you how. Let’s add another bitmap image to the project.
We load the Image2LCD software. We open the bitmap file we created and it appears on the screen. We select vertical scan here, and we enter the resolution of the display here: 296 here and 128 here and press this small button here. Next we deselect this checkbox and check this one. Then we press save, and the software will create a data array. Now, all we have to do is to copy this array and paste it into the BitmapGraphics.h file like this. Now we can use this bitmap image in the project. If we upload the sketch to the ESP32 board once more, we can see, that it displays the new bitmap just fine. Cool! You can find the code of the project the Image2LCD software in the description of the video below.
FreeTouchDeck uses the SPIFFS (ESP32 flash memory) to store configuration and images that are used. You"ll need to upload these to the ESP32 before you upload the sketch to the ESP32. For this you"ll need the ESP32 Sketch Data Upload tool. You can download this from Github: "https://github.com/me-no-dev/arduino-esp32fs-plugin". Follow the instructions on the Github to install the tool:
Extract and rename the extracted folder to "FreeTouchDeck". Open the FreeTouchDeck.ino sketch in the Arduino IDE. This will also open a few other header (.h) files. You do not need to touch (pun intended) these.
After the data folder is successfully uploaded, you can go ahead and upload the FreeTouchDeck.ino sketch to the ESP32. The settings under tools besides the Partition Scheme can be left to the default.
The 1.8" display has 128x160 color pixels. The TFT driver (ST7735) can display full 18-bit color. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector)
In the above example, Node32-Lite and this 1.8-inch LCD. Please refer to the tutorial here: ST7735S interfacing with ESP32 to make the connections, Arduino library installation, and modification needed for it to works on this LCD.
Module with WiFi Espressif ESP32-S2. It has 4 MB of Flash memory, 2 MB of external PSRAM memory, integrated WiFi 802.11 b/g/n transceiver and a JST-PH 2.0 connector for connecting a LiPo battery. The board has a TFT LCD display and an RGB LED. FeatherS2 is easy to integrate with sensors due to the available STEMMA QT connector (Qwiic compatible).
The module offers great possibilities in the field of IoT systems and can be used both to control LEDs and to transfer data to a specific platform. FeatherS2 can also be programmed using the Arduino IDE, ESP-IDF or CircuitPython. Full documentation is available on the product page.