Touch sensor - Using an CAP1188
What is the CAP1188?
The CAP1188 is an easy-to-use 8-channel capacitive touch sensor breakout board. This chip can handle up to 8 individual touch pads, it will light up the 8 onboard LEDs when the matching touch sensor fires to help you debug your sensor setup.
The CAP1188 has support for both I2C and SPI, so it easy to use with any microcontroller. If you are using I2C, you can select one of 5 addresses, for a total of 40 capacitive touch pads on one I2C 2-wire bus. Using this chip is a lot easier than doing the capacitive sensing with analog inputs: it handles all the filtering for you and can be configured for more/less sensitivity.
Other Capacitive Touch Sensing Method
Touch sensor - Using an MPR121 Touch sensor - with No Sensor!
Library
We will be using the library Adafruit CAP1188
.
We have a tutorial on how to install a library here.
Wiring
Wiring is pretty simple, it's an I2C component so it's relatively standard.
- VIN -> 5V
- GND -> GND
- SCL -> SCL / A5
- SDA -> SDA / A4
Older Arduino boards
Some older Arduino boards do not have SDA and SCL pins as shown in the diagrams, in this case you'll need to look it up on the boards documentation, however most Arduino boards used A4 as SDA and A5 as SCL.
Getting started
After installing the library and wiring the board, go ahead and use the examples in the File
> Examples
> Adafruit CAP1188
> cap1188test
.