How does it work?
4-20mA R Click is based on the INA196, a current shunt monitor with a voltage output from Texas Instruments. The INA196 can sense drops across a shunt at a range of voltages, with no interference with its supply voltage, and uses 500KHz bandwidth in current control loops. The 4-20mA R Click receives output current from 4 to 20mA from a compatible transmitter and converts it into low voltage. On this board, the transmitted loop current comes directly to the load side of the INA196 shunt resistor from a VLOOP screw terminal.
The differential input voltage to the INA196 supply side comes from a TPS61041, a DC/DC boost converter from Texas Instruments. By default configuration, it provides a 16V and can be enabled over the EN pin of the mikroBUS™ socket. In addition, by replacing the R2 0ohm resistor with other values, it can also convert other voltages. The output of the INA196 then comes to the MCP3201, a 12-bit ADC from the Microchip. It communicates with the host microcontroller over an SPI serial interface of the mikroBUS™ socket, with the referent voltage of 2.048V. The ADC receives its reference from the MAX6106, a voltage reference LDO from Analog Devices.
This Click board™ can operate either with 3.3V or 5V logic voltage levels selected via the PWR SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to 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
Current
Applications
Can be used for industrial process control and test systems
On-board modules
INA196 – current shunt monitor from Texas instruments
TPS61041 – DC/DC bost converter from Texas Instruments
MCP3201 – 12-bit ADC from Microchip
Key Features
High precision, industry-standard current sense solution, wide common-mode voltage range, A/D converter for signal processing, SPI interface, low power consumption, and more
Interface
GPIO,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 4-20 mA R 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 |
J1 | PWR SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
4-20 mA R Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Sense current | 4 | – | 20 | mA |
Output Voltage | – | – | 0.4 | V |
Software Support
We provide a library for the 4-20 mA R 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 4-20 mA R Click driver.
Key functions
- This function reads the 16-bit current value from the SPI data register, and then normalizes and converts it to float.
Example Description
This example showcases how to initialize, configure and use the 4-20 mA R click. It is a simple SPI communication module that acts as a receiver in a 4-20 current loop. The click reads current data and converts the analog signal to a digital 12-bit format.
void application_task ( )
{
float current;
current = c420mar_read_data( &c420mar );
log_printf( &logger, "-----------------------------rn" );
log_printf( &logger, " * Current: %.3f mA * rn", current );
Delay_ms( 500 );
}
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.420MaR
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. 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.