Programmable Current Source

Hello there!

I was wondering... how can i make a programmable current source... I mean: is there any way i can change the current how ever i want in a range, using an Arduino? Ive searched the internet but i didnt find anything that could help me...

I know there are some programmable ICs that generate the current you want, but for what i have to do, i need to do it lets say... the old way. No already-build IC`s. I can use: opamps, transistors, resistors, capacitors, etc...

Any help would be appreciated

To be more precise: let`s say that the circuit is already build.

If i want the current to be 10mA, i would send some bytes or pwm or something like that to the circuit and that circuit would provide me a constant 10ma current, if i send other bytes, the current would change at other value, and so on...

Standard opamp circuits for this are a google-search away, despite your claims:

First hit on googling "voltage controlled current source circuit": Voltage Controlled Current Source - Current Servo - Daycounter

(Though that circuit is actually a voltage controlled current sink, not a source, but the principles are
the same.

To generate the control voltage takes either a DAC or a low-pass filtered PWM signal.

I know there are some programmable ICs that generate the current you want, but for what i have to do, i need to do it lets say... the old way. No already-build IC`s. I can use: opamps, transistors, resistors, capacitors, etc...

I wish you wouldn't have said that, otherwise I could have recommended one of these. Still, they're not directly programmable by an MCU ... would need a digital pot or similar to program the set current.

With those requirements, sounds like a school project.

Ive found that lm334 too... but unfortunately i cant use it... I need to make it the old school...

The projects has to do this: create a current mirror to power up an LED, with changeable current..

The current mirror is not hard to make it, but the adjustable current source is...

The current mirror is not hard to make it, but the adjustable current source is...

A crude, simple 5-bit programmable current source might be this. Just use 5 pins and resistors, say ideally 16K (bit 0), 8K (bit 1), 4K (bit 2), 2K (bit 3), 1K (bit 4). With 5V I/O, approximately 0-10mA in 32 steps. Then program the desired current by setting the pins to INPUT or OUTPUT HIGH.

How much current are you talking about? 0-?. What voltage?

dlloyd:
A crude, simple 5-bit programmable current source might be this. Just use 5 pins and resistors, say ideally 16K (bit 0), 8K (bit 1), 4K (bit 2), 2K (bit 3), 1K (bit 4). With 5V I/O, approximately 0-10mA in 32 steps. Then program the desired current by setting the pins to INPUT or OUTPUT HIGH.

A current source is a circuit that keeps the output current constant despite changes in load,
which resistors cannot do.

A current source is a circuit that keeps the output current constant despite changes in load,
which resistors cannot do.

True ... it would be limited to a constant load and to Vcc (basically its just a programmable source resistance)

5 second with Google gave me this mosfet constant current

The current range is 0-100mA, but i don't know the voltage... all i know is that i'll be using this circuit to control the current of an automotive LED.

Still found no ideea on how to do it...

Xeyow:
Still found no ideea on how to do it...

Apart from the various suggestions we've posted ?

Two PNP transistor current mirror. Put a resistor on the "input" side, rather than tie it to ground, connect it to the output of a DAC (digital to analog converter).

Calibrate it so zero voltage from the DAC is full current (Vcc - 0.7V)/R and the maximum output from the DAC is Vcc - 0.7V to get zero current.

It would be more accurate and less temperature sensitive when getting close to zero current if you use an Op Amp driven current source.

Calculate R5 and R6 so Iout is max when the bottom end of R6 is at ground. Then connect the output of the DAC to the bottom of R6 rather than ground. When the DAC output = Vcc, Iout = zero. When the DAC output is at zero, Iout is at maximum current.

I'm doing this myself for a transistor curve tracer.

Xeyow:
The current range is 0-100mA, but i don't know the voltage... all i know is that i'll be using this circuit to control the current of an automotive LED.

Better explain that in detail if you want the right advice.

"an automotive LED" of 100mA could be dashboard/reading/interior light in the car.
A simple current limiting resistor, transistor with base resistor, and PWM dimming could be all you need.
Leo..

Wawa:
Better explain that in detail if you want the right advice.

"an automotive LED" of 100mA could be dashboard/reading/interior light in the car.
A simple current limiting resistor, transistor with base resistor, and PWM dimming could be all you need.
Leo..

Exactly: the circuit will be used for leds that are on dashboards :slight_smile: Unfortunately my task is to controll the brightness of that LED using current source and current mirror and the current being controlled by an arduino.

Any ideas...? Got really stuck on this task... I have no idea how to control the current through that current source via arduino...

Why are you limited to an "old school" method? A current mirror just duplicates a current, you would need a controllable current source to feed into it. And if you've got a controllable current source feeding into the mirror, you can use that to just feed the LED instead and cut the mirror out of the picture.

So tell us why you are rejecting everyone else's perfectly good suggestions and insisting on doing it a stupid way.

Could you provide me a schematic to use with Arduino? Or help me create one?

MarkT, dlyod, and tinman already gave you useful suggestions on the first page, which you dismissed for some unfathomable reason about needing to do it "old school". I'm not going to waste my time looking up or creating a design just for you to turn it down.

You need to explain all of your constraints up front. What kind of components are you allowed to use, and what is not allowed? Why does it have to be a "current mirror"?

What are you even trying to do with the LED? Control its brightness? That sort of thing doesn't need precision current control.