ESP32 Touch Controlled LED Using Arduino IDE
by NikhilL7 in Circuits > Arduino
12497 Views, 31 Favorites, 0 Comments
ESP32 Touch Controlled LED Using Arduino IDE
This tutorial uses built-in touch sensors on the ESP32 Dev Module to control an LED.
Getting the Dependencies.
There are multiple ways to program the ESP32. We will be using the Arduino library. You can download it from the following link:
https://github.com/espressif/arduino-esp32
Clone or extract the libraries in your C:\Users\Documents\Arduino folder.If you do not have Arduino IDE installed already, here is the link to that:
Configure the IDE
After completing the previous step, start the IDE and go to Tools>Board menu. Then select ESP32 Dev Module. The default settings should be good for flash speed, upload speed etc. Select the COM port which is connected to the ESP32.
Connecting the LED
Next, connect pin GPIO4 (T0) to a wire, this will be the touch sensor input. Connect pin GPIO18 to the + rail of the breadboard and pin GND to - rail of the breadboard. Place a LED with the long wire in the + rail and short wire in the - rail on the breadboard.
Download the Code
Download the code from the following link:
https://github.com/Serpent999/ESP32_Touch_LED
Compile and Upload the code to the ESP32. The LED would change intensity according to your touch.
Note: When uploading you may sometimes encounter errors. Press and hold the boot button on the board, while uploading to resolve the error.