How does it work?
Compass 8 Click is based on the AK09919, a 3-axis electronic compass IC from AKM Semiconductor designed for precise compass applications. The AK09919 uses high-sensitivity Hall sensor technology, with a typical sensitivity of 0.15µT/LSB, to detect terrestrial magnetism across the X, Y, and Z axes. It integrates magnetic sensors, a sensor driving circuit, a signal amplifier chain, and an arithmetic circuit for signal processing. Key features of the AK09919 also include multiple operational modes, such as Power-down, single measurement, continuous measurement, and self-test. The Power-down mode conserves energy when the device is not in use, while the single measurement mode allows for precise readings on demand. The continuous measurement mode provides ongoing data for real-time applications, and the self-test mode ensures the sensor functions correctly. Additionally, the magnetic sensor overflow monitor function manages overflow conditions in the magnetic sensors, ensuring accurate readings even in strong magnetic fields.
The AK09919 also features a built-in oscillator for a stable internal clock source, maintaining consistent performance and timing accuracy. The Power On Reset circuit ensures proper initialization upon power-up, preventing erroneous readings. The self-test function, which uses an internal magnetic source, verifies the sensor’s accuracy and functionality without external equipment. The built-in magnetic sensitivity adjustment circuit optimizes performance across different environments and applications. Moreover, the 16-sample FIFO data buffer allows efficient data handling, reducing the need for frequent processor intervention. This board is ideal for continuous data acquisition in map heading and pedestrian navigation systems applications.
Compass 8 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 400kHz, fully adjustable through software registers. The AK09919 does not require a specific Power-Up sequence but requires a voltage of 1.8V for its interface and logic part to work correctly. Therefore, a small regulating LDO, the AP2112, is used to provide a 1.8V out of mikroBUS™ power rails. This regulator can be activated via the EN pin of the mikroBUS™ socket, providing, at the same time, device enable function. Since the sensor for operation requires a power supply of 1.8V, this Click board™ also features the PCA9306 voltage-level translator, allowing the AK09919 to work with 3.3V and 5V MCU properly.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Specifications
Type
Magnetic
Applications
Ideal for map heading and pedestrian navigation systems
On-board modules
AK09919 – 3-axis electronic compass IC from AKM Semiconductor
Key Features
High-sensitivity Hall sensor technology, detection of terrestrial magnetism across the X, Y, and Z axes, multiple operational modes, magnetic sensor overflow monitor for accurate readings in strong magnetic fields, a self-test function with an internal magnetic source, a built-in magnetic sensitivity adjustment circuit, 16-sample FIFO data, I2C interface, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Compass 8 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 | VCC SEL | Left | Logic Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
Compass 8 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Sensitivity | – | 0.15 | – | µT/LSB |
Software Support
We provide a library for the Compass 8 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 Compass 8 Click driver.
Key functions
-
compass8_get_magnetic_data
This function reads the raw magnetic sensor measurement data and calculates magnetic flux density [microTesla] using the I2C serial interface. -
compass8_set_operation_mode
This function sets the desired sensor operation mode by using the I2C serial interface. -
compass8_sw_reset
This function performs software reset by using the I2C serial interface.
Example Description
This library contains API for the Compass 8 Click driver. The library initializes and defines the I2C drivers to write and read data from registers, as well as the default configuration for reading measurement data.
void application_task ( void )
{
compass8_axes_t axis;
if ( COMPASS8_OK == compass8_get_magnetic_data( &compass8, &axis ) )
{
log_printf( &logger, " X-axis: %.2f uTrn", axis.x );
log_printf( &logger, " Y-axis: %.2f uTrn", axis.y );
log_printf( &logger, " Z-axis: %.2f uTrn", axis.z );
log_printf( &logger, "--------------------rn" );
Delay_ms( 100 );
}
}
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.Compass8
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.