I connected a TTP223 touch sensor to my RP2040 board and recorded a touch/LED test. My power and signal wiring are shown below. The original sketch uses TouchSensorLib.h; I have not found that library source or its version in the archive, so reproducing this sketch still depends on recovering it.
I need to add the library source or its exact installation reference, explain any issues I actually encountered, and record the observed touched/untouched signal levels. My board design and fabrication are in Week 6 and Week 8.
As a group we probed an input device with a multimeter and an oscilloscope. With the multimeter we read the voltage levels, and with the oscilloscope we watched the signal change in real time, so we could see the difference between a continuous analog level and a digital on and off signal. The results are on our group page: group assignment page.
measure something add a sensor to a microcontroller board that you have designed and read it
This week on input devices explored the capacitive touch sensor, focusing on understanding its working principle and using it to detect physical contact as an input signa
is an electronic device that detects physical contact or proximity from a human finger and sends an electrical signal to a microcontroller
a capacitive touch sensor acts like an invisible button that detects your finger using electricity instead of force
VCC Connect to 3.3V
GND Connect to GND
SIG Connect to a digital pin D9 on Xiao RP 2040
I start, solder the TTP223 touch sensor by connecting VCC to 3V3, GND to GND, and out sig to a GPIO pin D9 on the XIAO RP2040 to provide power and send the touch signal to the board
I connected the touch sensor to the XIAO RP2040 by soldering the power, ground, and signal wires
After connecting, I used a multimeter to check that power was flowing through the sensor
I wrote the Arduino code so that when I hold the sensor, the LED turns on.the LED that was already installed in the circuit during the electronic production week
The sensor supplies a digital signal to D9. In my original sketch, touch.update() refreshes the library state and touch.isTouched() selects whether D1 is high or low. This is touch detection, not an analog measurement of capacitance. I must recover the library before claiming the downloaded sketch can be rebuilt from this archive alone.
#include <TouchSensorLib.h>
TouchSensor touch(D9);
int ledPin = D1;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
touch.update();
if (touch.isTouched()) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
after, I opened Arduino to write the code
Then I clicked the upload to send the code to the board
After that, I tested it by touching the sensor to check if it was working correctly