ESP32 Capacitive Touch Sensor Pins with Arduino IDE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video you're going to learn about the ESP 32 touch sensor the ESP 32 has 10 capacitive sensing GPIO s these GPIO s can sense variations in anything that holds an electrical charge like the human skin so they can detect variations induced when touching the GPIO s with a finger these pins can be easily integrated into capacitive pads and replace mechanical buttons take a look at your board pin out to locate the 10 different touch sensors you can see that touch sensor 0 corresponds to GPIO 4 touch sensor 2 to GPIO 2 and so on note that touch sensor one is GPIO 0 however it's not available as a pin in this particular part reading the touch sensor is straightforward in the arduino ide you use the touch read function that accepts as an argument the pin you want to read let's see how this works by using an example from the library in the arduino IV go to file examples ESP 32 touch and open the touch read sketch this example reads the touch pin 0 and displays the results in the serial monitor the touch pin 0 corresponds to GPIO far as we've seen previously in the pin out in this code in the setup you start by initializing the serial monitor to display the sensor readings in the loop is where you read the sensor as you can see it uses the touch read function and you pass as an argument the pin you want to read in this case the example uses T 0 which is touch sensor 0 in GPIO for now a protocol to your ESP 32 board make sure you have the right board and compart selected connect the jumper wire to GPIO 4 you will touch the metal part of this wire so that it senses the touch from the serial monitor at the baud rate of 11 5200 you'll see the new values being displayed every second touch the wire connect to GPIO far and you'll see the valid creasing you can also use the serial plotter to better see the values close the serial monitor go to tools serial plotter here you can view the readings displayed in a plot how can use this feature to control outputs let's build a simple touch controlled LED circuit grab a piece of aluminium foil cut a small square and wrap it around the wire with the same code running go back to the serial monitor now touch the aluminium foil and you'll see the values creasing again in my case when I'm not touching the pin the normal value is above 70 and when I touch the aluminum foil it drops to some value below 10 so we can set a threshold value and when the reading goes below that value an LED lights up had an LED our circuit by following this schematic the LEDs should be connect to GPIO 16 copy the code provided to your Arduino IDE this code reads the touch value from the pin we've defined and lights up an LED when the value is below the threshold this means when you place your finger in the aluminium pad a plot is sketched your ESP 32 now test your circuit touch the aluminum foil and see the LED lighting up as you can see it works as expected to recap in this video you've learned that the ESP 32 has 10 capacitive sensing GPIO s when you touch the GPIO the value read by the sensor drops finally you've also learned that you can set the threshold value to make something happen when it's text touch I hope you liked this project if you want to learn more about the ESP 32 take a look at my course learn the SP 32 with arduino ide this is a practical course where you'll learn how to take the most out of the ESP 32 using the arduino ID there's a link below this video to register in the course thanks for watching and don't forget to subscribe
Info
Channel: Rui Santos
Views: 77,219
Rating: undefined out of 5
Keywords: rui santos, randomnerdtutorials, random nerd tutorials, ESP32 Touch Pins with Arduino IDE, ESP32 Touch sensitive GPIOs Arduino IDE, Read ESP32 Touch Pins GPIOs, ESP32 TouchRead Arduino IDE function, ESP32 Touch sensitive pins read value Arduino IDE, TouchRead Arduino IDE ESP32, ESP32 Capacitive Touch Sensor Pins with Arduino IDE
Id: 40tyJfvpcxw
Channel Id: undefined
Length: 4min 47sec (287 seconds)
Published: Sat Jun 01 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.