#204 TFT Touch Screen ILI9341 SPI for ESP32 (Internet Radio Research)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and welcome back yes as part of my esp32 web radio i'm investigating different screens uh this one here and this one here sort of this was sort of more a reference really but as you can see there's an awful lot of wires even if we take this sd card thing away there's still an awful lot of wires there for something that's running on spi and well yeah don't get me started about that sd card partly because i can't even get anything to work even though it's supposed to be spi as well and let's face it look at the size of it i mean you know i'm i'm pretty sure i've got a a mini one somewhere yeah so what i've been doing is investigating how i'm going to drive the actual straight screen as part of my esp32 web radio project and indeed which project is i'm actually going to follow so i dug this screen out and it was an ili 93 41 i believe yes 93 41. i thought hello i've seen this one somewhere before yes it was this one down here wasn't it from a long long time ago and for those of you who have watched my older videos or perhaps were even following my channel at that time this was um quite exciting for me really the fact that i could get this screen working the driver worked using the adafruit gfx library and whatnot and yeah it's all touch if i touch that okay button there we are starts again so what's wrong with this one here compared to that one there well they're both the same screen but the one at the back is running on spi so three was three can you see those plus one more for the cs chip select wire so yeah four really unfortunately there's also the touch screen part of this yeah exactly the same as this one here so that's these little loops here plus another cs pin and you've got on the back of this a whopping great big sd card reader about like this one here and that requires wires from the spi bus plus a cs wire as well and they would normally go over this side here which i've not sold it in because i thought i'm not using a whopping gray sd card like this not least because this sd card sticks out the bottom of the screen down here so if i wanted to put this into a nice neat case it prevent me from doing so and of course given that video we saw that one yeah if you think i'm using an sd card when we have little fs or spiffs available to us no we're not going to do that okay so although this is showing some pictures mostly okay they're gifts bmps and jpeg but the jpeg one doesn't display properly and i don't know why and do you know what i'm not not really too bothered at this stage because i don't know if i'll be displaying any jpegs see that's a bitmap upside down that's the jpeg there and it didn't display at all or just a little tiny fraction of it or something dodgy going on there so maybe it's the underlying library or something i don't know as i say i'm just not worrying about it too much however we are using esp32 obviously because all the internet radios these days use that you'd be hard pushed to get it to work with an esp8266 you know speed wise and everything and forget it for an arduino now this screen which is the same screen as that one there effectively just configured differently as a shield yeah now the lighting's all a bit rough and ready here because i'm trying to point the camera down so you can see what's going on but i'm going to readjust this and we'll talk more about this screen and why it's absolutely no good for well a lot of things really and then talk a bit more about the one at the back and well sd card versus little fs again i guess now i want to give a quick shout out to jlc pcb now they've supplied many many pcbs to me over the last two three years and it's all very well for me to stand here and go look go and use jlc pcb but let me give you an actual practical example of the sort of thing they can produce shall we and then i want to have a very quick word about shipping right i've just had the pcb delivered so as you can see it's um it's not a complex ball but it is a a bitty board isn't it lots of pieces on it and yeah i mean it's done wonderfully well now i've i made this using easy eda which as you know is part of that group jlcpcb lcsc.com for the components and easy eda now within easy eda you can do a lot of things that you would never expect to do otherwise for example if you've noticed here i've actually removed both the copper and the solder mask from that hole because that's going to have a push button in there and i thought no i don't really want this sort of ground plane which is what this is at the back here going over this hole and wasn't quite sure if it was going to be connected so i just drew it out and said don't put any copper here and don't put any solder master there either so it's just back down to the bare pcb here which is exactly the way i wanted it so the shipping options to the united kingdom at least as you can see there's quite a few here now the dhl which is what i use or have always used more or less is obviously the quickest you'll get it within three four days and in fact dhl even tell you or this will take a week will be by the end of the day in a week's time and then they send you another oh no it's coming today actually so yeah now this this bit here ddp that's duty and customs paid at the point of um sending out so you pay a bit more up front then you don't get charged any duty import duty v80 or anything else okay so that's something to bear in mind and you've got a way up the risk there of that happening but if you look right down the bottom of this list look there's a gb special air mail royal main it's only 5.35 now i tried that out i know two three months ago and it was just absolutely fine it says 10 to 15 business days and it was about two weeks actually when i got it so if you're looking for a cheaper option try that out and don't forget the special assembly offer they have if we look here for the smt assembly option you'll see you can get a coupon that takes the seven dollars off for the setup fee and everything else why don't you try them out now so i went to the internet as we all do i've found a really simple demo sketch this one here in fact i'll put the um the url in the video description below but basically it's a pretty small little thing and it's step by step you know how to put this board on you can see pictures of it and connectivity and everything else right even tells you what the pins are for but basically i'll put this sketch onto my ide which looks like this now the thing that happened is when i ran the sketch all i got was the white screen of death even on this one but what did come up in the serial monitor it says here if you're using the arduino shield the line define use adafruit shield pin out should be uncommented it should appear right so in the adafruit library i had a look and it was uncommented out so i thought well hmm you know what's the alternative so i commented the line out even though it says don't do that it shouldn't be that way what happened it all sprang into life so i'm guessing that because this isn't a proper adafruit shield it's it's a clone isn't it it probably doesn't have one of the pins connected to say is an adafruit one um that didn't work so if you buy this particular combination do look at that library look at that code comment and try it both ways go to the library and comment that line out what's that you want to see in the library where that is okay right so the library we're looking for then it's the tft lcd library that one over there on the left and it's the header file that one there and as you can see in this line here that's the bit that should be enabled if you've got a true adafruit shield but as i haven't i just commented that line out so this thing was not defined and it all sprang into life so it's more like a breakout board than a shield just a little caveat if anybody else gets stuck that might help you okay well that's enough of that um uno based one let's put that to one side and think about um this one here yeah it's supposed to this particular demo sketch was supposed to just show a few um pictures as we can see there using an sd card but i connected all this up checked the wiring 16 times and it still didn't work so i thought you know what i'm not going to use this anyway yeah after after half an hour trying to get this to work and it didn't i'm thinking why am i battling against it let's just forget sd and do practice what i preach let's have a look at the code right this is the the sketch that you're seeing running on that workbench and as you can see yes i've included the little fs header as shown in that previous video so forget sd we can use it almost exactly the same wherever you've put sd in the past you now just put little fs so within this sketch in the setup as you can see here i'm loading up the little fs file system and i'm saying false in there so do not initialize everything and it just then instead of using sd dot we just use little fs we can we can use it everywhere that it was being used before so in here in this tft draw stuff instead of sd in there we put little fs and it just works as normal it's a stream of data after all so that's that was pretty simple in the actual directory in the arduino ide then in the data directory in the sketch let's have a look at that so in my sketches folder there's there's my arduino sketches folder it's just on this drive here so i've got a folder called esp32 sd card test same as the eno file there's the sketch there's the data file that we mentioned in that previous video about little fs if we expand that there's all the images and so forth that are being displayed if we select all those look they come to a total of 962 kb so less than a meg and i don't think i'll be using that many gifs and bmps and all that in the internet radio thing but anyway it just goes to show you can get some stuff up into that that sort of spiffs little fs partition on the esp32 no trouble at all so practicing what i preach in that sense so as a first step towards the internet radio project that i'll be building this could be the screen i'll be using it's certainly one that is supported by the github repository that i'm using perhaps it's time we looked at that and then have a look where you can buy this sort of stuff they're pretty cheap actually i must admit i was pleasantly surprised so this is the github repository for the the project that i'll be following as you can see it's called an esp32 mini web radio now there was a more fully featured version than this but i thought you know all i want is a mini web radio in fact i've moved away now from the idea of having a speaker and a portable device because in fact what i want it is in my workshop here although i can use internet radio from the pc it's very awkward to do that because i can't mute things independently so what i'm going to do is build this unit that you see here in a self-contained box just with line out and line out can then feed into my mixer and valve amplifier that you've previously seen and it means i'll have an independent control of the music when it's playing in here now the guy who does this i say guy i'm assuming you know his um it's here schweib fowl um and he does a couple of um different internet radio things and he's got driver for that particular screen in fact if we look at the github here's the schematic for it he shows a slightly different screen here the esp32 here's the decoder mp3 i don't know if it's mp3 or i squared s actually um i haven't looked that far this screen isn't exactly the same but it's certainly spi driven and his project supports that i thought well you know simple enough i'll do it he's even got would you believe a whole video showing how it works here we are look esp32 radio um if i just play a little bit of that it actually shows some of the controls on there now look and i think yeah you know that would do certainly initially right and it's all touch screen as you saw there he was touching the the arrows here there he goes again look to the next station and the volume and all that can be adjusted as well so i think you know what that that is something that i'm going to seriously look at hence looking at this screen and getting the esp32 up and running with that so yeah that looks pretty good and it looks pretty responsive as he sort of you know changing things it's looking pretty good so standing on the shoulders of giants as it were i'm going to try and get this working no reason why it shouldn't work whether i use the screen on the workbench now or change to another screen i'm not yet sure but uh well at least i know that all this works and the esp32 bit all links together okay let's have a look how much these screens actually cost then if you were thinking of doing the same and indeed the esp32 module that's a dev module i've got there there are lots of ones out there called dev module or dev board just make sure you get one with the most amount of pins you can on it so on banggood i just typed in esp32 development board up here and of course it brought up this whole big long list of stuff um last time i think i showed you one for about five or six dollars so that's probably something like this one here i don't know what's interesting to this and this is apart from price um yeah just check that the pins are down the side you've got enough because some of them are pretty small and if any of you have ever used one of those esp8266-01 devices you know that that only exposes like three or four pins just to control a relay you don't want the same problem with any sp-32 we haven't got enough pins to connect up to so yeah check those out now this is a good example of what i'm talking about here we see two esp32 devices one with 38 pins and one with 30 pins now i'm not saying you couldn't build an internet radio with a 30 pin device there but um from what i've read it's always best to have too many pins so go for the 38 pin and then you won't lose out okay and there's something else you need to be aware of as well there are two distinct versions of the esp32 the one on the left is a d and the one on the right is a u and if you notice the d has the antenna already built onto the board but the u has that little tiny socket and it's designed for an external aerial that you just snap on there now whilst you might get a better range with the one on the right remember that you can't use it just as is so in some ways the one on the left if you've got a good wi-fi signal is plenty good enough all right just be aware of that loads there as i say i shouldn't think you need to spend more than about five or six dollars though and i don't know why this one's more expensive could just be the brand who knows let's have a look at the screens then so this is uh the results for ionia ili 9341 um i've got a 2.4 inch screen i think there is it might be 2.8 i can't tell it's upside down um so it might be this one let's have a look at this one first shall we yes indeed this is the one that i've got then so it's 6.66 oh dear there's a number uh if you get it from china um but it does ship from the usa and the uk obviously at higher prices let's see how much it is from the uk first this is in fact the exact same screen that i got so from the uk it is 10.99 but free shipping and you get it within the week so yeah you have to think about that from the usa it costs 10.99 as well and uh oh you have to pay shipping oh to united kingdom well obviously i don't want it shipped here from the usa when i can order it from the uk so 10.99 then i'd imagine that would be well it might be free shipping in the united states depends where you live i suppose doesn't it which state or whatever but i think for the price or you know you can always ship it from china and wait a bit was there shipping on that one let's just go back and have another look uh two dollars shipping so that actually brings it to 871 doesn't it so not a huge amount in it and it whilst this says to the united kingdom eight to ten business days and they are pretty quick now again they've improved their service since the um kovid 19 shut all the airlines down um it still does take a little while compared to the two or three days that i find if you order it directly from the uk so if you look underneath so as you can see here i'll just expand that look all those um pins down the side there's a lot of them but all spi imagine how to be if we didn't have spi so yeah that's the one i'm using that's not bad is it really to make an internet radio out of so if you're thinking you know five or six dollars for the esp32 six to ten dollars for the screen you do need that it's either an mp3 decoder or i squared s decoder not sure yet but that's probably another four or five dollars that's roughly it for a line out if you need an amplifier and speakers that'll cost you more but we'll we'll see about those in a future video when i've got it all up and running we can dissect it a little bit at our pleasure so it's not difficult this if i can get these screens up and running i guess anyone can and yet do not do not use let's chuck that away we're not going to use sd cards we'll stick to little fs as long as there's room in that three meg fingers crossed we'll see how it goes okay that's all for this week because it's um you know an intermediate stage of this project the very first stages of getting things working so i'd um i'd appreciate your comments down below any experiences you've had on internet radios and screens and stuff i'm not always good to hear there's so much information out there and you guys have got a lot of experience in certain things that's always good to share that and other readers will come in and see that and go oh yeah i didn't know this and off they go away as well great stuff okay they're probably some affiliate links down below which helps support my channel that would be good but whatever whichever way you choose to buy stuff or not i'll see you in the next video i hope you're finding these videos useful and interesting there are plenty more videos to choose and a couple are shown below and if you'd like to subscribe to this channel just click on my picture below and enjoy the rest of the videos thanks for watching
Info
Channel: Ralph S Bacon
Views: 20,141
Rating: undefined out of 5
Keywords: Arduino, Beginners, electronics, C++, microcontrollers, programming, ardiuno
Id: wMJFkhmp2UE
Channel Id: undefined
Length: 19min 35sec (1175 seconds)
Published: Fri Nov 06 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.