How does it work?
Air Motion Click is based on the ICM-40627, a 6-axis MotionTracking™ device that combines a 3-axis gyroscope and a 3-axis accelerometer from TDK InvenSense. It features a 2K-byte FIFO that can lower the traffic on the selected serial bus interface and reduce power consumption by allowing the system processor to burst read sensor data and then go into a low-power mode. With its 6-axis integration, the ICM-40627 guarantees optimal motion performance for customers. The ICM-40627 comes bundled with TDK’s Air Motion Library that enables precise mouse pointing, swipe, roll, gesture wake-up and other motion gestures, making this Click board™ a suitable solution for gesture-based handheld applications.
The gyroscope supports eight programmable full-scale range settings from ±15.65dps to ±2000dps, and the accelerometer supports four programmable full-scale range settings from ±2g to ±16g. Other industry-leading features include InvenSense on-chip APEX Motion Processing engine for gesture recognition, activity classification, and pedometer, along with on-chip 16-bit ADCs, programmable digital filters, an embedded temperature sensor, and programmable interrupts.
Air Motion Click allows the use of both I2C and SPI interfaces at a maximum frequency of 1MHz for I2C and 24MHz for SPI communication. Selection is made by positioning SMD jumpers marked ‘COMM SEL’ to the appropriate position. Note: all jumpers’ positions must be on the same side, or the Click board™ may become unresponsive. When the I2C interface is selected, the ICM-40627 allows the choice of the least significant bit (LSB) of its I2C slave address, using the ADDR SEL SMD jumper set to an appropriate position marked 0 and 1.
The ICM-40627 also has a programmable interrupt system, configured via the Interrupt Configuration register, that can generate an interrupt signal on the INT pins, INT1 and INT2 pins routed on the INT and AN pins of the mikroBUS™ socket. Events like new read-data availability (from the FIFO and Data registers), accelerometer events, FIFO watermark and overflow can all trigger an interrupt.
This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.
Specifications
Type
Motion
Applications
Can be used for gesture-based handheld applications, like pedometer, tilt and tap detection, and more
On-board modules
ICM-40627 – 6-axis MotionTracking™ device from TDK InvenSense
Key Features
Combines a 3-axis gyroscope and accelerometer, integrated TDK’s Air Motion Library, configurable communication interface, user-programmable gyro/accel scale range, programmable interrupts, APEX motion functions, and more
Interface
I2C,SPI
Feature
ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Air Motion 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 | ADDR SEL | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
JP2-JP5 | COMM SEL | Right | Communication Interface Selection SPI/I2C: Left position SPI, Right position I2C |
Air Motion Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Gyroscope Range | ±2000 | – | ±15.625 | dps |
Accelerometer Range | ±2 | – | ±16 | g |
Gyroscope Sensitivity | 16.4 | – | 2097.2 | LBS/dps |
Accelerometer Sensitivity | 2.048 | – | 16.384 | LBS/g |
Resolution | – | 16 | – | bits |
Software Support
We provide a library for the Air Motion 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 Air Motion Click driver.
Key functions
-
airmotion_set_reg_bank
Air Motion set register bank function. -
airmotion_sw_reset
Air Motion software reset function. -
airmotion_get_data_from_register
Air Motion read data function.
Example Description
This example demonstrates the use of Air Motion Click board™.
void application_task ( void )
{
if ( airmotion_get_int1_state( &airmotion) )
{
#if defined TAP_DETECTION_MODE
uint8_t tap_num;
uint8_t tap_axis;
uint8_t tap_dir;
airmotion_get_tap_detection( &airmotion, &tap_num, &tap_axis, &tap_dir );
if ( AIRMOTION_TAP_SINGLE == tap_num )
{
log_printf( &logger, " SINGLE TAP" );
}
else
{
log_printf( &logger, " DOUBLE TAP" );
}
if ( AIRMOTION_TAP_DIR_POSITIVE == tap_dir )
{
log_printf( &logger, " IN POSITIVE" );
}
else
{
log_printf( &logger, " IN NEGATIVE" );
}
if ( AIRMOTION_TAP_AXIS_X == tap_axis )
{
log_printf( &logger, " X AXIS DIRECTION rn" );
}
else if ( AIRMOTION_TAP_AXIS_Y == tap_axis )
{
log_printf( &logger, " Y AXIS DIRECTION rn" );
}
else
{
log_printf( &logger, " Z AXIS DIRECTION rn" );
}
#else
airmotion_data_t accel_data;
airmotion_data_t gyro_data;
float temp_data;
uint32_t tmst_data;
airmotion_get_data_from_register( &airmotion, &temp_data, &accel_data, &gyro_data, &tmst_data );
log_printf( &logger, " TEMP: %.2f rn", temp_data );
log_printf( &logger, " GYRO: x:%d y:%d z:%d rn", gyro_data.data_x,gyro_data.data_y,gyro_data.data_z );
log_printf( &logger, " ACCEL: x:%d y:%d z:%d rn", accel_data.data_x,accel_data.data_y,accel_data.data_z );
log_printf( &logger, "========================== rn" );
Delay_ms(1000);
#endif
}
}
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.AirMotion
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 by a mikroSDK – Mikroe Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from (delete the) LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.