Current variation with arduino

Hi all,
For a personal project, I need to control by Arduino the current generated by a 3V battery.
I first thought to a numeric potentiometer but I did not find one able to vary from 3 to 100 ohms as I need currents from 30mA and UP to 1A or 1.2A.
Maybe using a 3W precision potentiometer linked to a servo (controled by Arduino)?
Do you have any (simple) idea?
Thanks

I hope you are not needing that current for very long because a 3 volt battery will get quite warm at 1.2 amps.

Only steps of few minutes at higher current. This ils 18650 battery which Can support that...

The difficulty in this is the wide range of current: 30 to 1200 mA. That is hard to do by itself without using an active current control element like an NPN transistor. How stable must the current be? Also, digital pots give stepwise control so over that range of current the resolution will not be very precise. I think you cannot use a simple brute-force method. Look at constant current sources or sinks or mirrors for other ideas.


Something like this maybe? A PWM from the Arduino instead of the pot.

Thks. Indeed, I first used this kind of montage to generate one stable defined value of current (depending of thé load value,)with digital output at the base of the NPN (2N222) but without shunt resistance. But, of course, this is an "all or nothing". not very clear for me. Have ref/ values of the components inficated?

What is the load through which the current passes?

I don't know but this is "not easy". :frowning:

A switch-mode constant current source (like a power supply for a high-power LED) has in internal oscillator that generates a kind-of PWM. Again, that's not an easy thing to build even before making it digitally-controllable.

The current is "smoothed" to DC with an inductor and capacitor (like a regular switch-mode voltage regulator).

There is a small series resistor so the current can be monitored by monitoring the voltage drop across the resistor, and this is used in a feedback-loop to control the PWM (again like a switching voltage regulator, except it's current feedback instead of voltage feedback). It's a "small" resistor to minimize the power loss and heat generated by the resistor.

So... You could use that kind of circuit, feeding the voltage representing current into an Arduino to control the Arduino's PWM. You might have to amplify the feedback voltage, and the Arduino measures voltage relative to ground so you might need a differential amplifier to measure across the resistor but that's minor compared to the overall design.

A linear constant source is "easier" to build before you start trying to digitally control it, but at 1A you might burn-up the MOSFET (when it's turned partially-on and dissipates lots of heat/power). Then you'd probably have to filter the Arduino's PWM to DC and figure-out how to use that as your reference in an analog feedback circuit.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.