TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 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 (139062 times)
  2. FAT32 Library (71593 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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

6DOF IMU 21 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.4

mikroSDK Library: 2.0.0.0

Category: Motion

Downloaded: 60 times

Not followed.

License: MIT license  

6DOF IMU 21 Click is a compact add-on board perfect for applications requiring accurate orientation and movement detection. This board features the WSEN-ISDS (2536030320001) sensor from Würth Elektronik, which integrates 3-axis acceleration and gyroscope sensors using advanced MEMS-based capacitive sensing technology. It offers a fully calibrated 16-bit digital output, with acceleration ranges from ±2g to ±16g and gyroscope ranges from ±125dps to ±2000dps, alongside a high output data rate of up to 6.6kHz for seamless movement tracking. Additionally, an embedded temperature sensor provides environmental monitoring capabilities.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "6DOF IMU 21 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "6DOF IMU 21 Click" changes.

Do you want to report abuse regarding "6DOF IMU 21 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


6DOF IMU 21 Click

6DOF IMU 21 Click is a compact add-on board perfect for applications requiring accurate orientation and movement detection. This board features the WSEN-ISDS (2536030320001) sensor from Würth Elektronik, which integrates 3-axis acceleration and gyroscope sensors using advanced MEMS-based capacitive sensing technology. It offers a fully calibrated 16-bit digital output, with acceleration ranges from ±2g to ±16g and gyroscope ranges from ±125dps to ±2000dps, alongside a high output data rate of up to 6.6kHz for seamless movement tracking. Additionally, an embedded temperature sensor provides environmental monitoring capabilities.

6dofimu21_click.png

Click Product page


Click library

  • Author : Stefan Ilic
  • Date : Dec 2023.
  • Type : I2C/SPI type

Software Support

We provide a library for the 6DOF IMU 21 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 6DOF IMU 21 Click driver.

Standard key functions :

  • c6dofimu21_cfg_setup Config Object Initialization function.

    void c6dofimu21_cfg_setup ( c6dofimu21_cfg_t *cfg );
  • c6dofimu21_init Initialization function.

    err_t c6dofimu21_init ( c6dofimu21_t *ctx, c6dofimu21_cfg_t *cfg );
  • c6dofimu21_default_cfg Click Default Configuration function.

    err_t c6dofimu21_default_cfg ( c6dofimu21_t *ctx );

Example key functions :

  • c6dofimu21_software_reset This function performs the device software reset.

    err_t c6dofimu21_software_reset ( c6dofimu21_t *ctx );
  • c6dofimu21_read_accel_data This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (mg).

    err_t c6dofimu21_read_accel_data ( c6dofimu21_t *ctx, c6dofimu21_data_t *accel_data );
  • c6dofimu21_read_gyro_data This function reads the angular rate of X, Y, and Z axis in degrees per second (mdps).

    err_t c6dofimu21_read_gyro_data ( c6dofimu21_t *ctx, c6dofimu21_data_t *gyro_data );

Example Description

This example demonstrates the use of 6DOF IMU 21 Click board by reading and displaying the accelerometer and gyroscope data (X, Y, and Z axis).

The demo application is composed of two sections :

Application Init

Initializes the driver performs the Click default configuration, and checks communication by reading device ID.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    c6dofimu21_cfg_t c6dofimu21_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.
    c6dofimu21_cfg_setup( &c6dofimu21_cfg );
    C6DOFIMU21_MAP_MIKROBUS( c6dofimu21_cfg, MIKROBUS_1 );
    err_t init_flag = c6dofimu21_init( &c6dofimu21, &c6dofimu21_cfg );
    if ( ( I2C_MASTER_ERROR == init_flag ) || ( SPI_MASTER_ERROR == init_flag ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( C6DOFIMU21_ERROR == c6dofimu21_default_cfg ( &c6dofimu21 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    uint8_t dev_id = 0;
    c6dofimu21_generic_read( &c6dofimu21, C6DOFIMU21_REG_DEVICE_ID, &dev_id, 1 );
    if ( C6DOFIMU21_DEVICE_ID != dev_id )
    {
        log_error( &logger, " Communication error " );
    }
    log_printf( &logger, " Device ID: 0x%.2X \r\n", ( uint16_t ) dev_id );

    log_info( &logger, " Application Task " );
}

Application Task

Reading the accelerometer and gyroscope measurements, results are displayed on the USB UART every second.

void application_task ( void )
{
    c6dofimu21_data_t accel_data;
    c6dofimu21_data_t gyro_data;

    c6dofimu21_read_accel_data( &c6dofimu21, &accel_data );
    c6dofimu21_read_gyro_data( &c6dofimu21, &gyro_data );
    log_printf( &logger, " Accel data | Gyro data \r\n" );
    log_printf( &logger, " X: %.2f mg | %.2f mdps \r\n", accel_data.x_data, gyro_data.x_data );
    log_printf( &logger, " Y: %.2f mg | %.2f mdps \r\n", accel_data.y_data, gyro_data.y_data );
    log_printf( &logger, " Z: %.2f mg | %.2f mdps \r\n", accel_data.z_data, gyro_data.z_data );
    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.C6DOFIMU21

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

Current 5 Click

0

Current 5 Click is a compact add-on board that provides a precise and accurate current sensing solution. This board features the INA381, a high-speed current-sense amplifier with an integrated comparator from Texas Instruments. This device has selectable operating modes (transparent or latched) and detects overcurrent conditions by measuring the voltage developed across a current shunt resistor. Then it compares that voltage to a user-defined threshold limit set by the comparator reference potentiometer. The current-shunt monitor can measure differential voltage signals on common-mode voltages that vary from –0.2V to 26V, independent of the supply voltage. This Click board™ delivers higher performance to applications such as test and measurement, load and power supplies monitoring, low-side phase motor control, and many more.

[Learn More]

CAN FD 2 Click

0

CAN FD 2 Click is a HS CAN transceiver add on board, suitable for evaluation of TLE9255W CAN network transceiver from Infineon.

[Learn More]

RS485 5V Click

0

RS485 Click 5V is an RS422/485 transceiver Click board™, which can be used as an interface between the TTL level UART and the RS422/485 communication bus. It features a half-duplex communication capability, bus Idle, open, and short-circuit detection, thermal shutdown, and more. It is well suited for transmitting data packets over long distances and noisy areas, using the twisted wire bus, which offers good electromagnetic interferences (EMI) immunity.

[Learn More]