How does it work?
Magneto 2 Click is based on the MLX90316, a Triaxis® Hall rotary position sensor from Melexis Technologies, providing the absolute angular position of a small dipole magnet rotating above the device surface (end-of-shaft magnet). Thanks to an Integrated Magneto-Concentrator (IMC) on its surface, the MLX90316 senses, measured in a non-contacting way, the horizontal component of the applied magnetic flux density, resulting in an impressive robustness of the angular position over the mechanical (air-gap, off-axis) tolerances. The angular information is computed from both vectorial flux density components (i.e., BX and BY) and provided as an output signal proportional to the decoded angle.
This Click board™ communicates with MCU through a standard SPI interface supporting the most common SPI mode, SPI Mode 1, with a maximum frequency of 20MHz. The rotation of this horizontal component is sensed over a wide range (up to 360º) and processed by the on-chip DSP to report the absolute angular position of the magnet as 14-bit data accessible through an SPI serial interface. Also, the output characteristic such as offset, gain, clamping levels, linearity, thermal drift, filtering, and range are fully programmable to match any specific requirement through end-of-line calibration.
This Click board™ can be operated only with a 5V 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
Magnetic
Applications
Can be used for non-contacting rotary position sensor applications in automotive and industrial systems
On-board modules
MLX90316 – Hall rotary position sensor from Melexis Technologies
Key Features
Absolute rotary position, Triaxis® Hall technology, programmable angular range up to 360 degrees, SPI interface, high resolution, high performance, contactless sensing, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
5V
Pinout diagram
This table shows how the pinout on MAGNETO 2 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 |
MAGNETO 2 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 5 | – | V |
Angular Range | 0 | – | 360 | deg |
Resolution | – | 14 | – | bit |
Software Support
We provide a library for the Magneto 2 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 Magneto 2 Click driver.
Key functions
-
This function reads 14-bit data value from target register,
-
This function takes 14-bit data value from target register.
Example Description
This example collects data from the sensor, calculates position of absolute rotary angle and then logs it.
void application_task ( void )
{
angle_value = magneto2_read_angle( &magneto2 );
Delay_100ms();
if ( angle_value_old != angle_value )
{
if ( angle_value != -1 )
{
if ( angle_value != 0 )
{
log_printf( &logger, "Angle %frn", angle_value );
}
else
{
log_printf( &logger, "Magnetic field too weakrn" );
}
}
else
{
log_printf(&logger, "Magnetic field too strongrn");
}
angle_value_old = angle_value;
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.Magneto2
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.