MIKROE 4-20mA RT Click
An Arduino library for the 4-20 mA R & T Click Boards of MIKROE.

Introduction

Supported:

  • 4-20 mA R Click (MIKROE-1387)
    • 4-20 mA current loop receiver
    • MCP3201 12-bit ADC SPI chip
    • max SPI clock 1.6 MHz
    • max 100 ksps
  • 4-20 mA T Click (MIKROE-1296)
    • 4-20 mA current loop transmitter
    • MCP4921 12-bit DAC SPI chip
    • max SPI clock 20 MHz
    • settling time of 4.5 μs

Single R Click readings tend to fluctuate a lot. To combat the large fluctuations this library optionally provides an exponential moving average (EMA) applied to the R Click readings. It does not rely on storing an array of data and is hence very memory efficient.

It does this by oversampling the R Click readings at a user-supplied interval. Subsequently, it will low-pass filter the readings using a smoothing factor that is calculated from a user-supplied low-pass filter cut-off frequency. Technically, the exponential moving average is a single-pole infinite-impulse response (IIR) filter.

See the examples in the examples folder.

Author

Dennis van Gils (vangi.nosp@m.ls.d.nosp@m.ennis.nosp@m.@gma.nosp@m.il.co.nosp@m.m)

Version

Changelog

  • v1.1.0 - Fixed SPI settings not getting initialized properly in Arduino IDE
  • v1.0.0 - Initial release

License

MIT License. See the LICENSE file for details.