NOTE: Rotary Magnetic Holder does not come in the same package as this Click board™, but you can find it in our shop.
How does it work?
Magnetic Rotary 5 Click is based on the AS5134, a contactless magnetic rotary encoder from ams AG for accurate angular measurement over a full turn of 360º. The AS5134 is an innovative system-on-chip that offers a wide range of features and capabilities. In addition to its integrated Hall elements, analog front end, and digital signal processing, this chip is designed with power efficiency in mind. It features a Power Down Mode and fast Start-Up sequence and measurement cycles, allowing for low average power consumption. To measure the angle, only a simple two-pole magnet rotating over the center of the chip is required. The absolute angle measurement instantly indicates the magnet’s angular position with a resolution of 8.5bit equals 360 positions per revolution. It allows high speeds up to 76875RPM and a wide magnetic field input range from 20 to 80mT.
Thanks to its high precision and ability to measure the absolute angle, the AS5134 is suitable for various applications, including contactless position sensing and rotary switches, which can provide a human-machine interface. This chip is also well-suited for motor position control, including both AC/DC and Brushless DC motor position control. This Click board™ communicates with the host MCU using a serial SPI 3-wire read-only connection, only to provide the angular data. An additional way of processing angular data is through the analog pin of the mikroBUS™ socket. With the addition of a lowpass filter at the PWM output pin of the AS5134, this configuration produces an analog voltage proportional to the angle. If the AS5134 angular data is invalid, the PWM output will remain low; thus, the analog output will be 0V.
This Click board™ also comes with an unpopulated header reserved for incremental and commutation signals of their respective A/B/I and U/V/W signals. The phase shift between channels A and B indicates the direction of the magnet movement. Channel A leads channel B at a clockwise magnet rotation by 90 electrical degrees, while channel B leads channel A at a counter-clockwise rotation. Brushless DC (BLDC) motors are also controllable through a standard UVW commutation interface with a programmable number of pole pairs from 1 to 6. These signals will control the electrical angle information according to the number of pole pairs and the actual mechanical angle position.
In addition, this unpopulated header also contains two additional pins marked PR and DX. The PR pin serves to supply the necessary DC voltage in the range of 8 to 8.5V to activate the possibility of permanent programming. Users have the option of zero position programming and magnetic field optimization. Meanwhile, the DX pin can implement a daisy chain mode, providing even greater flexibility in system design. With these added features, the board can be configured for either a two-wire or three-wire mode, depending on the application’s specific requirements. Also, unique addition to this board is a position for a rotary magnet holder designed to be used alongside a magnetic rotary position sensor allowing fast prototyping and quick measurements during development.
Although the AS5134 uses 5V as the primary power source, this Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper thanks to the voltage level translator, the TXB0104E. This way, both 3.3V and 5V capable MCUs can 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
Magnetic
Applications
Can be used for contactless rotary position sensing, rotary switches (human-machine interface), AC/DC motor position control, and brushless DC motor position control
On-board modules
AS5134 – contactless magnetic rotary encoder from ams
Key Features
Accurate angular measurement over a full turn of 360º, user programmable zero position and sensitivity, high speeds, data transmission via 3-wire or analog signal, incremental and commutation signal, low power consumption, daisy chain mode, and more
Interface
Analog,SPI
Feature
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 Magnetic Rotary 5 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 | PWR | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
J1 | – | Unpopulated | Incremental and Commutation Signals Header |
J2 | – | Unpopulated | Programming Voltage and Daisy Chain Mode Header |
Magnetic Rotary 5 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Rotation Angle Range | 0 | – | 360 | °C |
Magnetic Field Range | 20 | – | 80 | mT |
Magnetic Rotation Speed | – | – | 76875 | RPM |
Resolution | – | 8.5 | – | bit |
Software Support
We provide a library for the Magnetic Rotary 5 Click as well as a demo application (example), developed using MIKROE compilers. The demo can run on all the main MIKROE development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Library Description
This library contains API for Magnetic Rotary 5 Click driver.
Key functions
-
magneticrotary5_read_angle
This function reads the magnetic angle and automatic gain control (AGC) values measured by the sensor. -
magneticrotary5_read_mt_cnt
This function reads the multi turn counter value. With each zero transition in any direction, the output of a special counter is incremented or decremented. -
magneticrotary5_read_voltage
This function reads raw ADC value and converts it to proportional voltage level.
Example Description
This example demonstrates the use of Magnetic Rotary 5 Click board™ by reading and displaying the magnet angular position as well as the AGC and multi turn counter values.
void application_task ( void )
{
uint8_t agc = 0;
uint16_t angle = 0;
int16_t mt_cnt = 0;
float voltage = 0;
if ( MAGNETICROTARY5_OK == magneticrotary5_read_angle ( &magneticrotary5, &agc, &angle ) )
{
log_printf ( &logger, "rn AGC: %urn Angle: %urn", ( uint16_t ) agc, angle );
}
if ( MAGNETICROTARY5_OK == magneticrotary5_read_mt_cnt ( &magneticrotary5, &mt_cnt ) )
{
log_printf ( &logger, " Multi turn counter: %drn", mt_cnt );
}
if ( MAGNETICROTARY5_OK == magneticrotary5_read_voltage ( &magneticrotary5, &voltage ) )
{
log_printf( &logger, " AN Voltage : %.3f Vrn", voltage );
}
Delay_ms ( 100 );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on MIKROE github account.
Other MIKROE Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.MagneticRotary5
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 MIKROE compilers.
mikroSDK
This Click board™ is supported with mikroSDK – Mikroe Software Development Kit, that needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.