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?
Angle 7 Click is based on the AS5600, an easy to program magnetic rotary position sensor with a high-resolution 12-bit analog or PWM output from AMS AG. The AS5600 is a Hall-based rotary magnetic position sensor using planar sensors that convert the magnetic field component perpendicular to the surface of the chip into a voltage. It measures the absolute angle of a diametric-magnetized on-axis magnet while at the same time rejecting stray magnetic fields. By default, the output represents a range from 18 to 360 degrees. It is also possible to define a smaller range to the output by programming a zero angle (start position) and a maximum angle (stop position).
The signals coming from internal Hall sensors are first amplified and filtered before their conversion by the ADC and then processed by the hardwired CORDIC block to compute the angle and magnitude of the magnetic field vector. The intensity of the magnetic field is used by the automatic gain control (AGC) to adjust the amplification level to compensate for temperature and magnetic field variations. After that, the output stage uses the angle value provided by the CORDIC algorithm. The user can choose between an analog output representing the angle as a ratiometric linear absolute value and a digital PWM-encoded output representing the angle as the pulse width. The selection can be made by positioning the SMD jumper labeled as OUT SEL in an appropriate position marked as AN or INT.
Angle 7 Click communicates with MCU using the standard I2C 2-Wire interface with a maximum clock frequency of 1MHz, fully adjustable through software registers. Also, the DIR SEL jumper allows users to select the polarity of the output relative to rotation direction by positioning the SMD jumper in an appropriate position marked as CW or CCW allowing clockwise or counterclockwise rotation. A 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.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Both mikroBUS™ power rails have protection in the form of diode MAX40200, controllable through an EN pin on the mikroBUS™ socket to prevent any unwanted back voltage. 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.
NOTE: In the case of using a logic level of 5V, it is necessary first to remove the resistor R6 and then switch the VCC jumper to the 5V position.
Specifications
Type
Magnetic
Applications
Can be used for contactless potentiometers, contactless knobs, RC servos, and other angular position measurement solutions
On-board modules
AS5600 – rotary magnetic position sensor from ams AG
Key Features
Contactless angle measurement, highest reliability and durability, simple user-programmable start and stop positions over the I2C
Interface, high-resolution output signal, great flexibility on angular excursion, selectable output, and more
Interface
Analog,I2C,PWM
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 Angle 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 |
JP2 | OUT SEL | Left | Analog/PWM Output Selection AN/INT: Left position AN, Right position INT |
JP3 | DIR SEL | Left | Direction Polarity Selection CW/CCW: Left position CW, Right position CCW |
R6 | R6 | Populated | Power Management Jumper |
Angle 7 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Angle Measurement Range | 18 | – | 360 | deg |
Resolution | – | 12 | – | bit |
Operating Temperature Range | -40 | +25 | +120 | °C |
Software Support
We provide a library for the Angle 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 Angle 7 Click driver.
Key functions
-
angle7_get_status
This function reads the status data. -
angle7_get_angle
This function reads the calculated angle in degrees. -
angle7_get_magnitude
This function reads the magnitude data.
Example Description
This example demonstrates the use of Angle 7 click board by reading and displaying the magnet’s angular position in degrees and analog voltage output as well as the magnet’s status and magnitude.
void application_task ( void )
{
float voltage, raw_angle, angle;
uint16_t magnitude;
uint8_t status;
if ( ADC_ERROR != angle7_read_an_pin_voltage ( &angle7, &voltage ) )
{
log_printf( &logger, " AN voltage: %.3f Vrn", voltage );
}
if ( ANGLE7_OK == angle7_get_angle ( &angle7, &angle ) )
{
log_printf ( &logger, " Angle: %.2f Degreesrn", angle );
}
if ( ANGLE7_OK == angle7_get_magnitude ( &angle7, &magnitude ) )
{
log_printf ( &logger, " Magnitude: %urn", magnitude );
}
if ( ANGLE7_OK == angle7_get_status ( &angle7, &status ) )
{
log_printf ( &logger, " Status:" );
if ( status & ANGLE7_STATUS_MAGNET_DETECTED )
{
log_printf ( &logger, " Magnet Detected rn Magnet Strength:" );
if ( status & ANGLE7_STATUS_MAGNET_TOO_STRONG )
{
log_printf ( &logger, " Too Strong rnn" );
}
else if ( status & ANGLE7_STATUS_MAGNET_TOO_WEAK )
{
log_printf ( &logger, " Too Weak rnn" );
}
else
{
log_printf ( &logger, " Good rnn" );
}
}
else
{
log_printf ( &logger, " Magnet Not Detected rnn" );
}
}
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.Angle7
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.