Compass 4 Click Board
Compass 4 Click Board
Key Features:
- Full scale range of ±4912 μT, sensitivity of 0.15 µT per LSB, resolution at 16bits, Noise Suppression Filter (NSF)
- The Compass 4 Click Board™ is based on the AK09915, a complete 3-axis magnetic sensor with signal processing from AKM
- Suitable for applications such as electrical compass, position sensing, general magnetic field measurement and more.
- mikroBUS: I2C and SPI Interfaces
The Compass 4 Click Board™ is a compact add-on board that can measure the three-axis magnetic field that is perfect for implementation in applications such as electric compasses. This board features AK09915, a complete 3-axis magnetic sensor with signal processing from AKM. For obtaining the sensor measurement data of the magnetic field, an I2C or SPI protocol can be used. The sensor's main feature is the capability to measure magnetic fields within the full-scale range of ±4912 μT, with a sensitivity of 0.15 µT per LSB, resolution at 16-bits, and built-in Noise Suppression Filter (NSF), enabling high measurement accuracy for electronic compass applications. This Click Board™ is suitable for applications such as an electrical compass, position sensing, general magnetic field measurement, and more.
The Compass 4 Click Board™ is supported by a mikroSDK compliant library, which includes functions that simplify software development. This Click Board™ comes as a thoroughly tested product, ready to be used on a system equipped with the mikroBUS™ socket.
Software Support
We provide a library for the Compass 4 Click Board™ 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 contains a basic functions for using Compass 4 click.
Key Functions
void compass4_configuration ( uint8_t cfg1, uint8_t cfg2 )
- Configuration functionuint8_t compass4_get_axis ( compass4_axis_t *axis )
- Gets XYZ Axis valueuint8_t compass4_get_magnetic_flux ( compass4_flux_t *flux )
- Gets magnetic flux of XYZ axis value
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C or SPI module and all necessary GPIO pins
- Application Initialization - Initializes driver inti, reset module, configuration module for measurement and cheeks communication with the module.
- Application Task - Reads magnetic flux or x, y, z-axis, and logs data to USB UART every 1 second.
- Note - SPI communication only works when the jumpers for the slave address are at GND.
void application_task ( ) { compass4_flux_t flux; char demo_text[ 20 ]; uint8_t err; err = compass4_get_magnetic_flux( &flux ); if ( err != 0 ) { mikrobus_logWrite( ">> Measurement error ", _LOG_LINE ); } else { mikrobus_logWrite( ">> Magnetic flux data <<", _LOG_LINE ); FloatToStr( flux.x, demo_text ); mikrobus_logWrite( ">> X: ", _LOG_TEXT ); mikrobus_logWrite( demo_text, _LOG_LINE ); FloatToStr( flux.y, demo_text ); mikrobus_logWrite( ">> Y: ", _LOG_TEXT ); mikrobus_logWrite( demo_text, _LOG_LINE ); FloatToStr( flux.z, demo_text ); mikrobus_logWrite( ">> Z: ", _LOG_TEXT ); mikrobus_logWrite( demo_text, _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 Library
- SPI Library
- Conversions library
Additional Notes and Information
Depending on the development board you are using, you may need a 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
The Compass 4 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.
Compass 4 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.