Internet of Things | Achraf Mad | Skillshare
Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
11 Lessons (1h 11m)
    • 1. 1 Introduction

      2:14
    • 2. 2 Hardware and Software Requirements

      1:53
    • 3. 2a ESP 32 Pinout v1 DOIT

      9:04
    • 4. 3 Download and Install Arduino ESP and USB Driver

      6:17
    • 5. 3 What is ESP32 Board

      4:27
    • 6. 4 Download and Install Arduino ESP32 v1 Development enviroment

      4:05
    • 7. 5 Load Your First Code to ESP32 Board

      3:41
    • 8. 6 Coding LED Blink

      5:42
    • 9. 7 Touch Sensor

      11:04
    • 10. 8 Dealing with Analog Signals

      8:05
    • 11. 9 PWM Signals

      14:38
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

16

Students

--

Projects

About This Class

IoT Internet of Things Crash Course

A Different IoT Power and Performance, Use ESP32 microcontroller to MAKE IoT projects to unleash your creativity

What you'll learn

  • Learn about the ESP32 and why you must start using it
  • Learn about the variants of the ESP32 module.
  • Learn how to replace Arduino with ESP32 without coding effort
  • Learn about the differences and similarities between the ESP32 and the Arduino
  • Learn about the features ESP32 development kit
  • Learn how to use the ESP32 advanced capabilities
  • Learn how to use the ESP32 to connect any project to the Internet and display or exchange data
  • Become confident in using the ESP32 in your projects.
  • Use the ESP32 to enable your project to communicate with Bluetooth devices

Requirements

  • Basic Knowledge of Programming

Description

>>> IoT Internet of Things Crash Course: Step by step is a course specially created for Electronic Geeks & Engineers who want to take their Electronics and Microcontroller Projects to the next level, adding Wifi, Bluetooth connectivity and more processor power while maintaining battery life  <<<

Welcome to this course.

The course lesson will explain “How to work on ESP32 Board by using C Language and the famous Arduino IDE development environment. This course will work best for you if your basic knowledge of Electronics and Arduino. You will learn how to interface the ESP32 Board with your Computer and Control it in no time.

ESP32 can be used in your Engineering projects, Industrial Projects, or IoT Home Automation related projects.

Why Learn ESP32?

If you an Engineering or Science student you might come across projects in which you want to control or monitor via internet, ESP32 with it's Robust Design, Ultra-Low Power Consumption, High Level of Integration and Hybrid Wi-Fi & Bluetooth Chip is the best fit to get started in Internet of Things World.

We will explore:

  • Digital Output: Blinking a LED

  • Digital Input: Reading a Touch Sensor

  • Analog Input: Reading a variable voltage from a potentiometer

  • Analog Output: Controlling a LED brightness

  • Analog Output: Controlling a Servo Position

  • Reading Temperature/Humidity Data with a Digital sensor

  • Connecting to the Internet and getting local time

  • Receiving data from a simple local web page, turning on/off a LED

  • Transmitting data to a simple local webPage

At the end of this course, you can create Innovative IoT Projects. The only thing that you need to do is THINKING, WIRING & CODING.

Who this course is for:

  • Engineering Students - Electronics, Electrical & Computer Science
  • High School Science Students
  • Electronic Geeks, Hobbiest & Art Students
  • Embedded Systems Geeks
  • Arduino Geeks
  • IoT and embedded systems Geeks
  • Anyone interested in connecting his project to the internet with a low budget solution

Meet Your Teacher

Teacher Profile Image

Achraf Mad

Creative Engineer

Teacher

Hello, I'm Achraf.

A passionate engineer who loves to share his knowledge with the world

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

phone

Transcripts

