How does it work?
Compass 7 Click as its foundation uses the MMC5633NJL, a monolithic high-performance 3-axis AMR magnetic sensor from MEMSIC. It comes with an integrated drive circuit, signal processing circuit, and serial interface block, allowing low noise and high resolution. It can measure magnetic fields within the full-scale range of ±30 Gauss (G) with up to 0.0625mG per LSB resolution at 20bits operation mode and 2mG total RMS noise level, enabling heading accuracy of ±1º in electronic compass applications.
An integrated SET/RESET function eliminates errors due to Null Field output change with temperature. In addition, it clears the sensors of any residual magnetic polarization resulting from exposure to strong external magnets. The SET/RESET function can be performed periodically for each measurement as the specific application requires.
Compass 7 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 400kHz, fully adjustable through software registers. The MMC5633NJL 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 is used, the MAX8511, providing a 1.8V out of mikroBUS™ power rails. Since the sensor for operation requires a power supply of 1.8V, this Click board™ also features the PCA9306 voltage-level translator allowing the MMC5633NJL to work with 3.3V and 5V MCU properly.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the 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
Compass,Magnetic
Applications
Can be used as an electronic compass but also can be used in various position sensing applications
On-board modules
MMC5633NJL – monolithic high-performance 3-axis AMR magnetic sensor from MEMSIC
Key Features
Low power consumption, superior dynamic range and accuracy, on-chip automatic degaussing with built-in SET/RESET function, sensitivity compensation and on-chip temperature sensor, and more
Interface
I2C
Feature
No 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 7 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 Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Compass 7 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Field Range (Each Axis) | – | ±30 | – | G |
Accuracy | – | ±1 | – | Deg |
Resolution | – | 20 | – | bits |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the Compass 7 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 Compass 7 Click driver.
Key functions
-
compass7_set_measurement_mode
This function sets the control and ODR registers for the selected measurement mode. -
compass7_get_magnetic_flux
This function reads the raw values of X, Y, and Z axis and converts them to magnetic flux data in Gauss. -
compass7_get_temperature
This function reads the temperature measurements in Celsius.
Example Description
This example demonstrates the use of Compass 7 Click board™ by reading and displaying the magnetic field strength of 3-axis as well as the temperature measurements in Celsius.
void application_task ( void )
{
compass7_magnetic_flux_t magnetic_flux;
float temperature;
if ( ( COMPASS7_OK == compass7_set_measurement_mode ( &compass7, COMPASS7_MEAS_SINGLE_M ) ) &&
( COMPASS7_OK == compass7_get_magnetic_flux ( &compass7, &magnetic_flux ) ) )
{
log_printf ( &logger, " X: %.2f Grn", magnetic_flux.x_axis );
log_printf ( &logger, " Y: %.2f Grn", magnetic_flux.y_axis );
log_printf ( &logger, " Z: %.2f Grn", magnetic_flux.z_axis );
}
if ( ( COMPASS7_OK == compass7_set_measurement_mode ( &compass7, COMPASS7_MEAS_SINGLE_T ) ) &&
( COMPASS7_OK == compass7_get_temperature ( &compass7, &temperature ) ) )
{
log_printf ( &logger, " Temperature: %.2f Crnn", temperature );
}
Delay_ms ( 100 );
}
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.Compass7
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.