# build a constant current supply

I have the following problem: I wish to build a microammeter/milliammeter that will interface to an Arduino. Sparkfun sells an ACS712 breakout board with an op-amp and two pots for calibration.

Suppose I'm running a 5V Arduino UNO or equivalent. I want, say, 100uA to be full range. So I need a 100uA constant-current source to use for calibration. I've read the various answers to other constant-current questions, but they are unsatisfactory. For example, an answer that explains that the output voltage will double if the load doubles doesn't help much, because the only voltage I have available is 5.0V. Or perhaps 5.2V or 4.95V. So I need a reference that will provide me with 100uA, that will allow me to tweak the gain of the breakout so that I get a reading of, say, 1000 units on the 10-bit ADC. The ACS712 has a resistance of 1.2m ohms (yes, milli, not meg), so unless there is an external current limit, the power supply would self-destruct or the chip would vaporize. It would be nice if it were independent of the power supply voltage, but I could save the calibration voltage, which I can read, in the EEPROM and adjust according to Ohm's Law, although I'd rather avoid that.

Sparkfun also has a voltage reference chip, the TL431, whose datasheet shows a constant-current sink (see Figure 21 on page 7). Would this create the constant-current reference I need?

Note: my goal is to have six ranges on my ammeter. To do this, I am considering the brute-force approach of buying six ACS712 breakouts, calibrating each of them at 10uA, 100uA, 1mA, 10mA, 100mA and 1A, and feeding them into A0..A5. If I choose 1000 units as my calibration point, then overrange is going to be >1000. So all I need to do is read analog inputs until I get one that is <=1000 and thus my meter becomes autoranging. But without a set of six constant-current sources I have no way to calibrate.

Thoughts/suggestions?

TIA joe

I need a 100uA constant-current source to use for calibration

To calibrate it, connect one current-sensing pin to ground on a power supply. Connect the other current-sensing pin via a precision resistor to a suitable voltage on the power supply. Maybe consider 10 volts as the excitation voltage.

10V across a resistor of 100 kohm produces 100.0000 uA. Even if you added the 1.2 milli ohms into the equation the current would be 99.999999 uA.

All you need next is a precision voltage source of 10V so buy a voltage reference chip with as much accuracy as you can afford.

The ACS712 is a 5A sensor with 1.5% claimed accuracy, so readings of less than about 100mA will have little meaning, let alone decent accuracy, op-amp or no op-amp. So that particular sensor is dead in the water.

On the more general question of calibration, you don't need a constant current source to calibrate, all you need is a known current. A stable unknown voltage source with a stable series resistor and a trusted ammeter is all that is required.

If you're using a cheap handheld meter, a few inexpensive precision resistors (0.1%, for example) may be more accurate than the current ranges of the meter, but don't forget to account for the input resistance of the meter.

simulate this circuit – Schematic created using CircuitLab

Forget about ACS712. It's not close to be good at such low currents, believe me. It has noise equivalent to tens of miliampers, so you can't control such low currents.

For current source i would say you need emitter follower circuit, as simplest option. Current mirror is also an option, but i would start from emitter follower, especially because you can calibrate it at each working point.

simulate this circuit – Schematic created using CircuitLab

Something like that. So the positive input is the reference voltage and the collector is your negative output to load, while the positive is the VCC.

Then just calibrate your reference voltages and voila.

I've used the first circuit here, to make a low value current source. You could pick a lower voltage reference. How much voltage compliance do you need?