2
\$\begingroup\$

I need a current sink that I can control from a micro-controller. Should handle 5V up to 4mA or so in at least 256 steps (more is better). I'm looking for a design, not so much a complete product, due to cost.

UPDATE #1: Here is a working circuit using a BJT, I tried a MOSFET (2N7000) but it did not work as expected. Seems the control over the range is a bit limited. I'm going to wire up a DAC and plot the in / out values.

Update #2: I've hooked up the circuit (100% like in the simulation) and I can get a range of between 0.7mA to 4.7mA. Not exactly according to the plan, but seems to be getting there. How can I lower the "low" range? The OP07 had a very low offset.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
11
  • \$\begingroup\$ You need a design for one, or you need a finished product? What have you tried so far? \$\endgroup\$ – Nick Johnson Dec 17 '14 at 13:26
  • \$\begingroup\$ @NickJohnson - I rather have a design as a complete product might be expensive. I'm trying to be on a very strict budget here. So far I am only searching the web for possible solutions to prototype but did not find anything yet. \$\endgroup\$ – user34920 Dec 17 '14 at 13:29
  • \$\begingroup\$ Does your MCU have a DAC? Do you have experience with opamps? \$\endgroup\$ – Dzarda Dec 17 '14 at 13:31
  • \$\begingroup\$ @Dzarda The MCU does not have a DAC, however I might be able to filter a PWM signal to produce a DC signal however I am not sure how accurate or ripple free that would be. I have experience with OAs but not in this application. \$\endgroup\$ – user34920 Dec 17 '14 at 13:34
  • \$\begingroup\$ Please state the full control range of current you require i.e. 100uA up to 4mA. \$\endgroup\$ – Andy aka Dec 17 '14 at 14:27
5
\$\begingroup\$

Building a constant current load with an opamp is a fairly straightforward way to do this. Take a look at the first diagram in this post, for instance:

enter image description here

An opamp adjusts its output to make the voltage on its - and + terminals identical. In this case, the negative input is the voltage across a current sense resistor (R1) and the positive output is the voltage across a potentiometer. Making the two voltages equal means that the current through R1 - and hence, your load, which should go where "V+" is on the schematic - equals the voltage on the + terminal divided by the resistance of R1.

In this case the output of the opamp is driving Q1, a FET, because the FET can sink far more current than the opamp.

To control the load digitally, replace R3 and R6 with the output of a DAC, or a suitably filtered PWM output. For a smaller load like 4mA, you'll want a much bigger resistor for R1; the value of R1 is a tradeoff between the accuracy you get from using larger set voltages, and the extra power dissipation and burden voltage across it.

\$\endgroup\$
11
  • \$\begingroup\$ Perhaps you could emphasize, that for 4mA no transistor is needed. Also, when choosing the R1 value, the opamp's rail-to-rail input/output characteristics must be taken into account. \$\endgroup\$ – Dzarda Dec 17 '14 at 13:49
  • \$\begingroup\$ @Dzarda I thought of mentioning that, but without the transistor, the opamp has to provide the positive supply to the device, and I didn't want to unnecessarily complicate my explanation. \$\endgroup\$ – Nick Johnson Dec 17 '14 at 13:50
  • 2
    \$\begingroup\$ The pot can be a digital pot as well, you can get some that are 8-bit parallel inputs or I2C (much better!) and some cheapo ones usually have 256 steps, and can be linear or non-linear resistances. \$\endgroup\$ – KyranF Dec 17 '14 at 13:52
  • \$\begingroup\$ Also I agree with @Dzarda for max 4mA you do not need a MOSFET. The MOSFET would be acting in the linear resistance region, effectively making it a voltage controlled resistor. The internals of the op-amp will do basically the same thing, and most should be able to do upwards of 20-50mA. \$\endgroup\$ – KyranF Dec 17 '14 at 13:53
  • 1
    \$\begingroup\$ @Dzarda How would you propose to make a "current sink" with just an op-amp? Seems to me you need a BJT, JFET or MOSFET- something with an open collector or drain. \$\endgroup\$ – Spehro Pefhany Dec 17 '14 at 14:01
2
\$\begingroup\$

Not a real answer


To explain my thoughts regarding my comments on @NickJohnson's answer, I present to you this gross pair of schematics. Please excuse the incompleteness and simplification.

schematic

simulate this circuit – Schematic created using CircuitLab

The orange arrow signifies the desired current path. The red arrows however mean false currents that flow in/out of the opamp through your device upstream.

\$\endgroup\$
1
  • \$\begingroup\$ You can use an op-amp as a current source/sink - see the howland current pump: google.co.uk/… \$\endgroup\$ – Andy aka Dec 17 '14 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.