Current Limiting Power Supply

Hello,

I'm new to all of this so I apologize if my question is naive. I need to program the Arduino to deliver a constant 0.1mA pulse to a grounded source. One idea would be to get a current-limiting power supply and have the Arduino control a relay. However, since I am dealing with such lower current, I was wondering if there was a way that i could do this just by using the Arduino alone. There will be some variability in the source, and the current pulse needs to be constant at 0.1mA DC for the duration of 1sec (a little bit of variability in the current during the first few msec while the system adapts and changes V or R to adjust to 0.1mA is ok).

Any ideas?

Thanks!

What is the voltage across the load? i.e., what is the input impedance?

A simple 50k resistor connected between an Arduino pin and ground sends 0.1mA to ground.
But your (unknown) device might not be perfect/0ohm.
Tell us more about it.
e.g. what is the voltage across the device with 0.1mA going into the device.
Leo..

Well this is the inherent problem. The goal is to deliver 0.1mA electric shocks to tiny little individual insects for training. The resistance across one individual insect to the next will vary based on intrinsic differences between each animal (mass, water/salt content, thickness of cuticle, electrode placement, etc.). However, for the sake of comparison, I need the current delivered to each insect to be the same during training trials. The system needs to somehow deliver a pulse, and within the first few msec determine whether or not to increase/decrease the voltage delivered in order to keep the magnitude of the current the same for all insects shocked.

Does this help? I'm a biologist and am getting lost in the circuitry lingo. Since I won't need to ever change the current (I will always use 0.1mA), I would like to avoid buying a pricey constant-current power supply.

*edit: minor spelling and grammar.

What is wrong with a constant current supply for an LED.
The big problem you have is that any constant current device has a limited maximum voltage. Do you know what maximum voltage you need to operate at?

You need a switchable current source - but first you need to know the voltage compliance range - ie
the maximum voltage needed to force 0.1mA through the load, since the current source will need
to run from that high a voltage to be able to work.

Standard current source circuits are a few BJTs and resistors. If the supply voltage has to be above 5V
(very likely if you want to deliver a shock) you'll probably use a level converter (NPN or opto-isolator)
to switch the source on and off. I assume a source is needed, not a sink, and that the shock electrode
will be +ve w.r.t. ground?

For this application I'd avoid opamp circuits, they are very slow to react compared to a BJT and could
cause large overcurrent spikes on microsecond timescales.

[ There is another approach, use a voltage well above the necessary range and a large enough
resistor to limit the current - you can modulate this by shunting the output to ground to
switch it off ]

As for the voltage across the load/input impedance, I'm not exactly sure. I was hoping to use a 5V potential with 50kOhm resistance before load but I'm not sure if thats what you're asking.

Could be that several hundred volts are needed to get that current.
Unless the insects are in a chair with a wet sponge on top of their heads.

Tell us how you are planning to deliver this current.
Are there any electrodes involved.
Leo..

but I'm not sure if that's what you're asking.

It is not.

You can not force 0.1mA down any load greater than 50K with 5V. What if your insect presented a 100K load, then you would need 10V. What if it presented a 1M load then you would need 100V.

This is a vital piece of information you need to know.
The old mechanical teleprinters had an 80mA constant current drive, but that was limited to a voltage of 180V as I remember. That limited what line length could be use due to the resistance of that line.

I am not a biologist but 50K sounds some what low for a chitin coated critter.

Thanks for all of the responses.

@MarkT, Kieth, Leo, Mike: yes a source rather than a sink is needed, with +ve wrt ground. The + electrode will be placed on the dorsal thorax (back of the insect), and ground will be through all 6 legs. According to the literature, others have performed similar training protocols (same type of insects and electrode placement) using anywhere between 40-60V, but I've only seen one source report the current used (which is where I got 0.1mA from, but unfortunately they didn't say anything about the voltage). haha there won't be a sponge, but the area where the electrodes are placed will be covered in an electrically-conductive gel. Also, @GrumpyMike I've looked into constant current supplies for LEDs but am not sure if they would be appropriate. My impression is that they function at much higher loads than what I would need, although I may be wrong. Thoughts?

Grumpy_Mike:
You can not force 0.1mA down any load greater than 50K with 5V. What if your insect presented a 100K load, then you would need 10V. What if it presented a 1M load then you would need 100V.

This is a vital piece of information you need to know.

@GrumpyMike--thank you. Your last comment helped me wrap my head around a simple and important piece of information that I had been ignoring. I'll look for some numbers in the past literature but are there any simple ways for me to measure the impedance of the insect? Can I just use a multimeter and run 120V across the insect and measure the drop in current?

Thanks again for all of your replies. Up until about a week ago, my knowledge of electronic circuits was limited to an elementary understanding Ohm's law. I still know very little, but this forum has been extra welcoming and has been a fantastic source of knowledge. I've learned a lot here just over the course of the past few days.

Based on your comments and where they have led me in my googling, I've realized that my idea to use the Arduino as both the power source and the controller may have been naive. It looks like I will need to use at least 40V to drive 0.1mA through the insect during each shock, which I believe is more than the Arduino can deliver. On top of that, I will need feedback that tells the Arduino to adjust its output V based on the impedance in the insect so that 0.1mA is maintained over the course of the shock period (1sec). Therefore, I will likely need an external constant current power supply, and can use the Arduino to control the duration and timing of shock cycle.

Does this seem correct?

Adding up all the facts, I think you need a switched "high-side" constant current source of 100uA.
And 5 or so 9volt batteries in series to supply this CC source.
Leo..

Wawa:
Adding up all the facts, I think you need a switched "high-side" constant current source of 100uA.
And 5 or so 9volt batteries in series to supply this CC source.
Leo..

Leo, this is fantastic. Thank you for the advice and for drawing the circuit for me--I really appreciate your time and energy. I will build it, zap some bugs, and post an update shortly.

Be aware that even PP3-sized 9V batteries can be a risk to (human) life if you place enough
in series, so above 40V or so take the same precautions you would with mains electricity. It is
a relatively simple way to get a high voltage supply at low current, and you can experiment with
the voltage you actually need too.

Poor little insects!

MarkT:
Be aware that even PP3-sized 9V batteries can be a risk to (human) life if you place enough
in series, so above 40V or so take the same precautions you would with mains electricity. It is
a relatively simple way to get a high voltage supply at low current, and you can experiment with
the voltage you actually need too.

Poor little insects!

This is certainly a mistake I could (would) have made haha so thanks for the heads up!

Wawa:
Adding up all the facts, I think you need a switched "high-side" constant current source of 100uA.
And 5 or so 9volt batteries in series to supply this CC source.
Leo..

Leo, would you mind talking me through the circuit diagram so I can understand it a little better? I've looked up all of the parts used in it but it would be useful if I understood the theory behind the design a little better. If you have some time, you can explain it here or in a PM.

This is a classic constant current source.
When the Arduino pin is high, the BC547 turns "on".
Current from the battery stack now flows through the two diodes and R2 to ground.
Creating a constant voltage across the two diodes (~1.4volt).
The BC557 uses this constant voltage to drop a constant voltage across R1.
This is one diode drop less, because of the BE junction.
So there is a constant voltage across R1 of ~0.7volt.
Constant voltage and constant resistance of 6k8 is constant current.

The two diodes can be replaced by a common red LED.
Change R1 to ~10k for 100uA.
Leo..

Better choose high-voltage transistors BTW - the BC547 isn't a great choice. Go for a rating double
the max expected working voltage for a reliable design.