3D Halle 2 Click Board
3D Halle 2 Click Board
Overview
Das 3D Hall 2 Click Board™ ist ein sehr genaues Click Board™ zur Magnetfelderfassung, das zur Erfassung der Magnetfeldstärke in drei senkrechten Achsen verwendet wird. Es basiert auf einem TLV493D-A1B6, einem stromsparenden 3D-Magnetsensor von Infineon. Dieser Sensor verfügt über einen separaten Hall-Sensor für jede Achse, was eine sehr zuverlässige Magnetfelderfassung im 3D-Raum ermöglicht und die Grundlage für genaue Winkelberechnungen bietet.
Der TLV493D-A1B6-Sensor verwendet eine I2C-Kommunikationsschnittstelle nach Industriestandard und erfordert nur sehr wenige externe Komponenten. Die I2C-Schnittstelle wird auch für den Chip-Reset verwendet, sodass der Sensor nur sehr wenige Pins hat.
The sensor consumes a very low amount of current, featuring an additional low power mode, which allows even lower power consumption, which with its low count of pins, makes this sensor a perfect choice for various IoT applications. The internal Hall sensors are matched, making the 3D Hall 2 Click Board™ perfectly suited for the development of various gaming applications (joystick), general control applications such as contactless knobs and potentiometers, or some other type of human interface device (HID) based on an accurate angle sensing.
How Does The 3D Hall 2 Click Board™ Work?
The 3D Hall 2 Click Board™ carries the TLV493D-A1B6, a low power 3D magnetic sensor, from Infineon. This sensor relies on a Hall effect to accurately sense magnetic field changes on three perpendicular axes. The internal sensing elements are spinning Hall sensor plates, connected to a 12bit low noise Analog to Digital Converter (ADC), which sequentially samples each sensor, providing 12-bit spatial data over the I2C interface. An additional 8-bit thermal sensor is also available, and it is used for thermal compensation.
The magnetic sensor has a very low pin count (only 6), packed in a SOP6 casing. Therefore, the I2C interface is used for the reset too, while the interrupt pin is multiplexed with the I2C clock line. The interrupt is a useful feature that is used to signal a data ready event to the host microcontroller. For more robust data transfer, the device also contains a frame counter, which increases after each sensor sampling cycle. If the cycle was stopped for whatever reason, the frame counter will indicate this problem, and the application is able to take the necessary steps. Parity Error Check mechanism is also implemented for even more data transfer robustness.
The sensor provides raw data output, based on a strength of the magnetic field. The measurement is affected by many factors: slight manufacturing differences between ICs affect the readings, even the slight differences between Hall plates within the same IC might affect the accuracy, although the IC contains highly matched sensing elements. Also, the altitude might affect the readings, as well as temperature changes. Therefore, the sensor IC is equipped with a thermal sensor, used to measure the influence of the ambient temperature. Unlike errors that occur as the result due to the influence of other elements, the thermal influence is not linear and therefore, the host firmware should utilize a Look-up Table (LUT) for several thermal values, in order to achieve a linear response. The thermal sensor allows reducing the error margin of the angle measurement from ±2˚ to ±3˚ by using such LUT table compensation. The datasheet contains the whole calibrating procedure, as well as the angle calculation based on raw sensor data, as well as formulas for conversion of the thermal and the magnetic data.
There are two configuration registers, used to set the working parameters. The interrupt functionality, thermal sensor availability, the power mode, I2C interface speed, data parity test, and other working parameters are contained within two configuration registers, referred to as MOD1 and MOD2 in the datasheet. The I2C address of the device can be changed by overwriting corresponding I2C address bits in these two registers. The I2C slave address is additionally determined at the startup, by sampling the state of the SDA (I2C Serial Data) pin within the first 200 µs, after which the address remains fixed until the next reset cycle. I2C pins (SCL and SDA) are routed to the mikroBUS™ of the Click board™ for easy interfacing with the development system.
The 3D Hall 2 Click Board™ can operate with 3.3V MCUs only, and it is already equipped with pull-up resistors. It is ready to be used as soon as it is inserted into a mikroBUS™ socket of the development system. The Click board™ comes supported by the library with simple and easy to use functions, compatible with all the MikroElektronika compilers.
Specifications
Type | Magnetic |
Applications | It is perfectly suited for the development of various gaming applications (joystick), general control applications such as contactless knobs and potentiometers, or some other type of human interface device (HID) based on accurate angle sensing. |
On-board modules | TLV493D-A1B6, a low power 3D magnetic sensor, from Infineon |
Key Features | Three independent Hall sensors allow high accuracy, an additional thermal sensor for compensation, small package case allows very compact design, still offering a lot of features, low count of external components required |
Interface | I2C |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Input Voltage | 3.3V |
Pinout diagram
This table shows how the pinout on The 3D Hall 2 Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | NC | ||
NC | 3 | CS | RX | 14 | NC | ||
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock/INT | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data/ADDR | |
Power supply | 3.3V | 7 | 3.3V | 5V | 10 | NC | |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
Onboard jumpers and settings
Designator | Label | Default Position | Description |
---|---|---|---|
LD1 | PWR | - | Power LED indicator |
Software Support
We provide a library for the 3D Hall 2 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 initializes and defines the I2C bus driver and drivers that offer a choice for writing data in the register and reads data from the register. The library includes functions for reading hall X/Y/Z axis data, and temperature data.
Key Functions
void c3dhall2_getAxisTempData(float *axisData, float *tempData)
- Functions for gets Hall axis data and Temperature data
void c3dhall2_configuration(uint8_t settings1, uint8_t settings2)
- Functions for settings chip for measurement
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C module
- Application Initialization - Initialization driver init and configuration chip
- Application Task - (code snippet) - Reads X/Y/Z hall axis and Temperature data. All data logs on the USB-UART every 3 sec.
void applicationTask() { c3dhall2_getAxisTempData(&XYZ_Axis[0], &Temperature); mikrobus_logWrite("Axis X: ", _LOG_TEXT); FloatToStr(XYZ_Axis[0],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Axis Y: ", _LOG_TEXT); FloatToStr(XYZ_Axis[1],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Axis Z: ", _LOG_TEXT); FloatToStr(XYZ_Axis[2],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Temperature :", _LOG_TEXT); FloatToStr(Temperature,demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" C", _LOG_LINE); mikrobus_logWrite(" ", _LOG_LINE); Delay_ms(3000); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
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 3D Hall 2 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.
Software Support
We provide a library for the 3D Hall 2 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 initializes and defines the I2C bus driver and drivers that offer a choice for writing data in the register and reads data from the register. The library includes functions for reading hall X/Y/Z axis data, and temperature data.
Key Functions
void c3dhall2_getAxisTempData(float *axisData, float *tempData)
- Functions for gets Hall axis data and Temperature data
void c3dhall2_configuration(uint8_t settings1, uint8_t settings2)
- Functions for settings chip for measurement
Example Description
The application is composed of three sections :
- System Initialization - Initializes I2C module
- Application Initialization - Initialization driver init and configuration chip
- Application Task - (code snippet) - Reads X/Y/Z hall axis and Temperature data. All data logs on the USB-UART every 3 sec.
void applicationTask() { c3dhall2_getAxisTempData(&XYZ_Axis[0], &Temperature); mikrobus_logWrite("Axis X: ", _LOG_TEXT); FloatToStr(XYZ_Axis[0],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Axis Y: ", _LOG_TEXT); FloatToStr(XYZ_Axis[1],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Axis Z: ", _LOG_TEXT); FloatToStr(XYZ_Axis[2],demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" mT", _LOG_LINE); mikrobus_logWrite("Temperature :", _LOG_TEXT); FloatToStr(Temperature,demoText); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" C", _LOG_LINE); mikrobus_logWrite(" ", _LOG_LINE); Delay_ms(3000); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- I2C
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 3D Hall 2 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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.