TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139248 times)
  2. FAT32 Library (71743 times)
  3. Network Ethernet Library (57115 times)
  4. USB Device Library (47428 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42403 times)
  7. GSM click (29835 times)
  8. mikroSDK (28073 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

HOD CAP Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.8

mikroSDK Library: 2.0.0.0

Category: Capacitive

Downloaded: 76 times

Not followed.

License: MIT license  

HOD CAP Click is a compact add-on board that adds a smart sensing solution to your application. This board features the AS8579, a capacitive sensor from ams OSRAM. The sensor features I/Q signal demodulation, parasitic influences from cable, and PCB protection. It has ten sense outputs, five of which come with sensing line filter circuits. This Click board™ makes the perfect solution 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.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "HOD CAP Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "HOD CAP Click" changes.

Do you want to report abuse regarding "HOD CAP Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


HOD CAP Click

HOD CAP Click is a compact add-on board that adds a smart sensing solution to your application. This board features the AS8579, a capacitive sensor from ams OSRAM. The sensor features I/Q signal demodulation, parasitic influences from cable, and PCB protection. It has ten sense outputs, five of which come with sensing line filter circuits. This Click board™ makes the perfect solution 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.

hodcap_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Apr 2023.
  • Type : SPI type

Software Support

We provide a library for the HOD CAP Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for HOD CAP Click driver.

Standard key functions :

  • hodcap_cfg_setup Config Object Initialization function.

    void hodcap_cfg_setup ( hodcap_cfg_t *cfg );
  • hodcap_init Initialization function.

    err_t hodcap_init ( hodcap_t *ctx, hodcap_cfg_t *cfg );
  • hodcap_default_cfg Click Default Configuration function.

    err_t hodcap_default_cfg ( hodcap_t *ctx );

Example key functions :

  • hodcap_get_i_q_data HOD CAP gets the I and Q data function.

    err_t hodcap_get_i_q_data ( hodcap_t *ctx, uint16_t *i_data, uint16_t *q_data );
  • hodcap_mux_channel_selection HOD CAP MUX channel selection function.

    err_t hodcap_mux_channel_selection ( hodcap_t *ctx, uint8_t sen_pos );
  • hodcap_wait_adc_data_ready HOD CAP wait ADC data ready function.

    err_t hodcap_wait_adc_data_ready ( hodcap_t *ctx );

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.

The demo application is composed of two sections :

Application Init

Initialization of SPI module and log UART. After the driver init, the app executes a default configuration.

void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    hodcap_cfg_t hodcap_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    hodcap_cfg_setup( &hodcap_cfg );
    HODCAP_MAP_MIKROBUS( hodcap_cfg, MIKROBUS_1 );
    if ( SPI_MASTER_ERROR == hodcap_init( &hodcap, &hodcap_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( HODCAP_ERROR == hodcap_default_cfg ( &hodcap ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
    log_printf( &logger, "________________________\r\n" );
    Delay_ms ( 100 );
}

Application Task

This example demonstrates the use of the HOD CAP Click board™. The demo application measures the relative change of the impedance and displays I and Q data per channel. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void )
{ 
    static uint16_t i_data, q_data;
    log_printf( &logger, " \tI/Q data \r\n" );
    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 -> ", ( uint16_t ) sen_num );
                log_printf( &logger, " I : %u |", i_data );
                log_printf( &logger, " Q : %u \r\n", q_data );       
                Delay_ms ( 100 );
            }
        }
    }
    log_printf( &logger, "________________________\r\n" );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), 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 MikroElektronika compilers.


ALSO FROM THIS AUTHOR

WiFi NORA Click

0

WiFi NORA Click is a compact add-on board that provides WiFi and BLE connectivity for professional-grade applications. This board features the NORA-W366-00B6-00B, a dual-band WiFi module with Bluetooth Low Energy (BLE) from u-blox, offering support for WiFi 4 (802.11a/b/g/n) in both 2.4 and 5GHz bands and Bluetooth v5.3 with peripheral and central roles. It features a UART interface for easy integration with the host MCU, high-level AT command configuration, and robust security protocols, including WPA2/WPA3 and TLS encryption. The board also includes a user-configurable RGB LED indicator and buttons for bootloader and application mode selection.

[Learn More]

Brushless 7 Click

0

Brushless 7 Click is, as its name said, a motor driver based expansion board for controlling BLCD motors with any microcontroller.

[Learn More]

Fingerprint 2 Click

0

Fingerprint 2 Click is a new fingerprint scanner Click board simplified for everyone's use and it's very easy to implement! This add-on board consists of a high-speed Nuvoton processor which carries high-performance fingerprint algorithm developed for on-board A-172-MRQ fingerprint sensor from company ByNew Technology Inc. This board can be used as a standalone device when connected over USB to PC or it can be controlled by the MCU/processor over serial UART interface.

[Learn More]