How does it work?
MPU 9DOF Click is based on the MPU-9250, a 9-axis MotionTracking device combining a 3-axis gyroscope, accelerometer, magnetometer, and a Digital Motion Processor™ (DMP) from InvenSense. The MPU-9250 features three 16-bit ADCs for digitizing each part (gyroscope, accelerometer, and magnetometer) outputs, low power, and high performance. For precision tracking of both fast and slow motions, the MPU-9250 features a user-programmable full-scale gyroscope range of ±250, ±500, ±1000, and ±2000dps, accelerometer range of ±2g, ±4g, ±8g, and ±16g, and a magnetometer range of ±4800μT.
The embedded DMP engine supports advanced MotionProcessing and low-power functions, such as gesture recognition using programmable interrupts, alongside pedometer functionality allowing the host MCU to sleep while the DMP maintains the step count. The DMP acquires data from accelerometers, gyroscopes, and magnetometers and processes the data, which can be read from the DMP’s registers or can be buffered in a 512-byte FIFO. In addition to all the above features, the DMP can generate an interrupt, routed to the INT pin of the mikroBUS™ socket, which can wake up the host MCU from Suspend mode.
MPU 9DOF Click allows using both I2C and SPI interfaces with a maximum frequency of 400kHz for I2C and 1MHz for SPI communication. The selection can be made by positioning SMD jumpers labeled SPI I2C 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 MPU-9250 allows choosing the least significant bit (LSB) of its I2C slave address using the SMD jumper labeled ADDR SEL.
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,Gyroscope,Magnetic,Motion
Applications
Can be used for consumer electronics equipment such as angle measurements, motion detection, gesture position, or as a pedometer
On-board modules
MPU-9250 – 9-axis MotionTracking device from InvenSense
Key Features
3-axis gyroscope-accelerometer-magnetometer, 16-bit ADCs, user-programmable interrupts (wake-on-motion interrupt), wide dynamic measurement range, high resolution, lower power consumption, selectable 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 MPU 9DOF 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 | Right | I2C Address Selection 1/0: Left position 1, Right position 0 |
JP2-JP5 | COMM SEL | Right | Communication Interface Selection SPI/I2C: Left position SPI, Right position I2C |
MPU 9DOF Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Gyroscope Range | ±250 | ±2000 | dps | |
Gyroscope Sensitivity | 16.4 | – | 131 | LSB/pds |
Gyroscope Resolution | – | 16 | – | bit |
Accelerometer Range | ±2 | – | ±16 | g |
Accelerometer Sensitivity | 2.048 | – | 16.384 | LSB/g |
Accelerometer Resolution | – | 16 | – | bit |
Magnetometer Range | – | ±4800 | – | μT |
Magnetometer Sensitivity | – | 0.6 | – | μT/LSB |
Magnetometer Resolution | – | 14 | – | bit |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the MPU 9DOF 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 MPU 9DOF Click driver.
Key functions
-
Function read Gyro X-axis, Y-axis and Z-axis axis.
-
Function read Gyro X-axis, Y-axis and Z-axis axis.
-
Function read Magnetometar X-axis, Y-axis and Z-axis axis.
Example Description
MPU 9DOF click carries the world’s first 9-axis Motion Tracking device. It comprises two chips: one that contains a 3-axis accelerometer, a 3-axis gyroscope, and a DMP (digital motion processor); the other is a 3-axis digital compass.
void application_task ( void )
{
mpu9dof_read_accel( &mpu9dof, &accel_x, &accel_y, &accel_z );
Delay_10ms( );
mpu9dof_read_gyro( &mpu9dof, &gyro_x, &gyro_y, &gyro_z );
Delay_10ms( );
mpu9dof_read_mag( &mpu9dof, &mag_x, &mag_y, &mag_z );
Delay_10ms( );
temperature = mpu9dof_read_temperature( &mpu9dof );
Delay_10ms( );
log_printf( &logger, " Accel X : %d | Gyro X : %d | Mag X : %d rn", accel_x, gyro_x, mag_x );
log_printf( &logger, " Accel Y : %d | Gyro Y : %d | Mag Y : %d rn", accel_y, gyro_y, mag_y );
log_printf( &logger, " Accel Z : %d | Gyro Z : %d | Mag Z : %d rn", accel_z, gyro_z, mag_z );
Delay_10ms( );
log_printf( &logger, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -rn" );
Delay_10ms( );
log_printf( &logger, "Temperature: %.2f Crn", temperature );
Delay_100ms( );
log_printf( &logger, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -rn" );
log_printf( &logger, "rn");
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.Mpu9Dof
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.
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.