

The Trill Touch Sensor is a capacitive touch sensor designed to detect touch and proximity. It is widely used in interactive projects to provide intuitive input through touch gestures. The sensor is highly versatile and can be used in applications such as musical instruments, interactive art installations, and user interfaces for embedded systems. Its ability to detect multiple touch points and proximity makes it a powerful tool for creating responsive and engaging user experiences.








The Trill Touch Sensor typically has the following pinout:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V recommended) |
| GND | Ground connection |
| SDA | I²C data line for communication with the microcontroller |
| SCL | I²C clock line for communication with the microcontroller |
| ADDR | Address selection pin (used to set the I²C address via solder jumper) |
| INT | Interrupt pin (optional, used for event-driven applications) |
VCC pin to a 3.3V power source and the GND pin to ground.SDA and SCL pins to the corresponding I²C pins on your microcontroller. For Arduino UNO, use A4 for SDA and A5 for SCL.ADDR pin.INT pin to a digital input pin on your microcontroller.SDA and SCL lines if not already included in your setup.Below is an example of how to use the Trill Touch Sensor with an Arduino UNO:
#include <Wire.h>
#include <Adafruit_Trill.h> // Include the Trill library
Adafruit_Trill trill; // Create a Trill object
void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
Wire.begin(); // Initialize I²C communication
// Initialize the Trill sensor
if (!trill.begin()) {
Serial.println("Failed to initialize Trill sensor!");
while (1); // Halt execution if initialization fails
}
Serial.println("Trill sensor initialized successfully.");
}
void loop() {
// Read touch data from the Trill sensor
if (trill.read()) {
Serial.println("Failed to read from Trill sensor!");
return; // Skip the rest of the loop if read fails
}
// Print touch position and size if a touch is detected
if (trill.numTouches() > 0) {
for (int i = 0; i < trill.numTouches(); i++) {
Serial.print("Touch ");
Serial.print(i);
Serial.print(": Position = ");
Serial.print(trill.touchLocation(i));
Serial.print(", Size = ");
Serial.println(trill.touchSize(i));
}
} else {
Serial.println("No touch detected.");
}
delay(50); // Add a small delay to avoid flooding the serial monitor
}
Sensor Not Responding:
Inconsistent Touch Detection:
No Data on Serial Monitor:
Serial.begin() value in the code.Can I use multiple Trill sensors in one project? Yes, you can use multiple sensors by configuring unique I²C addresses for each sensor.
Is the Trill sensor compatible with Raspberry Pi? Yes, the Trill sensor can be used with Raspberry Pi via the I²C interface.
How do I clean the sensor surface? Use a soft, lint-free cloth slightly dampened with water or isopropyl alcohol. Avoid abrasive materials.
By following this documentation, you can effectively integrate the Trill Touch Sensor into your projects and troubleshoot common issues with ease.