The SparkFun Capacitive Touch Slider - CAP1203 (Qwiic) is an innovative breakout board featuring the CAP1203, a multiple channel capacitive touch sensor. This component offers a versatile touch interface with three individual touch pads that can also act as a single slider for swipe gestures, as well as three proximity sensors for non-contact detection. It is designed for seamless integration into interactive projects and can be used in applications such as touch interfaces, control panels, and lighting controls. The inclusion of Qwiic connectors simplifies the process of chaining devices and modules in a Qwiic-enabled ecosystem, allowing for rapid prototyping without soldering.
Pin Name | Description |
---|---|
GND | Ground connection |
VCC | Power supply (2.7V - 5.5V) |
SDA | I2C Data Line |
SCL | I2C Clock Line |
RST | Reset pin (active low) |
INT | Interrupt output (active low) |
#include <Wire.h>
// CAP1203 I2C address
#define CAP1203_ADDR 0x28
// CAP1203 Register Addresses
#define MAIN_CONTROL_REG 0x00
#define SENSOR_INPUT_STATUS_REG 0x03
void setup() {
Wire.begin(); // Join I2C bus
Serial.begin(9600); // Start serial communication at 9600 baud
}
void loop() {
Wire.beginTransmission(CAP1203_ADDR);
Wire.write(SENSOR_INPUT_STATUS_REG); // Point to the Sensor Input Status Register
Wire.endTransmission(false);
Wire.requestFrom(CAP1203_ADDR, 1); // Request 1 byte from the CAP1203
if(Wire.available()) {
byte status = Wire.read(); // Read touch status
Serial.print("Touch Status: ");
Serial.println(status, BIN); // Print the status in binary format
}
delay(100); // Wait for 100 ms
}
This example initializes the I2C communication and continuously polls the CAP1203 for touch status, which is then printed to the serial monitor in binary format.
Q: Can I use the CAP1203 with a 3.3V system? A: Yes, the CAP1203 operates within a 2.7V - 5.5V range, making it compatible with both 3.3V and 5V systems.
Q: How do I change the I2C address of the CAP1203? A: The I2C address of the CAP1203 is fixed and cannot be changed.
Q: Can the CAP1203 detect touch through materials? A: Yes, the CAP1203 can detect touch through non-conductive materials like plastic or glass, depending on the thickness and the sensitivity settings.
Q: How do I use the proximity sensing feature? A: Proximity sensing can be enabled and configured through the CAP1203's registers. It uses the same touch pads to detect the presence of an object without direct contact.
Q: What is the purpose of the Qwiic connector? A: The Qwiic connector is a standard I2C connector that allows for easy daisy-chaining of I2C devices without the need for soldering, simplifying prototyping and design.