How does it work?
LIN HALL Click, as its foundation, uses the MLX90242, a linear Hall-effect sensor designed in CMOS technology from Melexis Technologies. The MLX90242 features active error correction circuitry (Hall plate quadrature spinning current and chopper-stabilized amplifier), virtually eliminating the offset errors usually associated with Hall-effect devices. It allows using generic magnets, making it suitable for highly accurate rotary and linear position detection in automotive and industrial applications.
The ratiometric output voltage of the MLX90242 is proportional to the supply voltage. For a positive slope, the voltage at the output will increase as a South magnetic field is applied to the branded face of the MLX90242. Conversely, the voltage output will decrease in the presence of a North magnetic field. For a negative slope, the voltage at the output will increase as a North magnetic field is applied to the branded face of the MLX90242. Conversely, the voltage output will decrease in the presence of a South magnetic field. The output signal of the MLX90242 is then converted to a digital value using MCP3201, a successive approximation A/D converter with a 12-bit resolution from Microchip using a 3-wire SPI compatible interface (read-only).
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VOLTAGE LEVEL jumper. It should be highlighted that the MLX90242 works exclusively at 5V, where it is necessary to 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 highly accurate rotary and linear position detection in automotive and industrial applications
On-board modules
MLX90242 – bipolar Hall-effect sensor from Melexis Technologies
Key Features
Low power consumption, active error correction circuitry, built on CMOS technology, chopper-stabilized amplifier stage, sensitive to both North and South pole magnetic fields, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on LIN HALL 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-JP2 | VOLTAGE LEVEL | Right | Voltage Level Selection 5V/3V3: Left position 5V, Right position 3V3 |
LIN HALL Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Operating Range | -55 | – | +55 | mT |
Sensitivity | – | 39 | – | mV/mT |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the LIN HALL 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 LIN HALL Click driver.
Key functions
- Read 12-bit data function.
Example Description
This is a example which demonstrates the use of Lin Hall Click board.
void application_task ( void )
{
value_adc = linhall_read_data( &linhall );
if ( ( ( value_adc - value_adc_old ) > sensitivity ) && ( ( value_adc_old - value_adc ) > sensitivity ) )
{
log_printf( &logger, " ADC Value : %4d rn", value_adc );
log_printf( &logger, "------------------rn" );
value_adc_old = value_adc;
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.LinHall
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.