The touch sensor was part of my Electronic Skill Builder. The goal of this skillbuilder was to learn an electronic component not covered in class. The component I chose was a Touch Sensor, which detects changes via touch by sending signals "high" or "low" to the GPIO pins, with the overall goal of being able to teach the component, its code, and wiring to others. I chose the Touch Sensor not only for its simplicity, but also for a broader understanding of digital input and its real-world applications.
The photos shown to the right and left the code and the pseudocode that went with it. Such was essential for activating the touch sensor and improving my coding skills.
Throughout the process, I learned, through trial and error, how to collaborate between the code (written in Thonny) and the Raspberry Pi Pico Kit. At the beginning of the process, I had to improvise the code using prior in-class coding experience and notes, but it did not work. However, it wasn't until I visited FYELIC that I understood why my code wasn't working and the simple improvements I needed to make to get it working. In addition to the code, wiring the component introduced me to the LED light on the breadboard, which indicated whether the circuit was correct. Such was a rather quicker process due to my understanding of the breadboard from high school classes. Overall, the hands-on learning reinforced my knowledge, and I now feel equipped to both use the sensor in future projects and teach others how to integrate it into their designs,and was able to learn patience and work-ethic. All in all, I believe that the Touch sensor is an essential piece to learn in the Raspberry Pi Pico Kit because of how often it used in the real-world such as phones, touch lamps, and ipads.
To use a touch sensor with a Raspberry Pi Pico in Thonny, begin by opening Thonny and selecting the MicroPython (Raspberry Pi Pico) interpreter. Import the required modules, "Pin" and "time", which allow the Pico to read GPIO input and control timing. Connect the touch sensor by wiring GND on the sensor to a GND pin on the Pico, VCC to the Pico’s 3V3(OUT) pin, and the sensor’s OUT/SIG pin to a GPIO pin such as GP15. In Thonny, write a program that sets this GPIO number as an input pin and uses a while True loop so the Pico continuously checks whether the sensor is being touched. Inside the loop, use touch.value() to read either 0 or 1 and print “Touched!” or “Not touched” based on the signal. This allows the Pico to constantly monitor the sensor, and you can view the results live in the Thonny console as you touch and release the sensor.