Introduction to ESP32 Board - Getting Started ( Step by Step)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome back to my YouTube channel so in this new course we are going to talk about the esp32 microcontroller so this is called node MCU esp32s microcontroller that we can program to create some cool projects and it comes with lots of features like Wi-Fi Bluetooth and these are built in unlike Arduino in order to use Bluetooth you have to bring a Bluetooth module and hook it up to the Arduino board so that you can use this feature this microcontroller comes with these features built-in Wi-Fi and Bluetooth as well as touch sensors that we can use for some projects and this is the first video of this series we are going to talk about these features then we will start programming this board using the Arduino IDE as you can see we have micro USB port basically you could use a micro USB cable and hook it up to the computer so that we can program it anyways before we get started make sure to subscribe to my channel and hit the Bell icon so that you get notified with my videos and let's start by talking about the features of this microcontroller you could go to this link esp32.net here you will see all of the features and specifications for example we have wireless connectivity like Wi-Fi Bluetooth we have some information about the main processor like the clock frequency it's up to 240 megahertz so this microcontroller is faster than the Arduino that's why I highly recommend you to use it and it comes with lots of pens as you can see we have more than 30 pens that you could use to control some devices or to read values from sensors and let's go all the way down we have this development section we can develop this board using different ways for example you could use the Arduino IDE python JavaScript and more in this series we are going to use the Arduino IDE because we have talked about it in our previous videos but you don't have to watch these videos we are going to start from scratch first we will download the Arduino IDE and if you want to check these steps you could click on this link first we have to download the Arduino IDE then we'll modify it so that we can work with the esp32 board so let's go to the Arduino official website to download the Arduino IDE now we have the version 2.0.0 make sure to download the latest version to download the software we have different options so if you have a Windows machine make sure to click on this link so this is multi-platform you could download it for Mac OS and Linux here I have a Windows machine and I'm gonna click on this link Windows 10 you could donate but I will just download it and hit start and once it's completed you could go to downloads and as you can see we have the executable file to install the Arduino IDE we have to run it or open it up by double clicking on it and the installation is very simple let's agree then I want to use this for all users and let's hit next then yes so the steps are very simple let's agree again I'm going to leave the destination folder as default and let's hit install and yeah it's installing the program and let's close this window we don't need that then you could open it up by selecting this option around the Arduino IDE and hit finish or you could simply open it up from the desktop and now it is started so this is the first time I use the new version of the Arduino IDE and I think the interface is amazing and as you can see it's downloading some packages automatically from here now before we start programming the esp32 we have to modify the Arduino IDE basically we can go back to the website after installing the Arduino IDE we have to copy this link using this copy icon now let's go back to the sketch and you have to go to file preferences and under additional boards manager URLs we have to paste it using right click and paste but for some reason I can't hit okay maybe we have invalid Sketchbook location so I will try to change it let's put it under documents and choose and that fixes the problem so make sure to paste the link and hit OK The Next Step after adding this URL we have to select the boards manager and install the esp32 let's go to tools then board s manager from here we can search for the esp32 basically it's a package that allows you to program any kind of esp32 microcontroller so let's hit install and wait a bit and once it is installed we have here installed now the Arduino IDE is ready to program esp32 boards so let's make a simple sketch to check if our board is working so this board comes with a blue LED which is built in and it is connected to one of the pins and it is depend number two we will write a sketch that will turn it on and off and this is called the blink sketch and to do that first we have to plug in the esp32 so let's use the micro USB to hook it up to the computer let's clear these and close the boards manager using tools board and Boards manager here we have two functions the setup function and the loop function basically we use the setup function to set up some variables or initialize them and we use the loop function to check if something is happening it is called over and over again for example we can read the temperature from a sensor and each time we will check if it's above a certain value we can turn on the air conditioner and so on in our sketch we are going to turn the LED on and off so if you want to know the pins of the board we have this image and all of the pens are labeled for example the top one is the gnd we have 3.3 volts and more than 30 GPA opens and the built-in LED which is blue is connected to the gpio pair number two basically we can use the digital write command which we can use to send a voltage from this pin and turn on the LED and to do that first we have to define the pen on top and it is an integer using int so an integer is a whole number like one two and so on in our case it is the PIN number two first we have to give it a name like LED pin then we can give it a value which is number two and semicolon and that's how we can declare a variable which we can use later on then under this as a function we have to tell the esp32 that we are using the gpio pin number two as an output so that we can control the LED and the command for that is pen mode this takes the pin number which is to and the output keyword so if you have a sensor and you want to read from it you have to pass in input but we're going to use it as an output to turn on and off the LED and instead of using this value directly we can use the variable LED pen for now I will simply turn on the LED under the setup function we can use digital right which takes the pin number LED pin and to turn the LED on by sending a voltage we put the high keyword then semicolon now to upload the code we have to select the right board which is the node MCU esp32s and to do that you have to go to tools then board and now you will see an esp32 option basically we have different versions of this board so if you have another one make sure to select it for me I'm gonna search for the note 32s which is this one and you could find the name of the board from behind for me it's esp32s make sure to search for the same name then we have to select the port of the USB cable using tools then port for now we have one port and it is called comb1 but if you unplug the USB cable of the esp32 in this spot doesn't disappear so this could be for the mouse or the keyboard and for some reason the computer doesn't recognize the port of the USB cable to fix this problem let's go under device manager and under other devices you see that we have this kind of warning basically we are missing a driver that needs to be installed so that the computer can communicate with the esp32 using the USB cable I've already searched for this driver cp2102 and they've got this website I'm going to add a link to it under the description then under downloads we can download the software or drivers using one of these links so you could download it for Mac windows for me I have a Windows machine I'm going to select this option it's about four megabytes then let's go under downloads first we have to extract it so we have a zip file let's right click and hit extract here and when you open it up we have two installers one for the 64-bit machines and another one for the 32-bit for me I have a 64-bit machine you could get that under PC right click and go to properties for me I have 64 operating system that's why I'm going to double click on this installer accept and hit next and finish now let's restart the Arduino IDE but first we have to save this file using save as I'm going to put it under the desktop and let's call it blink sketch and hit save then let's close this and open up the project again using the Arduino IDE we have to go to file and open then we selected the folder of the project blank sketch and select the inner file and that's how we can open up the project and save it now let's select the port again using tools part and you will notice that we have another one com6 it's definitely for the esp32 I'm going to select it and once you selected the port and the board which is an esp32 OS let's select it upload and at some point you have to hold the boot key we have this push button let's hold it now it is uploading and it is done let's hit reset which is this one and there you go we have this blue LED that is turned on so our project is working now we will turn on and off this led continuously and to do that we will use the loop function so each tie will turn it on I'm going to copy this line or cut it and paste it under the loop then we have to wait a bit like one second using a command and it is called delay this takes the number of milliseconds for example 500 is a half second let's make it one second which is one thousand milliseconds then we turn it off using digital right we give it the LED pen and to turn it off we use low then we wait a bit again I'm gonna wait for one second using delay 1000 and because this is a loop function which is called over and over again it will turn on and off the LED and this is called the blink sketch now let's try it using the upload button for me it's uploading the code directly without holding the boot key and there you go we have this blue LED that turns on and off now that we know that the esp32 is working we can move on to the next project but that's it for this video I hope you like it in the next one we are going to use the Wi-Fi feature to turn on and off the LED using Wi-Fi capability so I think that's pretty much it guys for this video I hope you like it if you have any question or comment make sure to write it under the comment section down below and I will try to answer that as soon as I can and they will see you in the next one
Info
Channel: Enjoy Mechatronics
Views: 61,556
Rating: undefined out of 5
Keywords: Arduino, tutorial, enjoy mechatronics, how to, electronic, microcontroller, coding, lessons, software, programming, getting started, esp32 beginners, esp32, introduction, uno, esp8266, beginner, learn, sketch, connected, sensors, basic tutorial, gpio, pin, internet of things, smart, wifi, howto, basics, arduino, sensor, wireless, lesson, course, education, espressif, chip, iot, esp32 tutorial, ESP32, esp32 introduction, esp32 arduino, arduino ide, blink sketch, first esp32 project
Id: aLEKiGNfHZw
Channel Id: undefined
Length: 14min 48sec (888 seconds)
Published: Fri Oct 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.