9. Input Devices
Group assignment:¶
- probe an input device’s analog levels and digital signals
Camille and Dorian built a circuit to test the Step effect using a breadboard, an LED, a resistor, a ESP 32C6, and two unmilled pcb boards that acted like capacitor plates since they are made from 2 copper plates surrounding an insulating material. The plates were connected by alligator clips. While Camille and Dorian were building the board, Kim worked on writing a set of code, with the help of Claude, to light up the LED when the two copper plates are touched. This code is meant to make the copper plates into a pressure sensor, so when the plates are touched it will also recognize how much pressure is on the plate.
As a group we tested the first code from Claude with our setup. During our first set of tests we noticed that the LED light was turning on when one of the plates was touched. The other plate was not responding at all. We could see a jump in the serial monitor to about 4000 when the single plate was touched.
Angela and Kim worked on trouble shooting the code while Camille swapped out the wires connecting the board to the non responsive copper plate. Dorian suggested we insulate the copper plates better and we grabbed some cardboard to place under and above the plates. We retested with the new wires first and had the same issues. We tweaked the code a bit and had a strange output of the LED being on the whole time and turning off when touched, (the opposite of what we were trying for).
Finally we swapped in a new code which was provided by Adrian and tested again. We updated the pin locations and the baud rate and our new test was more successful.
Angela and Camille were each touching one plate and Angela realized that in order to complete the circuit correctly Angela and Camille had to touch, or hold hands. Chamille and Angela shook hands and and we had a successful plate response!
We realized that the alligator clips touched both copper plates on our pcb boards so we added a piece of cardboard to insulate the back side from the clip. The sensors then read the step effect very well. Showing noticeable variations when different pressures were applied After confirming it was working as expected on the breadboard, we used the board designed by Dorian and connected everything onto the board. With the board all set up we did a quick test to ensure it was still working as expected. Angela and Kim took some photos and Camille and Dorian set up the Discover 2 sensor.
On the sensor we were able to see the wave length of the voltage grow and shrink as we touched the plate. With a lighter touch, the wave length grew slowly and with a hard touch the wave length shot up quickly.

Kim noted that on the serial monitor the value for a light touch was around 10000 and as pressure was applied it would grow by 10000. With a heavy touch it was between 40000 to 60000.
—–Claude Explanation of the values we read on the serial monitor—–
Those numbers are the mapped output of the tx_rx() function — they represent how strongly your two copper plates are capacitively coupled at that moment.
What the number actually means¶
The raw tx_rx() reading is a big number (somewhere around 17,000–23,000). The map() squishes that down to a 0–1024 scale so it’s easier to read. So when you see:
- Low number → weak coupling between the plates → plates are far apart, nothing between them
- High number → strong coupling → plates are close, or you’re touching one
When you touch a plate¶
Your body adds capacitance to the circuit. More capacitance means more charge transfers during each HIGH/LOW step in the tx_rx() function → bigger diff each sample → bigger sum after 100 samples → the mapped number goes up or down depending on which plate you touch and how the circuit is wired.
Why it fluctuates even without touching¶
Even at rest the number isn’t perfectly stable — you’ll see it drift a few counts. That’s because:
- Electrical noise in the environment (nearby devices, fluorescent lights, your body acting as an antenna)
- Air movement slightly changing the capacitance between the plates
- ADC noise in the microcontroller itself
The code averages 100 samples specifically to reduce this scatter — without that averaging it would jump around much more wildly.
The practical use¶
Once you know your baseline range (say it sits around 500 at rest), you can set a threshold — if the number goes above 700, something touched the plate. That’s exactly how capacitive touch buttons, sliders, and proximity sensors work in real products.