# 7805 for 4-20mA current injector

I'm trying to setup a low cost current injector for testing certain I/O modules. I found a rather simple design for a current source using 7805.

simulate this circuit – Schematic created using CircuitLab

So I tried making that and changed the resistances to match my requirement. I have a 24 Volt source on the test rack, which powers the I/O modules as well. Since this is a low cost project, I used the same power supply and ended up with this. -->

simulate this circuit

This circuit worked perfectly when I tested it with a multimeter. It gave 3.6mA to 20.1 mA.

However, while testing with the I/O module, the current through the load (I/O module's internal resistance) never went above 15.6 mA. The I/O module has a floating ground and therefore an isolated current measuring setup. But when I touch the heat sink, the current rose to 20.7mA Thinking this might be due to the capacitance effect from my body, I added a capacitor between the input and GND(what I could find lying around in the workshop was a 35v 100uF). Now I see that the output is in the range of 3.6mA to 20.8mA.

I am not literate enough to calculate the correct capacitance required or evaluate whether this setup is reliable.Please advise.

• Try reading the data sheet for a 7805 - it will tell you that you need two capacitors to generally stabilize it. Sep 29, 2015 at 13:03
• The capacitor helped, probably (though not definitively) because the I/O modules picked up noise on the output differently than your multimeter. Other than that, see @i-chodera 's answer. Sep 29, 2015 at 13:46
• An 7805 has a rather large (and varying!) quiecent current. An LM317 is designed to be used in this configuration, and has a much lower (and much more stable!) quiecent current. Sep 29, 2015 at 14:51
• Most likely it's not happy with the source impedance of your power supply- it is typically stable with just an input capacitor. Try a 100nF capacitor from 7805 'in' to GND within 10-20mm of the 7805. As Wouter says, this is not ideal- the GND current (typically at least several mA) will change at least several percent just from warming up. Sep 29, 2015 at 14:57