01 Getting Started with ESP32 | IoT Development | Arduino IDE setup | ESP32 pinout | GPIO Led Blink

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi again and welcome to iot development training course for today's lesson you'll learn the basics of the esp32 to get you started right away with your iot projects we'll look at the esp32 specifications and some of the common development boards that are currently available in the market you'll learn how to configure your Arduino IDE so that it allows you to communicate and upload programs to your esp32 take note that we are no longer using the Arduino Uno board for this course and we are only going to be using the Arduino IDE and its programming language since this is very familiar to us from our previous course embedded systems with Arduino Uno if you haven't watched it yet please check the link in the description below of course we'll investigate the esp32 pin out and its basic functionalities and ultimately you should be able to test and conduct a very simple experiment on your own esp32 development board to perform basic input and output operations hi my name is Joe Edgar and welcome to iot development training course with esp32 so let's get started the esp32 is created and developed by expressive systems a shanghai-based Chinese company and one of the world leaders in microcontroller development if you look at their website there are various esp32 modules that you can see based on the esp32w room esp32 Rover mini Pico du and solo series unlike the atmega 308p found in your Arduino Uno board the esp32 is more powerful the esp32 chip is available in both dual core and single core variations and for this course we will be using the ESP W room 32 module it runs on a 10 silica extensor lx6 32-bit microprocessor with an operating frequency of up to 240 megahertz it has 512 kilobytes of ram it has integrated 2.4 gigahertz Wi-Fi Bluetooth and Bluetooth low energy which makes this microchip great for iot project this is unlike most of the commonly used Arduino boards which require the use of an add-on Shield just to have Bluetooth and Wi-Fi capabilities the ESP W room 32 is packed with multiple functionalities it supports up to 18 12 bit analog the digital converters or ADC and two 8-bit digital to analog converters or DAC it has 10 capacitive touch sensor inputs it has a built-in hall effect sensor it can also be an IR remote controller with up to eight individual channels it can supply pulse width modulation or pwm for driving Motors as well as pwm for LEDs up to 16 independent channels moreover it has 4 serial peripheral interface or SPI bus channels two inter-integrated circuits or i2c bus connections two inter-integrated circuit sound or i2s bus connections this is a bus that can carry digital audio it has an ultra low power analog preamp it has three uarts for serial communication it can also act as an SD card host controller and it has multiple real-time clocks or rtcs although the esp32 module comes in a 48 pin package not all pins are exposed in all esp32 development boards that are available on the market as some of the pins cannot be used directly or are not recommended for use here are some of the examples of the many varieties of the commonly used esp32 boards the do it dev kit V1 the esp32s node MCU the ESP is 32 thing from SparkFun the esp32 feather board from Adafruit the wemos lowland 32 and a lot more for this course most of my demonstrations will be done using the 38 pin esp32s node MCU development board which is very popular but you can definitely use any of the esp32 boards out there you just have to be careful with your boards pin out as it varies depending on what you're using here is an example of a typical pin out for the 38 pin esp32s node MCU development port as you can see most spin outs on the ESP W room 32 has multiple functions and some of the functions conflict with each other and cannot be used simultaneously so now let's start experimenting with your esp32s node MCU development board using the Arduino IDE let's start with the basics for this experiment we'll test some of the gpio pins of your esp32 so you'll need an esp32 development board an LED a current limiting resistor mine is 220 ohms but you can use any value ideally from 150 to 470 ohms you'll also need a tactile switch of course your breadboard a couple of connecting wires and a micro USB data cable make sure that you use a good quality data cable and not just any charging cable because it won't work so we'll Begin by placing your esp32 development board onto your breadboard make sure that each pin is properly aligned before pushing it firmly to the board in some cases you might need to bend some of the pins to get them in place just be careful not to damage the pins of your esp32 board first I'll connect the ground of this node MCU board to the negative bus strip of the spreadboard and then I'll connect the gpiop number 2 of the esp3221 side of the current limiting resistor the other side of the resistor is connected to the anode of the LED while the cathode of the LED is connected to the ground of the esp32 and then I'll connect the gpio0 of the esp32 to one side of your push button switch and the other side is connected to the ground notice that I didn't Implement any pull up or pull down resistors to our circuit connection we'll do this programmatically later let me reposition this output LED so that you can have a better view of its connection just make sure to connect the upper negative bus strip to the lower negative bus trip of your breadboard or you can also use the ground of the other side of your board now all we must do is to plug in this node MCU board via this micro USB connector in your computer open the device manager and once you hear the connected sound you should be able to see a newly detected device under ports mine is detected as silicon Labs cp210x USB to uart bridge com7 you'll also notice that the power LED on your node MCU board is now turned on now to use the Arduino IDE for esp32 boards first we need to add the esp32 board to the Arduino IDE by default the Arduino IDE only sees Arduino boards so to do this we need to install the esp32 package for Arduino from GitHub so let's Google it esp32 Arduino GitHub and click on this esp32 Arduino boards manager link now copy this stable release link which basically is a link to a Json file and then go back to your Arduino IDE click on file preferences and in the additional boards manager URL paste here the link that you copied from GitHub note that if there are existing entries to this URL text box you can simply put a comma to it before pasting the additional URL and then click ok now go to tools board manager and from here you can see all the installed boards that your Arduino IDE currently has search for esp32 and when you see one from the expressive systems just click install and depending on your internet connection it could take some time I'll fast forward this and after the installation is finished just click close now click again on the tools board so you can verify that the esp32 Arduino boards already exist so in here you'll see a lot of supported boards now if you're using a similar board to what I'm using which is a generic esp32s nodemcu simply choose this esp32 Dev module and you're good to go also make sure that you have selected the correct com port number especially if you have multiple devices attached to your computer mine is com7 also note that there are plenty of examples per programming esp32 that are now installed in your Arduino IDE so you can explore it as you wish and perform your own experiment but for our first experiment let's just try writing a simple blinking program to the Circuit connection that we have so I'll declare a lead variable and assign a value of 2. this is our gpio pin number two in the setup function I'll set the mode of this gpio p number two as output let's also use our serial Monitor and set its bond rate to 115 200. now inside the loop function I'll call the digital write function to send a logic High signal to gpio pin number two let's also have the message welcome to iot development and then delay for one second and I'll duplicate this code and change this to a low signal to have a blinking lead effect and then I'll change this to print Ln so it goes to the next line and the message is esp32 well this is not new to you and this is exactly similar on how we write programs to our Arduino boards now let's click the upload button and it is asking us to save our sketch okay let's give it a name esp32 program01 LED blink and hit save and the compilation should begin right away although you will notice that the compilation time for your esp32 board is slightly slower than compiling your Arduino Uno board now there is one major difference for this upload to succeed when the compilation is done and uploading begins you should see this message connecting and for this node MCU board you must press this boot Button that appears on the right side of your board just hold it for a couple of seconds until you see the writing at the flash memory with the corresponding percentages then you can let go if you don't do this correctly an upload error message will appear so after it's done uploading you should be able to verify your running program to your esp32 board and congratulations you have successfully uploaded your first program in esp32 via the Arduino IDE you will also notice a blinking blue LED next to the red Power lead this built-in LED is connected to the gpio pin of your esp32 kinda similar to the built-in LED in your Arduino Uno connected to gpio 13. also on the other side of your board is another button which serves as a reset button pressing it resets the program execution okay now let's modify our program to include this push button so I'll declare another variable and assign a value of 0 because this button is connected to the gpio number 0 of the esp32 in the setup function let's set the pin mode of this button to input pull up this is to activate the board's internal pull-up resistor since we didn't specify any in our circuit connection inside the loop function I'll create a condition that if the button is pushed meaning it is connected to the ground I'll cut this one first and create a separate function called lead link and paste our blinking codes here and then I'll call it when this condition is satisfied meaning when we push the switch the lid links otherwise we turn the lid off okay now let's click this upload button and same as before when you see this connecting message just press this boot Button and hold it until you see this right into the flash memory then you can let go so since our button is not being pushed right now it is still pulled High by the board's internal resistor making this if condition to be evaluated as false thus turning the lead off and once I press this button it satisfies the condition and the let blink function is called now there's one more thing let's check the serial monitor to verify If the message is being printed Click On Tools serial monitor just make sure that the baud rate in your serial monitor is set to the same value that you have specified when you set up your board so I'll choose one hundred fifteen thousand two hundred now let's try pressing this button one more time and as you can see clearly the message appears in sync with the turning on and off of the LED okay same as before I'm going to give you your programming challenge activity this is for you to practice your previous programming skills in writing codes for Arduino but now you will be practicing for esp32 so I want you to modify this demo circuit that we had and choose different gpio pins for your push button switch and your LED also instead of just one LED you will be working with two LEDs this is how your program should behave clicking this button for the first time causes the two LEDs to Blink with the corresponding message displayed in your serial monitor in sync to the blinking on and off now clicking the push button for the second time changes the LED sequence to alternating light also pay attention to the message displayed in the serial monitor alternating on off off on and when the button is clicked for the third time everything stops the LEDs are off and there is no additional message displayed on the serial monitor now when the push button is clicked again it repeats the entire process as if it is clicked for the first time if I click again the mode is now alternating and clicking it one more time everything stops so that's it for your challenge and as a hint try to recall how to use the milis function in our previous course in Arduino Uno you'll need it here especially in our succeeding lessons up next you'll learn how to work with the esp32's analog input and output signals we'll experiment on Photo existors potentiometer and pulse with modulation signals for controlling Servo Motors and LEDs again thank you very much for watching and if you learned something of value here please hit the like And subscribe button and don't forget to hit that Bell icon to get notifications for every video that I uploaded for this course
Info
Channel: Education is Life
Views: 17,344
Rating: undefined out of 5
Keywords: ESP32, ESP32-WROOM-32, ESP-WROOM-32, Arduino IDE, Board Manager, Led Blink, Switch, Tactile switch, momentary contact push button switch, GPIO, NodeMCU, ESP-32S NodeMCU, IoT, Internet of Things, ESP32 Development board, blinking program, input output, ESP32 pinout, Espressif systems, serial monitor
Id: J6QJNyRKFbw
Channel Id: undefined
Length: 18min 10sec (1090 seconds)
Published: Mon Sep 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.