1. 1 Introduction: Hello and welcome to this internet of things crash course. This is Ashraf. This course will guide you through creating your first internet connected electronics projects using a Wi-Fi breakout board that's available almost everywhere. You will learn the elaborate workflow of hardware and software that makes smart objects succeed through basic step-by-step examples. Well, go take examples of the most common things you want to build. Like a sensor arrow button that triggers an email or a tweet. We are also going to take an example about a circuit that displays information, fetch it from online, and how to combine sample code to build your own project ideas. So whether you are a software engineer, just dipping a toy into hardware or an movies, who just has basic knowledge and Arduino. This course will give you the skills to realize the internet of thing projects of your dreams. Explore cloud services to quickly and easily link your DIY circuits with other Internet of Things devices, social media upsides and a lot more intangible thing is now a trending topic. So I highly recommend that you join this course to get tunnel as Joni, to get started as an IoT freelancer or two, just to kick off your carrier and internet of things. Or you can't just do it to have fun while playing with your projects online. You can have o page to control your home after watching this course. And you will learn how to connect different items, even if it is a sensor and get the data from that sensor, plan online or beige, that shows you everything. I'm sure that you will enjoy this course. 2. 2 Hardware and Software Requirements: Hardware and software requirements. Now, the first thing that you need to have is ESP thirsty to board, which is basically the ball that we are going to use to connect our project or our sensors to the internet. It's basically a ball that deals and looks like an Arduino ball, but has a Wi-Fi capability and a lot more features that we are going to discuss, an accessibility section. You'll also need an Adafruit and alphabet accounts. And we are going to explain how to get three accounts on these two upsides. Because we are going to need them for our automation or web automation, you will need some basic literally components. So there is a store's buttons and I think at hand that you need to start with a new board. You'll need Arduino IDE, which is basically the Arduino programming environment. Since we are going to use it to Bagram or ESP. You will need sensors. If you have a motion detector sensor or any other type of sensor, you can use it and test it out with this board. And you need jumper wires to connect different elements to this ball. And all of these elements will be explained each and a separated lesson, depending on which type of electronic circuits that we are going to apply in this course. But our cash should you that everything can be done using just the ball without any additional elements. You'll need the bolt, the ASP Board, and the Arduino IDE programming environment. These are the two most important components regarding the hardware and the software. Thanks for watching this lesson. 3. 2a ESP 32 Pinout v1 DOIT: Hello and welcome to this new lesson. No2 are going to talk about ESP here to, to print out what's sharp purpose input, output pins should you use? Now, this is how the physical layer out over the ESP board locks. And as you can see, it's very similar to the Arduino Nano, but it has a WiFi built n. Now, they are speed thrilled to per-share honors include 18 analog-to-digital converter or ADC channel, where you can receive analog signals, and these signals can be converted to digital internally. It also has three SPI interfaces for serial communication and three uart Interfaces for CSR communication and to I2C interfaces for CL communication. So these, let's say eight modules or eight pins can be used to allow telecommunication with multiple devices that support SPI, I2C, all isaac mercy. And you were asked, It also has 16 PWM output channels, which help produce an analog output from the ESP pins. It also has to digital to analog converters and to i2 us interfaces also has thin combustive syncing, General Purpose Input, Output. I'll provide more data and more details about each of the spins in the resources lecture. But since we have a lot of them, we don't want to get caught in the details. Now, what we need to know is the pin out itself. As you can see, this is how the boat blocks. This is the USP board. And you're going to hook up your USB connector here. And the other side would be connected to your computer. You can see these are the pins. Gpio means general purpose input, output. Now, there is more than one general purpose input, output, as you can see here. And each of these spins has more than one function. As you can see, you usually pins, comes with My name's hs, PI and ADC, analog to digital converter and variables and without. So you can use it as input, output pin or to receive analog signal, or for us PI, or for our two c. So the choice is yours. Now, as you can see, these spins, all of them are numbered for easy access so that you can easily know which pin is connected to watch. Now additionally, there are pins with specific features that make them suitable or not for a specific project. The following demonstration shows you some of these spends and I'm going to talk about each of these spins in details. And if it can't be used as n, Both all output. Now, the pins highlighted in green. Here. I'll show you a table to summarize these information. Again, the pins highlighted in green are okay to use. The ones highlighted in yellow are okay to use. But you need to pay attention because they may have unexpected behavior mainly at boot time. While the pens highlighted in red are not recommended to use as input or output. Now, that general purpose input output pin number 0 is, as you can see, okay, to use, but you need to pay extra attention because it may have unexpected behavior at full-time. So it can't be used as pull up in both or as output. It outputs PWM signal at port number one can be used as TX pin for CSR communication, or output pin, it debug output, output. Pin number two is okay to be used as input or output. And usually it is connected to onboard led. So you can use it for a cold or to test our base function because you don't have to connect extra component. It already have built-in LED. Pin number three is okay to use as n both, but you can't use it as output, its high output. So it will read one at both. Burnham's bins. Number 45 are okay to use as input to output. And pin number five also outputs PWM signal. Output. Pins from six to 11 are connected to the integrated SPI flash. So you can't use them as input or output. Pin number 12 is okay to use. But food will fail if bold high. So it's okay to use as input, but you need to pay extra attention for this naught. And if you are connecting it as output, it's OK. You don't have any problems. Pins from 13 to 16 are okay to be used as input or output without paying extra attention. Now as you can see, same four pins from 17 to 33, while thirty four, thirty five, thirty six, and thirty nine are input only pens. You can't confuse them as output. Now on our examples on an hour practice tests, we are going to use print numbers two, which has built-in LED on bold built and lead. And using that onboard built and lids will make it easier for us to, to start or to try different things if we are making obeys with our button to control it via Internet. Now, that's it for the print out. Now, I will add x transformation as articles to this section of the course. So let you know more information about the general purpose input, output pins. But for me, what I need you to know at this point is that we have bins that can be used easily without Ani, a extra tension as input outputs, which are basically the spins to 45, 13 to 1617, to 33. And if we want input only bins, we can use thirty four, thirty five, thirty six or 39. Now, if we need extra features, if we need PWM, ADC, DAC, if we knew the combustor enabled Bryn or pwm pin, we can go on and check this schematic. And from these spins you can see that an odd case sharper will spin number 36 can be used as ADC or analog to digital converter. As you can see, and it has input only state. You can use. This schematic printed out two refers to it whenever you need to do something. Sam for here, you can't see from this image that pin number 25 can be used as digital to analog converter. And bin number 26 can also be used, used a digital to analog converter or analog-to-digital converter. So depending on what you need or what's your end goal, you are going to check this schematic and make sure that you choose the bend that fits your needs. So if you are going to use a PIN as output, you can't use pin number 34 because as you can see here, it's only input only pin. And if you want to use, let's say, analog-to-digital converter, you can't use this spin pin number 17 because it only supports serial communication and input output. Regular input output or digital input outputs. So before using any pen, take a minute or two to make sure that it supports what you are going to do. And since source or the stuff that you are going to connect it to the our analog or digital. There are input like push button or outward like lids. You need to connect the element to the right pin before sorry, according to avoid having problems in the future, once you start distinguished code, if you have unequal soon or if you have a project that you don't exactly know which bins might fit for that project, you can leave a question in the Q and a board. I'll be more than happy to help answer all of your concerns. 4. 3 Download and Install Arduino ESP and USB Driver: Now let's get started with a software setup. Hangs onto your keyboard and mouse. This part might get bumpy. Follow along clause the as we configure and upload our fares DIY Wi-Fi connected software. In this lesson, we'll install the ESP it too, 66 ball package inside our Arduino software. We will also install a device driver for the bolt communication chip and upload on Arduino sketch that connects to your home wireless network. And the good news that once you have completed the steps and this, and this lesson, you won't have to do them. Again. You are using the same computer and the same ball. You don't have to reconfigure. And any of the software that we are going to install this software all in this lesson. So the first step will be and installing the Arduino software. As you already know, the Arduino software is available for free on the Arduino, the SCC website. So the first step will be going to the Arduino, the CC, Go to the software section, click downloads. And from hinge, choose your operating system. And in our case, it's Windows operating system. We can use a Windows installer or the windows up. And I already installed on this Arab. Here it is. Now by default, the Arduino application supports chips used an off-the-shelf Arduino boards, but not the ESP ball. These balls can be programmed out of the box because the Arduino application already knows about each one and its properties. One cool thing about Arduino is that you can add support for other bolts. And all you have to do is to tell Arduino where to discover their probabilities. The first step of that process is providing a URL to the additional boards manager. Now, you have to go to the edit. And from there, you need to go to the File menu and select preferences. You'll get to see this window. As you can see here. We have additional bores manager, you are ALS and you have to based a specific URL. And that will do, I will give it and other sources of this lecture. But here it is. Let me copy and paste that URL. This is the Arduino ESP. You are fall this package. Now, if the books was not plan where you open their preferences, when do you may have some other boards already uninstall? If that's the case, I've been the textbooks content with the above URL using a comma to separate different URL. So you can add this one and other coma and add another one. But since we only have one, I will paste it here. After doing that, click OK to clays to close that preferences when do now are under an obligation, knows where to find info about the ESP ball in general. So let's go to the Tools. And from there, we'll go to the Boltzmann jar. And here in the Boltzmann Azure, you need to write ESP. Now as you can see here, we have ESP a2 66. What you need to do is simply click Install. It will take some time to download about 34 megabytes of data to your Arduino libraries folder. And once done, it will show you a message indicating that everything is done. Now once it's done, as you can see, it says installed here, you can click close. And if you went to the Boltzmann is R. So you can see that now we have ESP a2 66 and yes be a2, a5 and other ESP bombs. Most of them are here. Now, what you need to do is simply start using them. And I already mentioned that the one that we have at hand is the ESP further to the A2 66 module. Now, in order to make sure that it's recognized when connecting the USP board, you need to install an additional driver. From the Scilab upsized. I will give you links to this driver as well. So you need to go and check your opener thing system. And we have really two senior reversal. So we will use this software. Click Download the PCP. The download will start. You can't simply click download. After that. You can install the drivers depending on your operating system. That's it. Now, we have installed the Arduino software ESP library for Arduino and the USB driver. 5. 3 What is ESP32 Board: Asb 32 development board. Vsb 32 is a low-cost system on-chip series created by S press systems. It's an improvement on the popular ESP a2 66 that is widely used in Internet of Things projects. They SB 32 has both Wi-Fi and Bluetooth capabilities, which make it an all rounded chip for the development of Internet of Things Project and embedded systems engineer. Now, in this course, you will learn how to get start to the ESP fealty to and learn how to use it to scan Wi-Fi hotspots, control LEDS, buttons, sensors, or gets sensors reading on our page. Along with other examples. This course will equip you with the basic knowledge that you wouldn't need when working on your ESP Filter2 projects in the future. Now, some of the main specifications for the ESP 32. When it comes to the chip specifications, you will find that it has a dual-core, which means that it has two processors. It also has Wi-Fi and Bluetooth built in. You don't have to plug in any us be dongle to enable Wi-Fi or get a module. It runs 32-bit programs that look frequency can go up to 240 megahertz and it has 512 kilobytes of RAM. This particular board has 30 or 36 pins, 15 in each row. It also has wide variety of peripherals available, like capacitive touch sensors and digital converter. Digital to analog converter, universal asynchronous serial communication modules as p pi i square c and much more. This part comes with built in Hall effect sensor, built in temperature sensor. So this port is all what you need to get started and no time in the Internet of Things work. Now to start programming the sport, you'll need a software or a programming environment. You can simply use the Arduino IDE, which we are going to do in this course. It's a very easy to use software and most people are familiar with it. And if you, even if you are not familiar, it's the easiest software to use when you want to program ESP bonds. There is also a software, expressive IDF software. It's basically an Internet of Things development framework that they provide folder boards. There is also micro Python, JavaScript or lower. The one that we are going to use in this course is Arduino IDE. It requires some adjustments to solve ASP library, but everything will be explained in details. In assimilated section, where you will learn how to download and install the required libraries for different ESP boards and the right steps to do so. Now to prepare your board for the Arduino IDE. And there is an add-on for the Arduino IDE that allows you to program the ESP theta2 using that platform. That very same platform that you can use to program Arduino can also be used to program ESP using Arduino programming language. So it's out of the box and ready for you to use. In the next lesson, we are going to explain the ESP CO2. Pin out how many bends are there, how to recognize each bin function and which bins to use when you want to connect input, output, PWM, signal, or sensor. Thanks for watching this lesson. 6. 4 Download and Install Arduino ESP32 v1 Development enviroment: Now, if you have a board like the one that we have, which is ESP 32 version one. You need to go to the Tools. And from the tools menu, you can simply go to the board, select pods manager, and from the right ESP 32. Now, you didn't get any results. You will need to do one thing. Before moving on. You need to add the ESP 32 package, that JSON file link to the references Wendell soldiers go, click file, preferences, and here are the comma, then are the second link. I'll give you all of this length and let us also is lecture. Again, go to the Tools bald spot Manager, and here you'll Carmelite ESP. Third, the tool. And here it is, you can simply click install. To install this ball will take some time. Now once you are done, you will see you in a stalled here. Click close, and go to the Tools menu. From there, you can't kick the ball. That's you want to connect to. And you can see that we have a list of volts down here. You need to choose the one that matches your configuration. And our case, okay, sorry. Now our case two will be do it ESP, and we need to choose the ESP third tool. So let's scroll up. Okay, here we have ESP theta2 people kit or revoke that div module. And we have other ESP toe-to-toe modules. As you can see here. We need that, do it ESP div, get version one, which is the one that we have here on our labs. And we look on lended to everyone who's just getting started on Internet of Things. So select it and then go. If you didn't see your ball, I have it on my USB. Borscht. I have connected the bald, but I don't see a board here. And that case. You need to download and install this and USB to your yard bridge driver. Download done that matches your operating system. Actually drive this name when you are searching for it. If your board is ESP 32, depending on your bond, there is other drivers. So click Download. Again. Click download here, Tuan tech time, double-click. 7. 5 Load Your First Code to ESP32 Board: Now, if you have everything connected correctly and if you went to the device manager, I did hook up my board. So you should see your bolt and the components. And the name of C or Silicon Labs, which was that the life out of that readjusted assault in the previous lesson. Now we know that our balls connected to come for. Let's head back to our software. Make sure that you are choosing the right bold, do it ESP fealty to difficult version one, and go back again to select the ball, choose conform. Now, you can go to the examples and check some of the Wi-Fi examples. As you can see here, we have more than one. You can check the Wi-Fi scan example. Now this is all new sketch. As you can see, it's using the Wi-Fi library. You don't have to have annual knowledge. All previous experience to use this example, all what you need to do now is simply click Upload. Now it's combining the sketch and it's uploading that sketched our ESP Phelps O2 bond. It usually takes some time since Arduino isn't directive coding up for ESP wants, as you can see, it's connecting using conform to write that ESP quote. Now it's flouting the cold fall percent, a 100%. Now it's how they're sitting there ESP board. As you can see from this menu, shows us all of the tables. Again, the writing process takes some time. Now as you can see, done uploading. So go and open up the serial monitor and make sure that you have selected the right baud rate. As you can see now that yes be bald SO2 the Wi-Fi scan. And once it's done, it will show you that it works that are available in your area. I have these three networks. As you can see. One of them has a very weak signal. That's why it's coming and going. So this is minus 12 and this is someone's that work. Now we have three networks. So as you can see, we have just uploaded all value first quote to ESP thirds, so two bold. And this is a code example for Wi-Fi scan process. Next we are going to dig deeper and starts talking about how to test the lid on that board and how to control different elements using that pole. Then we will move on to the old based thing. 8. 6 Coding LED Blink: Hello and welcome to this new lesson. As usual, the first thing that we do when we start exploring a new hardware is to blink an LED or to write a programming sentence which is HelloWorld. And guess for hardware, which is ESP fealty to the example will be LED blinking. So let's go to the examples menu and the Arduino IDE and open up the sketch example or Planck example. Now, as you can see, we have a lot of examples here. You can go to the basics and click blink. Now let's close this window. Let's open up this one. Now. As you can see in this lesson on this code, let me zoom in. We have the LED set to default touches, lead number 13 on Arduino. So we need to change this lead number. As you know, they asked me, 32 has a built inlet that is connected to its general Bill was input output numbers too. It is important to check if lid, politician is automatically organized by IDE. If not, you must add to code a line like this, like end and liked lid. And let's copy it and paste it here. And now you have to write two to make sure that the code will be saved to pin number two, which is the internal lid pen inside the ESP bought. Now let's save our code. Let's leave them blank. And let's remove this. Now, as you can see, it's the very same code that we use an Arduino. We have two methods, the void setup method and the void loom food. And avoid setup method is basically where you sit up things like append. Here we have the number two, which is the id variable. And we can replace it with number two here. But since we are using a variable, we can write the variable name here. And here we can assign it as input or output. Since we are dealing with a lead, it's an outward. So we write output and we use pinMode function to make sure that we set the number two as output and the setup loop. Now, the loop function, from its name, it will keep repeating itself. The loop function lands over and over again for a var. Once you stop the program or turn off the power, it will stop running. Now the digitalWrite will write a digital value. High means one logic or turn on to this spin which has been numbers to that has internal lid. Then the last sentence will wait for a second and we will derive the same sentence digital write. We will write additional value, which is low or 0 or off. And we will wait for another second. So you will turn on the LED. Wait a second, turn it off and wait another second. Now before uploading this code, we need to go and make sure that we have the do it ESP 32 difficult version one selected. And we need to make sure that we have the right compost. After that, we can simply click Upload. It will take some time, ok. As you can see now we have an L because this is a system variable. We can't change it. Led to. Let's try it again. As you can see, now it's writing the code, done uploading. Now, if you have the board, you can see that there is a blue LED blinking on and off. That's it. This is how simply it is to turn on or off island. You can use another pen or connect an external lead if you have one. But that's it for this lesson. As you can see, it's the very same code that we use, an Arduino. So it's really simple. It's really easy to get started with this board. You don't have enough knowledge. Just basic knowledge encoding an and an Arduino. And if you don't have a basic knowledge, I already explained each line of code inside this sketch. If you have any questions about anything, please ask in the Hyundai board. Thanks for watching. 9. 7 Touch Sensor: Now that we are done with the LED blinking example, let's move on to the touch sensor example. This is a new cool feature That's available on the ISP Filter2 balls. They asked before, T2 has internal Alton, internal capacitive touch sensors. We already explained or short the spins. We already showed. We will explain these pens and the wiring layout of the MSP432 lesson. But let's talk about them again. Now. These thin internal capacitive touch sensors can be used as buttons. And the odd numbers from general purpose input output number 40 to 12131415. Twenty three, thirty two, thirty three, twenty seven. These are the pins. I will show you the bins number on a minute, okay? Okay. This is it. And you can refer to the wiring layout or the pin diagram lesson, where you can see the spins. These are ten internal capacitive touch sensors that you can easily use. In order to read these pins, what you need to do is use the function touch reads. And this function will take only one variable, which is basically this is the function. And it usually takes one variable which is the pin numbers, the Sibyl number four, number five, and so on. So in order to use this function first, we need to assign a variable. Now we can write int value and right touch read. Inside it. We can write any number. We can use general purpose input, output four, which basically the first touch sensors t. And now let's create a code where we read the state of this touch sensor and it's a bit on the serial monitor. To do this, first, you need to initialize the serial communication and the setup method, as you can see between these two curly parentheses. So, right cereal began. And use any baud rate, we can use a 115,200. And let's add some delay to help it stabilize. 1 second. Now, let's try the sun science. Let's write serial.print. Yes, be 32. Touch. Now we have to set the mood for the lid as output. We want to use the lid as an indicator for the touch state, all the touch sensor state. So we have print number two, which has the lead, and we need it as out. We also need to write a value and make sure that it equals 0. We want to make sure that the LED is off. To do so, we need to write append number and write law. Using this line, we are making sure that when the ESP board starts, it will make sure that that it is off. It will only turn on if there is touch. All of the touch sensors on. Okay, now, what we need to do next is read the value. Touch read using touch Street and solid inside the value. Now we want to ask a question. If the touch value is above or below a certain value, we can turn on or off the lid. But before we do that, we can't simply print the attached read all the value that we get from will fetch street sensor, which is the capacitive touch sensor on the serial monitor. So let's get, let's do this Serial dot print line. And inside it, we need to place the value. After that, we can add a delay, a 1 second delay. Now let's try combining our code. Let's store it inside our coding folder. Let's call it touch. Okay, let's remove this. Now let's combine it again. Okay, done compiling. Now let's upload the cone to our ESP boarded. By the way, you can use number four, which is the pin number, or you can use t, t1, t2 up to t ten, because we already mentioned that we have ten Dutch sensors. Now, let's open up the serial monitor. As you can see, that touch value here is 107. And if we did touch it, it will change. Let me do that. Okay. Now, as you can see, we have seventy four, thirty seven, seventy one seventy. Now let me touch that bin. As you can see, once I touch the m, the values go below ten. And when I leave it goes again up to 77 to two. So I think that we have a constant value here. If the value is below 50 means that I'm touching that bin. If it is above 50, means that I'm not touching the pen, we can adjust our Claude accordingly. Now let's do that. Now. Let's go here and add if statement. Now and f statement, we are going to ask a question. The value is above all equal 50. Ok, let's move this side, these two parentheses. Now. In that case we need to turn on the LED and add a delay. Else. If the value is below 50, we need to turn the LED off. Okay, now let's verify our quad o. And let's print a sentence and psi of these two if statements using the Serial.print. So here's where I'm going to print lid on. And here we are going to print lid off. Let's verify the code again. Okay, now let's upload a code to the ESP served. It will bald. Again. The process takes some time. Now it's connecting to the board. Now it's writing that code. Okay, done uploading. Now, if we open up the serial monitor, as you can see, the LED is on. And if you take a look to your board, you can see that the LED is on. Now, let me touch the touch pin. As you can see, the value goes below 50 and the lid is off. That's it. This is how easily you can use and adjust the touch sensor inside the ESP fell to toolbox. It's built in so you don't have to connect any extra components. This is how amazing it is and how easy it is to deal with this ball. If you have any questions regarding this, Ben, I'm here to help you. Thanks for watching this lesson. 10. 8 Dealing with Analog Signals: Hello and welcome to this annual US ONE, NO shall going to explain how to deal with analog input. Layers P fills the tube board. Now to this, the input analog value signals, there are about 18 12-bit ADC input channels. You can easily recognize them from the wiring diagram. The one that we already mentioned, all the pinout diagram that we explained in a previous lesson. And there's only one 10-bit analog to digital converter on the MCU. Now, depending on the ball that you are using, this pen, can be at a different location. Let me show you the pin out. Now as you can see in this image, you can see the ADC pins. So all of these are analog to digital converters are enabled bends, and there are other pens as well. Again, here's a, the C1 and C2. So different channels. And you can recognize them who is called the general purpose input output pin number starting from Penn. As you can see here. A pin two has ADC, pin for 10-15. Been one doesn't have ADC. So it's suffering from pin 0. Then you can move on. There's been 2412131415, and so on. We only need one pen for this lesson. So to read the analog and what you will use the same as an Arduino boards. We will use the analog read function on our coding. Now as you can see, the append that we are going to use for this example is John Bell was input, output 36. It has ADC one, CH2, 0, or Charles euro. Now to read this value, we need to use the analogRead function. And we installed the analog value on a variable. It's very important to note that they asked people to, to this or converse. I'll have 12 bits of resolution versus ten bits on ESP, a2, 66, and Arduino. So the thoughts are range of the analog to digital conversion of readings can go to fall 1000th, 0, 95, or 095. And the sin of 100000027 on Arduino and ESP a2 66, when a maximum of 3.3 volt is applied to its end. But so you can expect more values that can go up to 4 thousand. Now for input, let's use our thin kiloohm potentiometer or any analog sensor that we have. And we can't connect it from the 3.3 volt and ground. Now let's use its variable output to be the input of the ESP filter to ADC pins. To get started, let's open up. I'll be your software. Go on up Arduino IDE. Now, after opening up Arduino IDE, okay, let me open up the other software. Okay, here it is. Arduino software. Now the first step that we are going to do is create a new sketch. Let's make sure that our board is connected and recognized, as you can see at conform. And let's make sure that we have the right port selected. Our case ESP fell to two. As you can see, do it ESP theta2 dev kits. And we have other libraries that can cover this. Now this is our board. Let's start coding. The first thing that we need to do is go to the void setup and initialize the serial communication, serial.begin. And we can choose any moderate. Let's choose ten hundred, five hundred, five thousand, two hundred. Now, let's add a delay so that this cast supplies the Sierra communication module and lists print a sentence indicating that we are using USB 32 analog pen test. Now up here let's initialize a variable to save ALU data. So end analog, value equals 0. Then inside the void loop, right? Alg value equals unload reads just like an Arduino. And from here we need to select the pen. In our case, it's general purpose input, output then 36. After that, let's splint the analog read value, so Serial dot print. Now let's agree that we should value and this elderly 500 milliseconds. Okay, let's verify. Let us save. Let's call it. Will take some time to combine the sketch. Now let's upload the sketch to our ESP ball, makes sure that your board is connected. And you have selected the right bald pan, the right comport. Okay. As you can see, it's uploading, writing. Okay. Done uploading. Now, if we went and opened up here, serial monitor K, we have science shares the baud rate to 115,200. As you can see here, we have 0 value. Now if you played with the analog potentiometer, you will get values up to 4 thousand. And that's it. This is how easy it is to use analog pins on the USP bore. The same arduino coding, semi-structured. And I will discipline every line. Thanks for watching this lesson. If you have any questions, please ask in the Hyundai board.