Accel 3 click carries the H3LIS331DL a low-power high-performance 3-axis linear accelerometer. The click is designed to run on a 3.3V power supply. It communicates with the target microcontroller over SPI or I2C interface, with additional functionality provided by the INT pin on the mikroBUS™ line.
The H3LIS331DL has dynamically user selectable full scales of ±100g/±200g/±400g and it is capable of measuring accelerations with output data rates from 0.5 Hz to 1 kHz.
The “sleep-to-wakeup” function, in conjunction with low-power mode, allows to further reduce the system power consumption and develop new smart applications.
The H3LIS331DL may be set in a low-power operating mode, characterized by lower date rate refreshments. In this way the device, even if sleeping, continues to sense acceleration and generate interrupt requests.
When the “sleep-to-wakeup” function is activated, the H3LIS331DL is able to automatically wake up as soon as the interrupt event has been detected, increasing the output data rate and bandwidth.
Accel 3 click has three groups of jumpers (zero ohm resistors) onboard:
Type | Motion |
Applications | Shock detection, impact recognition, concussion detector |
On-board modules | ST’s H3LIS331DL low-power high-g 3-axis digital accelerometer |
Key Features | 16-bit data output; 0.5Hz to 1kHz data rates |
Key Benefits | ±100g/±200g/±400g dynamically selectable full scales |
Interface | SPI,GPIO,I2C |
Input Voltage | 3.3V |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
H3LIS331DL incorporates a sleep-to-wakeup function. In sleep mode the sensor is in a low-power operating mode; it continues to detect acceleration and generate interrupt requests, but with lower data rate refreshments. Once an interrupt threshold is sensed, the device automatically wakes up and increases the output data rate and bandwidth.
This table shows how the pinout on Accel 3 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
This snippet reads three axes' from the accelerometer every 30 milliseconds and displays them to UART. The values displayed have been calibrated and are measured in gs.
1 #include <stdint.h> 2 #include "accel3.h" 3 4 sbit ACCEL_3_CS at GPIOD_ODR.B13; 5 sbit ACCEL_3_INT at GPIOD_IDR.B10; 6 7 void main() 8 { 9 uint8_t address = 0x18; 10 xyz_t* my_coords; 11 12 //I2C 13 I2C1_Init_Advanced( 100000, &_GPIO_MODULE_I2C1_PB67 ); 14 Delay_ms(200); 15 16 //Accel 3 Initialization 17 accel3_init( address, accel_mode, d_rate, mode ); 18 19 while(1) 20 { 21 my_coords = accel3_get_xyz(); 22 23 sprintf( text, " x: %d y: %d z: %d ", my_coords->x_pos, my_coords->y_pos, my_coords->z_pos ); 24 UART1_Write_Text( text ); 25 UART1_Write_Text( "rn" ); 26 Delay_ms(30); 27 } 28 29 }
Code examples that demonstrate the usage of Accel 3 click with MikroElektronika hardware, written for mikroC for ARM, AVR, dsPIC, FT90x, PIC and PIC32 are available on Libstock