Electronic – 4-20mA current loop simulator

4-20masimulation

I'm trying to create a simple 4-20mA current loop simulator that I can control using a potentiometer. The idea is to hook up this circuit to an Arduino and use the Arduino's analog input to read in the current loop (by converting it into a 1-5V signal using a 250 ohm resistor). The potentiometer would be used to get a 4mA to 20mA current flowing through the circuit.

I've got a very simple circuit that is powered with 12V using an LED, some resistors and a potentiometer.

I figured I would get around 4mA when using a 2.7K resistor, and about 20mA when using a 560 ohm resistor.

I ended up with the following circuit. This kinda works, in the sense that if I turn the potentiometer to one side I get 4mA (1V) on one end, and 20mA (5V) on the other end, but it's not linear. the first 80% turn of the potentiometer gives me the 4mA – 10mA range, but then I only got a 20% turn left to get to 20mA.

How can I create a circuit that can get me from 4mA to 20mA in a linear way (using a potentiometer)?

CircuitLab Schematic 3269j2

Best Answer

Are you using a LOG or LINEAR pot?

EDIT:

This is for the linear pot:

enter image description here

Encircled in RED is your 10kOhm LINEAR potentiometer.

Resistance values may need a bit of tweaking.

EDIT2: this is an adjustable constant current source. Assuming the zener voltage is constant a constant current will flow through R1, R2, R3. The voltage on R1 will thus also be constant. This means the wiper of the potentiometer will travel between two fixed potentials. As the potentiometer is linear, the wiper voltage wil also change in a linear in fashion in relation to the actuation of the potentiometer. On the potentiometer wiper you have the base of Q1, which forms an emitor follower with R5. this prevents loading of the potentiometer. The voltage drop accross the base - emitor junction is approx. constant (~0.7V), which means the voltage accross R5 is also linear with the potentiometer travel. For practical purposes all the current flowing through R5 flows out the collector of Q1 and ends up in a load, the 250 Ohm resistor for your Arduino testing.

And there you go, your linear current with linear potentiometer travel.