Using a 2.8in SPI LCD Touchscreen ILI9341 with an ESP32 on the new Arduino IDE 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign today we're going to connect this LCD touch screen to an esp32 it's a 320 by 240 SPI 2.8 inch touchscreen it's one that you see a lot of when you see these LCD touch screens a lot of people have problems connecting them to an esp32 we're going to see how easy it is these have the ili 9341 driver and you can pick these up on Amazon for around 22 dollars and while they all seem to have a built-in SD card slot there's nothing actually special about the SD card slot I'm going to be talking about that in a separate video we're not going to be doing anything with that this video furthermore this project will interface directly with Arduino IDE which I just realized moved over to a point release of 2.0 so we'll be looking at that for the first time together if you're looking for this video but the version running on platform i o instead of Arduino IDE click the link in the top right corner will take you to it the LCD display as well as the backlit screen pulls a bit of current and I don't want to run it through the esp32 voltage regulator so I have the separate power supply which will supply the 5 volts and the 3.3 volts that I'm going to be using for this project so I will show you how I'm doing that this hw-131 is one of the more common cheap esp32 power supplies so here it is Arduino IDE 2.0 which I've just installed as you can see in the output also wants me to update the libraries and while it does install alongside the 1.8 release it grabs the config files from that one to figure out what libraries and different projects you've had previously having upgraded my existing libraries it now allows you to select a Serial port and board per project instead of for the entire program so a nice upgrade for Arduino IDE and I select my do it esp32 dev kit one and they have a pre-installed list of a whole bunch of them it may have been from my previous one I don't know but it definitely arrived working like that so I'm going to go up now to library manager which you would do on the older one or this newer one and search for TFT underscore espi this would be the same on both versions of Arduino IDE and we will find TFT underscore espi by bodmer and we could see that mine is already installed and if it wasn't you'd be hitting the install button current rev being 2.4.72 once installed we'll be going into Arduino folder Mac has it in documents right there and in Arduino we go to libraries and then in libraries we make our way to TFT underscore espi there we'll be going to a file which is called user setup select dot h and click that and in that file we're going to comment out this line right over here which says use the user setup we don't want to use the user setup we want to comment that out and we're then going to scroll down all the way down to setup number 42 and that's the 9341 to esp32 right there so we're going to uncomment that line and we can see it says for the 240 by 320. and then we're going to save this file which I just did my save button is off screen then we'll close this file and we'll make our way to the user setups folder and in that folder we're going to go down to setup 42 and open it and in this setup we want to uncomment the line for optional touch screen support right over here so I remove those comments and then I save this file now we could close this folder all of the configs are completed that's it we're done nothing else to do from here we'll move right into the physical wiring we'll call this out point to point starting with the esp32 and the LCD display VCC will go to 5 volts ground will go to ground CS will go to D15 rst will go to D4 DC will go to D2 MOSI will go to d23 fck will go to d18 the LED will go to 3 volts m-i-s-o will go to d19 T CLK will go to d18 t c s will go to D5 t d i n will go to d23 and finally t d o will go to d19 the last one is not connected I wired everything as described except for this yellow wire the module is running off the 3.3 volts off the esp32 and not the 5 volts coming off of this power supply which is not ideal it's absolutely not what I wanted at all but it's working even though the jumpers are not shorted on the module which bypasses the voltage Regulators on the module very strange some of these may be configured to work on 3.3 volts this was in fact a mistake on my part but it worked and I left it in the video the wire to power the LCD display itself however is powered off the 3.3 volts of this power supply had I caught this and wired it correctly it would have been much better than running it through the voltage regulator the esp32 so I'll hit my power button I'm going to move on to the next step back in the Arduino IDE we're going to open up the examples menu I am scrolling down to TFT underscore espi and from here 320 to 240 examples and I want to do something easy make sure it's working so I'm going to click on Star field and Starfield has opened up and we're just going to verify this is the first time I've ever run 2.0 to make sure everything works it should work but we'll wait we'll see it together and it looks like I have a python problem I'm going to correct that quickly and I just need to make a symbolic link from Python 3 to python because this program doesn't have a configuration to say what the executable is so that's done and so we'll try verify again and this time it worked successfully so now we could try pushing it directly to device so we push it now and I'm going to speed this section up by a factor of 4 so we don't have to sit here and watch this but the push is successful and the esp32 rebooted and we see the screen coming up with our star field program and it looks really cool I always like this example just because it looks really cool get a close-up of this take a look at that that's pretty awesome but this just confirms that our test works so it's time to move on to our next example I go back to examples and scroll all the way down all the way down to TFT espi again 320 240 and this time I'm going up to the keypad 240 by 320 application one change I do want to make is on line 32 and set repeat calibration to true in case I mess it up it's just easier that way and you know if you want to review the rest of the code you can pretty interesting how this is constructed but that's the only change that need be made now again I'm going to hit verify for good measure and sped up by a factor of 4 we see that the verification is good so we then push this program to the device this event I speed up by a factor of six loaded and rebooted let's take a look and it comes up to a calibration screen so everything's looking good and I have to be really careful not to touch the screen or I mess up this process and I have to reboot install all over so I mean extra cautious here and I'm just going to hit all the corners with that provided white touchscreen pen that it comes with and then it comes into the program after that and that's why it originally set that parameter so if you mess up and hit reboot you could do the calibration all over again so we're going to have a look here and it just looks like a phone touch pad very simple demonstration as I clear the serial monitor and I'm going to type in first using the pen and I guess the resolution for typing is pretty good and the features work and it deletes and I type in I hit new and it clears obviously it's able to convey data as demonstrated with the send button we see it appear in the output of the serial monitor I'm trying with my finger as well actually with my fingernail as you see and it works equally as good didn't actually try it with my finger in this video but with my finger there was also no problem using this touch screen and obviously we didn't do anything with the SD card as I had previously explained because the configuration of it is universal and we're going to demonstrate that in a separate video but that concludes the configuration of this LCD touch screen display 320 by 240 with the ili 9341 driver I hope you found this video enjoyable entertaining and informative do me a favor hit that like button down below helps me a lot when you do and that subscribe button for more videos like this when they come out when a follow-on video comes out a link will be posted in the top right corner again I hope you enjoyed this video thanks for watching thanks for watching would you like to reply
Info
Channel: Retro Tech & Electronics
Views: 51,494
Rating: undefined out of 5
Keywords: ili9341, tft_espi, tftespi, 2.8in SPI LCD Touchscreen, 2.8in LCD Touchscreen, esp32, esp32 lcd touchscreen, esp32 touchscreen, 2.8in lcd touchscreen pinout, hw-131, hw131, arduino ide, arduino ide 2, arduino ide 2.0, esp32 arduino ide, esp32 tutorial, howto lcd touchscreen, howto, espressif, spi, esp32 how to, esp32 howto, touchscreen ili9341 esp32, esp32 ili9341, esp32 ili9341 touchscreen, ili9341 tft_espi, esp8266 ili9341, esp8266 howto, ttgo ili9341, platformio, platformio ili9341
Id: 9vTrCThUp5U
Channel Id: undefined
Length: 10min 34sec (634 seconds)
Published: Sat Dec 03 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.