How does it work?
Accel 2 Click is based on the LIS3DSH, a highly reliable digital triaxial acceleration from STMicroelectronics, with an embedded state machine that can be programmed to implement autonomous applications. The LIS3DSH is highly configurable with a programmable acceleration range of ±2g, ±4g, ±6g, ±8g, or ±16g, capable of measuring accelerations with selectable output data rates from 3.125Hz up to 1.6kHz. It supports high-performance and low-power operating modes, allowing maximum flexibility to meet the resolution and power needs of various motion control use cases.
The LIS3DSH has an integrated first-in, first-out (FIFO) buffer for each of the three output channels, X, Y, and Z allowing the user to store data to limit intervention by the host processor. FIFO allows consistent power saving for the system since the host MCU does not need to poll data continuously from the sensor. Still, it can wake up only when needed and burst the essential data from the FIFO.
Accel 2 Click allows using both I2C and SPI interfaces with a maximum frequency of 400kHz for I2C and 10MHz for SPI communication. The selection can be made by positioning SMD jumpers labeled SEL COMM in an appropriate position. Note that all the jumpers’ positions must be on the same side, or the Click board™ may become unresponsive. While the I2C interface is selected, the LIS3DSH allows choosing the least significant bit (LSB) of its I2C slave address using the SMD jumper labeled I2C ADD.
In addition to communication pins, this board also possesses an additional interrupt pin, routed to the INT pin on the mikroBUS™ socket, indicating when a new set of measured acceleration data is available, simplifying data synchronization in the digital system that uses the device. Also, the user-defined programs can distinguish movement patterns like shake and double shake, face up and face down, turn and double turn, and then activate an interrupt upon execution.
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
Acceleration,Motion
Applications
Can be used for motion control interfaces, pedometers, orientation detectors, and more
On-board modules
LIS3DSH – digital triaxial acceleration from STMicroelectronics
Key Features
Low power consumption, high performance and resolution, dynamically selectable full scale, programmable embedded state machines, integrated interrupt feature, selectable serial interface, and more
Interface
I2C,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on Accel 2 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-JP3 | SEL COMM | Left | Communication Interface Selection SPI/I2C: Left position SPI, Right position I2C |
JP4 | I2C ADD | Left | I2C Address Selection 0/1: Left position 0, Right position 1 |
Accel 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Measurement Range | ±2 | – | ±16 | g |
Sensitivity | 0.06 | – | 0.73 | mg/digit |
Software Support
We provide a library for the Accel 2 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 Accel 2 Click driver.
Key functions
-
Check Accel 2 ID.
-
Function read X axis.
-
Function read Y axis.
Example Description
This application is three-axis accelerometer which embeds.
void application_task ( void )
{
int16_t value_x;
int16_t value_y;
int16_t value_z;
uint8_t txt_x[ 15 ];
uint8_t txt_y[ 15 ];
uint8_t txt_z[ 15 ];
value_x = accel2_read_xaxis( &accel2 );
value_y = accel2_read_yaxis( &accel2 );
value_z = accel2_read_zaxis( &accel2 );
log_printf( &logger, "Axis X: %drn", txt_x );
log_printf( &logger, "Axis Y: %drn", txt_y );
log_printf( &logger, "Axis Z: %drn", txt_z );
log_printf( &logger, "-------------------------------" );
Delay_ms( 5000 );
}
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.Accel2
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.