Ticker

6/recent/ticker-posts

4-20mA current loop revisited: a simpler calibration procedure


In today’s blog post I will revisit some aspects related to the 4-20mA current loop implemented with Arduino Uno boards, MikroElektronika Arduino Uno click shields and a pair of 4-20mA T and 4-20mA R click boards.

In my previous blog posts regarding the implementation of a 4-20mA bus with MikroElektronika click boards and Arduino Unos I have described a precise calibration procedure (code provided). However, it has come to my attention that the proposed calibration procedure is a bit hard to follow.

So, here there it is: a more straightforward, albeit less precise calibration procedure, that can be performed with just the ubiquitous tools you find in the average maker’s lab. As such, there are some changes and improvements:

  • One needs only one laptop to power one side of the 4-20mA bus and to perform serial debugging. The circuit on the other side of the 4bus needs to be powered on (battery or AC adapter);
  • he usual multimeter with 20mA and 200mA DC ranges will do;
  • One needs an extra potentiometer, connected as a voltage divider to pin A0 of the transmitter circuit.
  • Calibration is less precise but easier to perform.

Why Calibrate?

Some of my readers have used the contact form to ask me about the need to perform calibration.

The answer is simple: you don’t have just a current loop. You are building a 4-20mA current loop. There is a standard which sais that the minimum current through the loop is 4mA, and the maximum current that flows through the loop cannot exceed 20mA. Anything below 4mA can indicate a fault (open loop). Anything over 20mA also indicates a fault condition (short circuit).

In our particular case, the calibration procedure aims to find the DAC_4mA value that, when written into the DAC onboard the 4-20mA T click board, leads to a 4mA current flowing through the bus. We also will determine the DAC_20mA value that leads to a 20mA through the current loop,

A simplified calibration procedure

The test rig is simple. In the picture below the transmitter is powered from the laptop. The receiver is battery powered. A multimeter was put in series with the 4-20mA bus, and it was set to the 200mA DC range.

4-20mA current loop with MikroElektronika click boards

Just like in the first series of blog posts, the calibration of the 4-20mA bus is a two-step process. One has to calibrate the transmitter first, then the receiver.

4-20mA T calibration routine

I have simplified the calibration procedure by using a potentiometer connected to pin A0 of the transmitter board. My potentiometer is soldered on a proto board. I might just need it to debug other projects where analog input is needed. One can use wires to connect directly on the mikroBUS connector; it will work fine as well.

Proto Click with potentiometer – top side

 
Proto Click with potentiometer – bottom side

The voltage applied on the pin A0 will be read by the internal ADC of the Arduino Uno and will be used to drive the DAC. The value written into the DAC registers is also sent to the serial terminal.

4-20mA transmitter with Arduino Uno

To calibrate the bus, one has to load the code below into the transmitter side and start the serial monitor to watch the values written into the DAC. The receiver needs to be powered on, as it provides power to the 4-20mA bus.


Now, slowly turn the potentiometer knob while watching the current values on your multimeter. Try to find a position of the potentiometer knob that corresponds to a 4mA current through the bus – you may switch to the 20mA range for increased precision. Watch the serial monitor and write down the value it shows – it is the DAC_4mA calibration parameter.

You might not get exactly 4mA, as this calibration method is less precise. For maker/hobby/student projects it might be enough to choose the closest value to 4mA.

Now, switch back to the 200mA range, and play with the potentiometer knob until you get 20mA through the bus. Again, watch the output of the serial monitor. Write down the value – it is the DAC_20mA calibration parameter.

Calibrated transmitter code

Take the above values for DAC_4mA and DAC_20mA. Update the code below with those values and upload the code to the transmitter.


Now, with the potentiometer button turned at one end you should have 40mA through the bus. With the potentiometer button turned at the opposite end you should be able to measure 20mA through the bus.

Now as the transmitter is calibrated, we can further proceed to calibrate the receiver.

4-20mA receiver calibration

The calibration of the receiver aims to restore the initial signal input. The analogRead() function returns values between 0 and 1023. We aim to return the same values in the serial monitor connected to the receiver side.

To calibrate the receiver we have to connect the receiver to the laptop, and power the transmitter from the external supply – the transmitter is already calibrated, no need for serial debugging anymore. The multimeter is still set on the 200mA DC, and in series with the bus.

4-20mA receiver with Arduino Uno

Now, upload the code below in the receiver. Start the serial monitor.

Turn the potentiometer knob until you have 4mA through the bus. Write down the value returned by the receiver in the serial terminal – that is the ADC_4mA calibration parameter.

Do the same for 20mA through the bus, and write down the ADC_20mA calibration values.

Now, take the code below, update the calibration values and upload it to the receiver:

If everything is OK, you should now be able to see values between 0 and 1023 in the serial terminal connected to the receiver.

Post a Comment

0 Comments