Third party cookies may be stored when visiting this site. Please see the cookie information.

PenguinTutor YouTube Channel

ESP32 Capacitive Touch Controlling a Raspberry Pi over wi-fi

Control Raspberry Pi Pixel-Server with ESP32 wireless and capacitive touch

This uses an ESP32 microcontroller to provide wireless control for a Raspberry Pi computer. This is designed to be used in conjunction with Raspberry Pi Pixel server controlling NeoPixels / RGB LEDs with web interface

Capactitive Touch Sensor

This uses a capacitive touch sensor connected to the ESP32. When a touch is detected then it performs a web request against my pixel-server running on a Raspberry Pi zero. This causes the NeoPixel / RGB LEDs to turn on and off accordingly.

The additional hardware required is a Velleman VMA305 capacitive touch sensor, although you could use a different sensor based around the TTP223, specifically the TTP223-BA6. An alternative to using a dedicated capacitive touch sensor is to use the touch pins on the ESP32. I found that the large pad on the VMA305 made it good pad for sensing a finger which didn't need physical contact. Whereas the ESP32 touch pins would need a good pad for detecting touch.

Video Explanation and demonstration

Programming the ESP32 using Arduino IDE and C++

The ESP32 is programmed in C++ using the Arduino IDE.

ESP32 with capacitive touch sensor for wireless control of Raspberry Pi

ESP 32 Pixel Server Capacitive Touch Toggle Source Code

Download the source code below. Note you will need to chang ethe serverName variable to reflect the IP address of your own server. You will also need ot create an arduino_secrets.h file with details of your local wireless LAN.

  • Download ESP32 Pixel-server toggle source code
  • Related Projects

    Future projects

    I'm always working on new projects
    To find out about the updates please:
    Subscribe to the PenguinTutor YouTube Channel
    Follow @penguintutor on Twitter

    Previous Pico LED Reaction Game
    Pico LED Reaction Game
    Next Arduino RP2040 PixelStrip
    Arduino RP2040 PixelStrip