# How can I create 4-20 mA current souce

I have one op amp based circuit that converts 4-20 mA from current sensor into 5-9 V DC. Right now I don't have any such sensor to test this circuit. I want to create new circuit that produce 4-20 mA for an input to op amp circuit. How can I create this current source circuit?

• Show the schematic for the input stage of your 4 - 20 mA input. Tip: If you use the editor toolbar CircuitLab button to draw your schematic you can use the Save and Insert button to insert a PNG of the schematic into the post along with an edit link. There's no need for a CircuitLab account. No screengrab. No grid. It also means that others can copy and paste your schematic for further editing. Commented May 4 at 19:57

The following circuit may be of use to you:

simulate this circuit – Schematic created using CircuitLab

The circuit is based upon the LM317L which is a low current adjustable voltage regulator. Be sure to use the L version of the IC, which stands for low current. The LM317 (with no L) will not work at such low currents.

In normal operation there is a bypass capacitor connected between the input of the LM317L and ground. However, it is not clear where ground is in your overall system. Your 4-20 mA receiver may only have two connecting wires for your sensor. If you lack a bypass capacitor, there may be some risk of the LM317L oscillating. There is some discussion about whether or not an input capacitor would be a benefit or a detriment in the answers to this question.

The LM317L doesn't have a very accurate voltage reference. The nominal value is 1.25 V. However, it may vary from 1.2 V to 1.3 V. Consequently, the current in this circuit may only go down to 4.2 mA and may go up as high as 21.7 mA, depending upon the value of the voltage reference. For many purposes, this may be adequate. A modification of this circuit with at least a second potentiometer to adjust for variations in the LM317L might be a possibility if more precision is needed. Alternatively, one could either find or cobble together a (approximately) 265 $$\\Omega\$$ potentiometer, by placing a 560 $$\\Omega\$$ resistance in parallel with a 500 $$\\Omega\$$ potentiometer, and get a little extra range in the output current.

• This schematics works ok, I have used it for dummy 4-20mA source too. Commented May 10 at 4:38

Here is a simple current source that you can make up from discrete transistors and resistors that you should have handy in any electronics lab:

VCC can be anywhere from 5Vdc up to 30Vdc maximum. Adjust R3 to get the current you need. R6 sets the maximum current, which occurs when R3=0. Minimum current occurs when R3 is at maximum. The values shown here will get you quite close to the 4-20mA range.

To use it, replace "R_load1" with your "load" (in your case, the input of your 4-20mA to 5-9V converter). Be careful about power dissipation in Q2, if the load voltage is low, then adjust Vcc to be low also, particularly when the current in R_load1 is toward 20mA. Keep power dissipation in Q2 below about 200mW. If this becomes a concern, you could replace Q2 with a higher-power transistor (such as a BD140) and mount it on a heatsink.

Need a Helping Hand?
But what if you didn't have a spare hand to turn the pot during your experiment? Or perhaps you could not find a 150Ω variable resistor? Well, with the previous circuit you either need a motorised pot turner, or a very helpful friend. The next circuit may be better in this case, since it allows you to control the current source from a voltage, which can be automatically adjusted by a signal generator - and you don't need a very particular variable resistor.

Operation:
Let's start at the output, and work back from there toward the input. Q5 is a current source that provides a current into the load [R_load2] that is about 10 times the current in R1. The current in R1 is controlled by the current in R4, which is set by the voltage at node [Vcntrl], via the voltage-buffer formed by Q3 & Q4. Minimum output current occurs when [Vcntrl] = 0V and is set by R10. Maximum output current is set by R4 and the maximum voltage applied at node [Vcntrl]. The values shown in the schematic give a minimum I of 4mA when [Vcntrl] = 0V, and 20mA when [Vcntrl] = 1.6V. Increase the value of R4 to increase the voltage at which 20mA occurs (for 20mA at 5.0V, change R4 to about 2.7kΩ).

Vcc can be from +5V up to about 30V. There is the same concern regarding power dissipation in the output transistor (Q5), and it has the same solutions as per the previous circuit.

The output of Q5 will be somewhat affected by Vcc (it will increase slightly as Vcc increases). This sensitivity can be reduced by stabilising the voltage at node [Vref]. A very simple circuit for doing this is shown below. If you do choose to use this circuit, be sure to remove R15 (22kΩ), and select the zener correctly (a zener voltage of between 5 & 12V should be OK). The minimum voltage for Vcc will be about 2V above [Vref].

• BJT based current sources are great: simple, reasonably accurate and one can be tossed together out of parts we usually have laying around. Good job including the voltage controlled current source. Commented May 10 at 20:44

Maths_keeps_me_busy's answer is simplest (and most precise), but if you don't want to await delivery of an LM317L, and you have a couple of PNP BJTs lying around, you can cobble together this current source:

simulate this circuit – Schematic created using CircuitLab

Output current $$\I\$$ is pretty constant:

$$I = \frac{0.7V}{R_1}$$

This is true over a wide supply range, so you don't have to use 12V. Anything from a few volts upwards will work well, but remember that supply voltage does impose a limit on the maximum compliance voltage of this current source.

Since you want current adjustable between 4mA and 20mA just calculate R1 for those two conditions, and provide a variable resistance over that range:

$$R_{1(MIN)} = \frac{0.7V}{20mA} = 35\Omega$$

$$R_{1(MAX)} = \frac{0.7V}{4mA} = 175\Omega$$

This would be your circuit, then:

simulate this circuit

Of course you may use standard E12 resistances of 33Ω and 150Ω, which would extend the current range slightly outside the 4mA and 20mA bounds.

simulate this circuit – Schematic created using CircuitLab

simulate this circuit – Schematic created using CircuitLab

Figure 1. Simple current source circuit.

• $$\ V_{IN} \$$ is the ADC input at 20 mA. $$\ R_S = \frac {V_{IN}} {0.02} \$$.
• For 20 mA (R2 = 0), $$R1 = \frac {V_{cc} - V_{in}} {0.02}$$
• For 4 mA  (R2 at max),

$$R2 = \frac {V_{cc}} {0.02} - R_1 - R_S$$

The pot adjustment will not be linear, but that's not a requirement. Use a meter to monitor the current.

You could make something like this. RV1 can be a 10-turn pot.

simulate this circuit – Schematic created using CircuitLab

The stability is mostly dependent on R1 and U, and RV1. You would put a precision meter in series with the output current and adjust RV1 to get the desired current.

If you are calibrating a great many instruments you may want to replace RV1 with some resistors and trimpots to give 4mA/20mA/12mA for zero/FS/mid-scale (checking at mid-scale on a linear instrument can catch a bunch of issues such as saturation that is calibrated out).