How does it work?
HOD CAP Click is based on the AS8579, a capacitive sensor from ams OSRAM. The AS8579 is a sensor that detects the change of capacity in different applications, as it measures the relative change of the impedance, which can be used for human being detection besides other usages. The sensors’ primary function is the transceiver Analog Front-End (AFE) architecture. The AFE function senses the impedance of the output load by using transmitter and receiver blocks. The transmitter block supplies a sine wave across the load, which the receiver blocks capture. The current change is sensed, and the response is converted to a voltage and then demodulated into in-phase (I) and quadrature (Q) components. These I and Q components are later filtered and converted by a 10-bit ADC to digital words.
The HOD CAP Click comes with a 10-pin header for sense outputs labeled SEN0-9. Five of the ten output pins (SEN5-9) are additionally filtered by the SEN Line Filter circuits. You can set the on-chip ADC in a Single or Continuous Conversion depending on the task. The first causes ADC to wait for the system settling time before starting sampling, while the latter causes the ADC to take successive sample accumulations. Using the CLK SEL jumper, you can provide the system clock with a frequency in two ways. The selected option INT uses the internal PWM duty cycle of the host MCU to provide a desired frequency, which can be in the range of 3 up to 50MHz. The other option uses onboard 48MHz crystal.
In addition, the AS8579 comes with parasitic capacitance protection. A header consisting of VAR SEN, FIX SEN, and GND pins can be used for that purpose. The VAR SEN is a cable shielding driver and should be connected to a cable shielding to avoid parasitic capacitance influence from shielding. The FIX SEN should be connected to a PCB shield layer to avoid parasitic capacitance influences from the PCB shield layer. Otherwise, both should be connected to the GND. For the factory testing option, you can short the R5. The HOD CAP Click uses the standard 4-Wire SPI serial interface to communicate with the host MCU with a clock frequency of up to 8MHz.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VIO SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Capacitive
Applications
Can be used for the development of autonomous driving applications such as hands-on steering wheel detection and detection of any human presence inside a vehicle or outside of the vehicle, e.g., for automatic trunk opener and more
On-board modules
AS8579 – capacitive sensor from ams OSRAM
Key Features
Accurate capacitive measurements, higher durability, and lower system costs, an enabler for safety-critical applications, suitable for automotive applications, 10 sense outputs from which five come with line sense filters, the possibility to set a system CLK frequency, and more
Interface
SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on HOD CAP Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VIO SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | CLK SEL | Left | Clock Source Selection INT/MB: Left position INT, Right position MB |
R5 | – | Unpopulated | Factory Test Pin |
HOD CAP Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 5 | – | V |
System Clock Frequency | 3 | – | 50 | MHz |
Sensing Capacity Range | 20 | – | 2000 | pF |
Output Capacitance of SEN Line | – | – | 8 | pF |
Software Support
We provide a library for the HOD CAP Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for HOD CAP Click driver.
Key functions
-
hodcap_get_i_q_data
HOD CAP gets the I and Q data function. -
hodcap_mux_channel_selection
HOD CAP MUX channel selection function. -
hodcap_wait_adc_data_ready
HOD CAP wait ADC data ready function.
Example Description
This library contains API for the HOD CAP Click driver. The demo application sets the sensor configuration and detects the changes in capacity by measuring the relative change of the impedance for each channel.
void application_task ( void )
{
static uint16_t i_data, q_data;
log_printf( &logger, " tI/Q data rn" );
for ( uint8_t sen_num = 0; sen_num < HODCAP_TOTAL_NUMBER_OF_CHANNELS; sen_num++ )
{
if ( HODCAP_OK == hodcap_mux_channel_selection ( &hodcap, sen_num ) )
{
if ( ( HODCAP_OK == hodcap_wait_adc_data_ready( &hodcap ) ) &&
( HODCAP_OK == hodcap_get_i_q_data( &hodcap, &i_data, &q_data ) ) )
{
log_printf( &logger, " SEN%d -> ", sen_num );
log_printf( &logger, " I : %u |", i_data );
log_printf( &logger, " Q : %u rn", q_data );
Delay_ms( 100 );
}
}
}
log_printf( &logger, "________________________rn" );
Delay_ms( 2000 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.HODCAP
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. UART terminal is available in all MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MIKROE 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.