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 arduinos 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 getto 20mA.
How can I create a circuit that can get me from 4mA to 20mA in a linear way (using a potentiometer).