Utilizing the ESP 32 in a Project: A Journey of Trial and Error
The ESP 32 is a microcontroller that can be used to create a wide range of projects, from simple LED matrices to more complex Wi-Fi controlled systems. In this article, we will follow one such project, which aims to utilize the ESP 32 to control an LED matrix using Wi-Fi connectivity.
Initially, the project began with the use of the Fast LED library, but it was soon discovered that this library had some issues, including a delay function that seemed to have been altered. This meant that the testing animation of the white LED was too fast and did not provide any meaningful results. The project was also plagued by random colors lighting up periodically, which made it difficult to test the system. In conclusion, the Fast LED library was deemed unsuitable for this project.
Fortunately, an alternative solution was found in the form of the ESP 32 or digital RGB LED drivers on GitHub. These drivers utilize the on-T peripheral of the MAC controller, which is also used by the remote control module driver for infrared remotes. To test the drivers, the author downloaded the GitHub files and uploaded them to the board, connected it back to the matrix, and powered up the system. The results were promising, as the code seemed to work just fine.
As a final test, the author altered the code in a way that was similar to the testing code used with the Fast LED library. However, this time the code broke flawlessly, which meant that it was time to add Wi-Fi parts to the project. The example sketches for the ESP 32 contain a simple Wi-Fi server sketch, which is exactly what was needed. After including the SSID and password of the author's network, the code was uploaded to the system.
To check the IP address of the ESP 32 through the router, the author entered the IP address in a browser. To verify that the system was working correctly, the author measured the voltage at pin 5 using a multimeter. This confirmed that the concept of Wi-Fi control would indeed work fine.
However, the author had no intention of controlling the LED matrix to a browser. Instead, most of the server-client code was removed and replaced with simple lines that checked what was entered after the IP address in the URL. In this example, the author entered slash picture slash one to turn on the GPIO pin or slash picture / 2 to turn off the GPIO pin. However, since the author did not want to turn on or off a GPIO pin, the code was altered once again to change the value of a variable called "picture" in the stats.
This allowed the author to use the "picture" variable to activate different LEDs and create different pictures. After short tests, it became clear that this approach was working flawlessly with the LED matrix. However, these are only static pictures, as animations would require checking periodically whether Wi-Fi client is available. The author decided not to focus on this typical problem for now.
Instead, the author visited the MIT App Inventor website, which provides a very easy way to create Android applications. A new project was created in the editor, with a text box for entering the IP address of the ESP 32 system, two buttons to switch between the two pictures, and the web connectivity feature. The block programming section of the app contained only two blocks: one that set the URL to HTTP slash slash the IP address entered in the text box slash picture slash one or two, and another that executed the web cat commands.
To complete the project, the author installed the app on their phone and gave it a try. As can be seen in the video, entering the IP address does work without any problems. However, when the button is clicked, an error message appears, saying that there is no information from the server. Despite this, the program does indeed work with the LED matrix.
The author acknowledges that a few functions do not work perfectly yet, but most of its work is certainly good enough to create dozens of awesome projects. The author hopes that watching this video was enjoyable and encourages viewers to like, share, and subscribe. Consider supporting the author through Patreon to keep such videos coming, and stay creative until next time.
WEBVTTKind: captionsLanguage: enas you might know I created this 10 by 10 RGB LED matrix that can display mesmerizing pictures and animations doing a previous project video and while it is certainly an eye catcher I think it is a shame that once you upload your animations to the button Arduino Nano you can only watch the LEDs going through the codes and not select your favorite light show whenever you want that sounds like a job for the esp8266 which is a microcontroller with built-in Wi-Fi that features 160 kilobytes of memory 16 GPIO pins SPI I squared C 8 squares and a DC and much more seems like a suitable choice for a project but recently and with recently I mean in 2016 the successor of the esp8266 was released the ESP 32 this one offers a higher clock speeds more memory Bluetooth supports more gpros at DAC and even sensors like the temperature Hall or touch sensor so even though this mug controller is definitely an overkill for my project upgrade I will show you in this video how easy a-slash difficult it is to use such a microcontroller and in the end demonstrate how you can use it to control any kind of project through Wi-Fi let's get started first off we should visit ESP 8:32 nets which does not only offer tons of information about the microcontroller links to different tutorials and details about all the different development boards but also a list of the currently available development software while there's a variety to choose from I want to be lazier and stick with the one I'm familiar with the Arduino IDE after clicking the link akita page was presented which offered the Arduino core for the ESP 32 perfect to install it I simply followed the given installation instructions which means I installed the newest arduino ide version followed by the installation of kits and afterwards use the program to download the github data and moved it into the corresponding Arduino folder once that was done I started the arduino ide and noticed a couple of new ESP 32 options in the broad selection section of the software but the question was which one to choose now I got my ESP 32 boards for cheap from China and luckily it was not only the manufacturer mentioned on the back but the exact board type was also listed in the board selection that means it was time to connect the ESP 32 to the computer and have a look at a couple of the included example sketches as you can see there are quite a lot of different functions of the microcontroller presented through the example sketches and even the github page says that most of the framework is implemented only the analog right function is missing but you can use alternatives for that so as a first test let's see whether the whole sense of sketch works after opening it all we have to do is to check whether the comport is correct and then click uploads as soon as the software says that it is connecting we have to hold down the boot button on the ESP 32 boards until a successful connection was established afterwards at the upload executes automatically and after opening the serial monitor and changing the baud rates we can see that by bringing a magnet close to the ESP 32 the values of the serial monitor increase or decrease depending on which pole is aligned with the microcontroller of course this sketch has a more visual appeal when using the serial plotter but either way it means that the codes and ports functions correctly so after I tried out a second sketch the touch read sketch which changes the values of the serial monitor according to bother I touch a specific pin it was time to control the LED matrix the Arduino code I used so far utilized the fast LED library to control the ws2812 addressable LEDs since they require a precise timing of the high and low states which represent the decision 1 and 0 luckily though the ESP 32 is apparently supported by the fast LED library so I created a simple example codes uploaded it to the ESP 32 remove the data wire from the arduino and instead connected it to the pin 23 year of the ESP 32 which i defined beforehand as the data pin after then connecting the ground of the ESP 32 to the ground potential of the matrix and powering it all through my lab bench power supply we can observe two problems but firstly it is a positive aspect to note that even though the ESP 32 sends out 3.3 volt signals the 5 volts ws2812 IDs seem to react kind of accordingly even though the datasheet states a minimum data in voltage of 3 point 5 volts but then again random colors seem to light up periodically and the test animation of the troubling white LED is way too fast it seems like the delay function was altered through the fast LED library so in conclusion I cannot use this library year for the LED matrix upgrade thankfully though I assume found the ESP 32 or digital RGB LED drivers on github it seems to utilize the on T peripheral of the Mac controller which is the remote control module driver for infrared remotes so to test it I downloaded the github files open the included demo sketch uploaded it to the board connected it back to the matrix and powder roll-up in order to see that this code seems to work just fine as a last test I altered the code in a way that it is basically the same test code I tried earlier with the fast LED library with the only difference that this time the code broke flawlessly which means it was time to add the Wi-Fi parts to the project upgrade the example sketches for the ESP 32 contain a simple Wi-Fi server sketch which is basically exactly what we needs after including the SSID and password of my network I uploaded the codes check the IP address of the ESP 32 through my router enter this IP address in a browser and was greeted with the texts which was programmed beforehand on to the microcontroller here we can select whether we want to turn on or off pin 5 which doesn't affect work if we measure the voltage at the pin with a multimeter that means this concept of Wi-Fi control would just work fine but I actually do not want to control the LED matrix of to a browser so removed most of the server client codes and replace it all with a few simple lines which simply check what was entered after the IP address of the entire URL in this example I have to enter slash picture slash one to turn on the GPIO pin or slash picture / 2 to turn off the GPIO pin but since I do not want to turn on or off a GPIO pin I change the code once again to alter the value of a variable called picture in stats which I can use in the codes to activate different LEDs and thus create different pictures which after short tests seem to work flawlessly with the LED matrix of course those are only static pictures if I would want to create fluent animations I would have to check periodically whether Wi-Fi client is available which means we would need a timer interrupt or something similar so let's rather not focus on this typical problem right now instead let's get rid of this annoying URL and to ring every time we want to change the picture for that I visited the MIT App Inventor websites which is a very easy way to create your own Android applications there I created a new project editor text box for entering the IP address two buttons to switch between the two pictures and the web connectivity feature next I moved on to the block programming section of the app which simply contains of two blocks which say that when a button is pushed we want to set the URL to HTTP slash slash the IP address we entered in the text box slash picture slash one or two afterwards we simply execute the web cat commands which enters the URL and the project was complete all that was left to do was to install the app on my phone and giving it a try now as you can see here entering the IP address does work without a problem but once I click a button there is an error message popping up it basically says that we get no information from the server since we use the web cat function but since it entered the URL anyway the program does in fact work with the LED matrix we have the problem at this point we could of course improve the Android app and te SP 32 codes even more to get rid of the error message or add more buttons or playback fluid animations and whatnots but I think this project so far already gave you a good idea that it is actually not hard to utilize the ESP 32 in a project needless to say a couple of functions do not work perfectly yet but most of its work certainly good enough to create a few dozens of awesome projects and with that being said I hope you enjoyed watching this video if so don't forget to like share and subscribe consider supporting meer through patreon to keep such videos coming stay creative and now we'll see you next timeas you might know I created this 10 by 10 RGB LED matrix that can display mesmerizing pictures and animations doing a previous project video and while it is certainly an eye catcher I think it is a shame that once you upload your animations to the button Arduino Nano you can only watch the LEDs going through the codes and not select your favorite light show whenever you want that sounds like a job for the esp8266 which is a microcontroller with built-in Wi-Fi that features 160 kilobytes of memory 16 GPIO pins SPI I squared C 8 squares and a DC and much more seems like a suitable choice for a project but recently and with recently I mean in 2016 the successor of the esp8266 was released the ESP 32 this one offers a higher clock speeds more memory Bluetooth supports more gpros at DAC and even sensors like the temperature Hall or touch sensor so even though this mug controller is definitely an overkill for my project upgrade I will show you in this video how easy a-slash difficult it is to use such a microcontroller and in the end demonstrate how you can use it to control any kind of project through Wi-Fi let's get started first off we should visit ESP 8:32 nets which does not only offer tons of information about the microcontroller links to different tutorials and details about all the different development boards but also a list of the currently available development software while there's a variety to choose from I want to be lazier and stick with the one I'm familiar with the Arduino IDE after clicking the link akita page was presented which offered the Arduino core for the ESP 32 perfect to install it I simply followed the given installation instructions which means I installed the newest arduino ide version followed by the installation of kits and afterwards use the program to download the github data and moved it into the corresponding Arduino folder once that was done I started the arduino ide and noticed a couple of new ESP 32 options in the broad selection section of the software but the question was which one to choose now I got my ESP 32 boards for cheap from China and luckily it was not only the manufacturer mentioned on the back but the exact board type was also listed in the board selection that means it was time to connect the ESP 32 to the computer and have a look at a couple of the included example sketches as you can see there are quite a lot of different functions of the microcontroller presented through the example sketches and even the github page says that most of the framework is implemented only the analog right function is missing but you can use alternatives for that so as a first test let's see whether the whole sense of sketch works after opening it all we have to do is to check whether the comport is correct and then click uploads as soon as the software says that it is connecting we have to hold down the boot button on the ESP 32 boards until a successful connection was established afterwards at the upload executes automatically and after opening the serial monitor and changing the baud rates we can see that by bringing a magnet close to the ESP 32 the values of the serial monitor increase or decrease depending on which pole is aligned with the microcontroller of course this sketch has a more visual appeal when using the serial plotter but either way it means that the codes and ports functions correctly so after I tried out a second sketch the touch read sketch which changes the values of the serial monitor according to bother I touch a specific pin it was time to control the LED matrix the Arduino code I used so far utilized the fast LED library to control the ws2812 addressable LEDs since they require a precise timing of the high and low states which represent the decision 1 and 0 luckily though the ESP 32 is apparently supported by the fast LED library so I created a simple example codes uploaded it to the ESP 32 remove the data wire from the arduino and instead connected it to the pin 23 year of the ESP 32 which i defined beforehand as the data pin after then connecting the ground of the ESP 32 to the ground potential of the matrix and powering it all through my lab bench power supply we can observe two problems but firstly it is a positive aspect to note that even though the ESP 32 sends out 3.3 volt signals the 5 volts ws2812 IDs seem to react kind of accordingly even though the datasheet states a minimum data in voltage of 3 point 5 volts but then again random colors seem to light up periodically and the test animation of the troubling white LED is way too fast it seems like the delay function was altered through the fast LED library so in conclusion I cannot use this library year for the LED matrix upgrade thankfully though I assume found the ESP 32 or digital RGB LED drivers on github it seems to utilize the on T peripheral of the Mac controller which is the remote control module driver for infrared remotes so to test it I downloaded the github files open the included demo sketch uploaded it to the board connected it back to the matrix and powder roll-up in order to see that this code seems to work just fine as a last test I altered the code in a way that it is basically the same test code I tried earlier with the fast LED library with the only difference that this time the code broke flawlessly which means it was time to add the Wi-Fi parts to the project upgrade the example sketches for the ESP 32 contain a simple Wi-Fi server sketch which is basically exactly what we needs after including the SSID and password of my network I uploaded the codes check the IP address of the ESP 32 through my router enter this IP address in a browser and was greeted with the texts which was programmed beforehand on to the microcontroller here we can select whether we want to turn on or off pin 5 which doesn't affect work if we measure the voltage at the pin with a multimeter that means this concept of Wi-Fi control would just work fine but I actually do not want to control the LED matrix of to a browser so removed most of the server client codes and replace it all with a few simple lines which simply check what was entered after the IP address of the entire URL in this example I have to enter slash picture slash one to turn on the GPIO pin or slash picture / 2 to turn off the GPIO pin but since I do not want to turn on or off a GPIO pin I change the code once again to alter the value of a variable called picture in stats which I can use in the codes to activate different LEDs and thus create different pictures which after short tests seem to work flawlessly with the LED matrix of course those are only static pictures if I would want to create fluent animations I would have to check periodically whether Wi-Fi client is available which means we would need a timer interrupt or something similar so let's rather not focus on this typical problem right now instead let's get rid of this annoying URL and to ring every time we want to change the picture for that I visited the MIT App Inventor websites which is a very easy way to create your own Android applications there I created a new project editor text box for entering the IP address two buttons to switch between the two pictures and the web connectivity feature next I moved on to the block programming section of the app which simply contains of two blocks which say that when a button is pushed we want to set the URL to HTTP slash slash the IP address we entered in the text box slash picture slash one or two afterwards we simply execute the web cat commands which enters the URL and the project was complete all that was left to do was to install the app on my phone and giving it a try now as you can see here entering the IP address does work without a problem but once I click a button there is an error message popping up it basically says that we get no information from the server since we use the web cat function but since it entered the URL anyway the program does in fact work with the LED matrix we have the problem at this point we could of course improve the Android app and te SP 32 codes even more to get rid of the error message or add more buttons or playback fluid animations and whatnots but I think this project so far already gave you a good idea that it is actually not hard to utilize the ESP 32 in a project needless to say a couple of functions do not work perfectly yet but most of its work certainly good enough to create a few dozens of awesome projects and with that being said I hope you enjoyed watching this video if so don't forget to like share and subscribe consider supporting meer through patreon to keep such videos coming stay creative and now we'll see you next time