Capacitive sensors are a very popular method of controlling various devices. Besides the aforementioned benefits, having a touch-sensitive button on a device allows for a compact design, opens possibilities for various kinds of human-machine interface and - it looks good and modern. CAP Wheel 2 click can find its place among many applications - for touch-activated lighting controls, process control, touch-activated control panels, toys and any other applications that need a switch or an encoder.
How does it work?
Although it looks simple at first glance, capacitive touch sensing is not an easy task. Many parameters need to be sampled, filtered, compared and processed before positive touch detection and its position are confirmed. To make this possible, Cap Wheel 2 click utilizes the IQS263B, ProxSense® IC, a 3-channel projected (or self) capacitive proximity and touch controller from Azoteq. This IC has some advanced features such as the auto drift compensation, up to 80Hz report rate, long proximity range, automatic adjustment for optimal performance (ATI), configurable 8-bit 2/3 channel slider or 3 channel scroll wheel. These features enable CAP Wheel 2 click exhibit very reliable and accurate touch detection.
Capacitive touch sensing is based on detecting a change in capacitance, due to the influence of a foreign object. The capacitance of the sensor, also known as the antenna, is measured and monitored and if a significant change occurs, after processing by the detection integrator, a touch event is acknowledged. To maximize performance, many routing requirements need to be met in the sensing electrodes design. The relation between the sensing elements in position and size is crucial. CAP Wheel 2 click is designed with these requirements in mind and electrodes are „Self-Capacitive Wheel“ shaped.
The IQS263B IC interfaces to a master controller via a 3-wire (SDA, SCL, and RDY) serial interface bus that is I2C™ compatible, with a maximum communication speed of 400kbit/s. The host MCU can force a communication at any time, by pulling the RDY line low. The communication will start directly following the current conversion cycle. If the event is terminated by the watchdog timer, the device will reset.
After every power-on cycle, the device will recalibrate itself. It will take some time, so it should be taken into consideration when building custom applications. MikroElektronika provides libraries and the demo application, that can be used as a reference for any future designs.
As mentioned before, this Click board™ is I2C compatible and uses SCL, SDA and RDY pins for communication which are routed to SCL, SDA and INT pin on mikroBUS™ respectively.
Specifications
Type |
Capacitive |
Applications |
It can be used for touch activated lighting controls, process control, touch activated control panels, toys and any other applications that need a switch or an encoder. |
On-board modules |
IQS263B, ProxSense® IC, a 3-channel projected (or self) capacitive proximity and touch controller from Azoteq. |
Key Features |
Auto drift compensation, Long proximity range, Automatic adjustment for optimal performance (ATI), 2 Configurable 11-bit sliders/scroll wheels and more. |
Interface |
I2C |
Click board size |
L (57.15 x 25.4 mm) |
Input Voltage |
3.3V |
Pinout diagram
This table shows how the pinout on Cap Wheel 2 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
|
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
RDY |
Ready Output |
|
NC |
3 |
CS |
RX |
14 |
NC |
|
|
NC |
4 |
SCK |
TX |
13 |
NC |
|
|
NC |
5 |
MISO |
SCL |
12 |
SCL |
I2C Clock |
|
NC |
6 |
MOSI |
SDA |
11 |
SDA |
I2C Data |
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
NC |
|
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
Power LED Indicator |
Software Support
We provide a library for the CAP Wheel 2 click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library contains function for waiting RDY(INT) pin Library contains function for getting RDY(INT) pin state Library contains function for I2C read and write with waiting for RDY(INT) pin Library contains function for I2C read and write without waiting for RDY(INT) pin Library contains function for setting basic device configuration
Key functions:
uint8_t capwheel2_i2c_write_wait( uint8_t register_address, uint8_t * register_values, uint8_t n_bytes )
- waits for RDY pin to go from HIGH to LOW in order to set register contents.
uint8_t capwheel2_i2c_read_wait( uint8_t register_address, uint8_t * read_buffer, uint8_t n_bytes )
- waits for RDY pin to go from HIGH to LOW in order to get register contents.
uint8_t capwheel2_config(void)
- checks device information and sets basic device configuration, thresholds and sensitivity values.
Examples description
The application is composed of three sections :
- System Initialization - systemInit( ) - Initializes I2C, LOG and INT pin
- Application Initialization - applicationInit( ) - Initializes I2C driver and CAP Wheel 2 device
- Application Task - applicationTask( ) - Executes one of three 'capwheel2_get_xxx_task( )' functions
Additional Functions :
- capwheel2_error( ) - Logs error message and blocks code execution in endless while loop
- capwheel2_get_channels_task( ) - Logs active channels in touch and halt bytes ( channels: CH0 - proximity channel, CH1, CH2, CH3 )
- capwheel2_get_gesture_task( ) - Logs active gestures ( gestures: tap, touch, proximity )
- capwheel2_get_channel_counts_task( ) - Logs channel count values for each channel
- capwheel2_get_channels_touch( ) - Logs touch byte active channels ( exectuted by 'capwheel2_get_channels_task( )' function )
- capwheel2_get_channels_halt( ) - Logs halt byte active channels ( exectuted by 'capwheel2_get_channels_task( )' function )
- capwheel2_error( ) - Logs error message and blocks code execution in endless while loop
- capwheel2_get_channels_task( ) - Logs active channels in touch and halt bytes ( channels: CH0 - proximity channel, CH1, CH2, CH3 )
- capwheel2_get_gesture_task( ) - Logs active gestures ( gestures: tap, touch, proximity )
- capwheel2_get_channel_counts_task( ) - Logs channel count values for each channel
- capwheel2_get_channels_touch( ) - Logs touch byte active channels ( exectuted by 'capwheel2_get_channels_task( )' function )
- capwheel2_get_channels_halt( ) - Logs halt byte active channels ( exectuted by 'capwheel2_get_channels_task( )' function )
void applicationTask( )
{
capwheel2_get_channels_task( );
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.
Resources
Downloads