The Adafruit AT42QT1012 Standalone Toggle Capacitive Touch Sensor Breakout is a compact, single-key touch sensor module using Atmel's patented QTouch technology. This sensor is designed to detect touch inputs on a conductive surface, toggling its output each time it is activated. It's an ideal choice for adding touch-based interaction to various electronics projects, including home automation systems, user interfaces, and custom keyboards.
Pin Number | Name | Description |
---|---|---|
1 | OUT | Digital output pin; toggles state with each touch event |
2 | VDD | Power supply input; 1.8V to 5.5V |
3 | GND | Ground connection |
4 | SNSK | Connection to one side of the external capacitive load |
5 | SNS | Connection to the sensor pad and the other side of the external capacitive load |
// Define the touch sensor output pin
const int touchPin = 2; // Connect the OUT pin of the sensor to digital pin 2
void setup() {
pinMode(touchPin, INPUT); // Initialize the touchPin as an input
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
// Read the state of the touch sensor
int touchState = digitalRead(touchPin);
// Check if the sensor is touched
if (touchState == LOW) {
// If the sensor is touched, print a message to the serial monitor
Serial.println("Sensor touched!");
} else {
// If the sensor is not touched, print a different message
Serial.println("Sensor not touched.");
}
// Wait for a short period before reading again
delay(100);
}
Q: Can I use the AT42QT1012 with a battery? A: Yes, as long as the battery voltage is within the 1.8V to 5.5V range.
Q: How can I adjust the sensitivity of the sensor? A: Sensitivity can be adjusted by changing the value of the capacitor connected between the SNSK and SNS pins. A larger capacitor increases sensitivity, while a smaller capacitor decreases it.
Q: Is it possible to use the AT42QT1012 with a microcontroller other than Arduino? A: Absolutely. The AT42QT1012 can be used with any microcontroller that has a digital input pin. Adjust the code accordingly for the specific microcontroller's syntax and pin configuration.