Main Content

As I was finalizing design decisions for an upcoming ESP32 WiFi Kit 32 based project requiring three button input, one noticeable problem was that the WiFi Kit 32 does not possess a single mechanical pushbutton, yet alone three mechanical buttons, for input. However, the WiFi Kit 32 does have plenty of capacitive touch inputs, so I spent some time assembling hardware, writing software and testing a three button input design utilizing the ESP32 capacitive touch input feature and three 3/8” “metallic hole plugs” for buttons.

As anyone who has experimented with the ESP32 capacitive touch inputs has discovered, the touch inputs are most certainly noisy enough to require filtering for reliable input detection. To minimize the total parts count for the upcoming project, I determined that a simple interrupt driven digital filter (more of a “debounce” than a filter, but I digress), as opposed to adding external filter hardware, could quiet down the noisy inputs. And after testing, it became apparent that the ESP32 capacitive inputs, three 3/8” metallic hole plugs, and some digital “filtering” software, would indeed provide a reliable three button input for the design.

So if you are interested in testing capacitive input with digital filtering on an ESP32, I’ve included the source code “Buttons.ino” in the Arduino environment format along with assembly and programming instructions, plus a brief description of the source code, for what I discovered to be a highly reliable three button input.

And as usual, I probably forgot a file or two or who knows what else, so if you have any questions, please do not hesitate to ask as I do make plenty of mistakes.

And one final note, I receive no compensation in any form, including but not limited to free samples, for any of the components used in this design”

Link to article

Related Content