How does it work?
Accel 10 Click is based on the LIS2DW12TR, a high-performance ultra-low-power 3-axis “femto” accelerometer, from STMicroelectronics. This sensor has many features perfectly suited for wearables, handheld, and IoT applications, offering a good balance between the performance and the power consumption. One of its key features is its extremely low power consumption, which makes it perfectly suited for such applications. There are several power modes which the LIS2DW12TR device can use. While in Low Power mode, the device consumes only 0.38µA, but the access to some features is restricted. Having that in mind, accel 10 Click can be used for a rapid development and testing of various applications based on step counting, fitness applications, profile switching and display ON/OFF applications, angle measurement applications, and similar applications. More information can be found within the LIS2DW12TR datasheet.
The LIS2DW12TR sensor can measure acceleration within ranges of ±2 g, ±4 g, ±8, and ±16 g. It can output the measurement data using the Output Data Rate (ODR) from 1.6Hz (Low Power mode), up to 1600Hz (Performance mode). A high-precision analog front end facilitates highly sensitive MEMS, featuring a 14-bit A/D Converter. It allows very high accuracy of the output, even during very low amplitude changes. This makes the sensor particularly sensitive and accurate with movements that generate relatively low acceleration signals. However, using a highly sensitive MEMS makes the LIS2DW12TR prone to damage caused by extremely high g-forces (10,000 g for less than 200 µs).
Acceleration data is available in 14-bit format from both the data registers and the internal FIFO buffer, which can can memorize 32 slots of X, Y and Z data. The FIFO buffer can be used for more complex calculations or timed readings, reducing the traffic on the communication interface. FIFO buffer allows optimization within the firmware that runs on the host MCU.
Besides the acceleration MEMS and complementary analog front-end circuit, the LIS2DW12TR sensor also has an integrated temperature sensor. It is updated up to 25 times per second, and sampled to an 12-bit value (complement of 2’s format).
Interrupts can be triggered for many different events. Some basic events include the data-ready interrupt event and aforementioned FIFO events, while so-called feature engines can trigger an interrupt for any of the detected motion/movement events, including step detection/counter, activity recognition, tilt on wrist, tap/double tap, any/no motion, and error event interrupt. The extensive interrupt engine can use two programmable interrupt pins. Both of these pins can be assigned with any interrupt source and can be either LOW or HIGH on interrupt, depending on settings in appropriate registers. These two pins are routed to PWM and INT pin of the mikroBUS™, and are labeled as IT1 and IT2, respectively.
Accel 10 Click offers two communication interfaces. It can be used with either I2C or SPI. The onboard SMD jumpers labeled as COMM SEL allow switching between the two interfaces. Note that all the jumpers have to be positioned either I2C or to SPI position. When I2C interface is selected, an additional SMD jumper labeled as ADDR SEL becomes available, determining the least significant bit of the LIS2DW12TR I2C address.
This Click Board™ uses both I2C and SPI communication interfaces. It is designed to be operated only with 3.3V logic levels. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V.
Specifications
Type
Acceleration,Motion
Applications
Accel 10 click can be used for a rapid development and testing of various applications based on step counting, fitness applications, profile switching and display ON/OFF applications, angle measurement applications, and similar applications.
On-board modules
LIS2DW12TR, a 14-bit triaxial acceleration sensor with ultra-low power consumption, from STMicroelectronics.
Key Features
tap, double tap and free-fall detection, ultra-low power consumption, thermal readings
Interface
GPIO,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 10 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,JP2,JP4 | COM SEL | Right | Communication interface selection: right position SPI, left position I2C |
JP3 | ADD SEL | Left | I2C address LSB selection: left position 0, right position 1 |
Accel 10 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Receiver inputs voltage range | ±2 | – | ±16 | g |
Receiver inputs voltage range | 1.6 | – | 1600 | Hz |
Receiver inputs voltage range | -40 | – | +85 | °C |
Receiver inputs voltage range | – | 90 | – | µA |
Receiver inputs voltage range | 0.38 | – | 5 | µA |
Software Support
We provide a library for the Accel 10 Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library covers all the necessary functions to control Accel 10 click board. Library performs a standard I2C and SPI interface communication.
Key functions:
accel10_default_config( void )
– Set default sensor configuration function.void accel10_get_data ( accel10_data_t *p_accel_data )
– Read Accel data function.int8_t accel10_read_temperature ( void )
– Read temperature function.
Examples description
The application is composed of three sections :
- System Initialization – Initializes I2C and start to write log.
- Application Initialization – Initialization driver enables – I2C, check communication by read device ID, set default configuration, also write log.
- Application Task – (code snippet) This is an example which demonstrates the use of Accel 10 Click board. Measured and display Accel data coordinates values for X-axis, Y-axis and Z-axis. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes for every 1 sec.
void application_task( ) { if ( accel10_check_data_ready( ) == ACCEL10_STATUS_DATA_READY ) { accel10_get_data ( &accel_data ); Delay_ms( 10 ); mikrobus_logWrite( " Accel X : ", _LOG_TEXT ); IntToStr( accel_data.x, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( " Accel Y : ", _LOG_TEXT ); IntToStr( accel_data.y, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( " Accel Z : ", _LOG_TEXT ); IntToStr( accel_data.z, log_text ); mikrobus_logWrite( log_text, _LOG_LINE ); mikrobus_logWrite( " - - - - - - - - - - ", _LOG_LINE ); temperature = accel10_read_temperature( ); Delay_ms( 10 ); mikrobus_logWrite( " Temperature : ", _LOG_TEXT ); IntToStr( temperature, log_text ); ltrim( log_text ); mikrobus_logWrite( log_text, _LOG_TEXT ); mikrobus_logWrite( degCel, _LOG_LINE ); mikrobus_logWrite( "---------------------", _LOG_LINE ); Delay_ms( 1000 ); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C or SPI
- UART
- Conversions
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.