3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

arduino control of digital potentiometer

Is it possible to use my new Ardy board to control a 1-wire potentiometer that will, in turn, control the pwm output for a high-power LED?
The POT is here.
The lights are REBELS @ 700mA.
THe POT will be run in "non-parasitic" layout.

15 comments
sort by: active | newest | oldest
Feb 8, 2009. 4:01 PMwestfw says:
The arduino should be able to talk to the one-wire interface and set the digital pots with no problems (I think there is even a one-wire library that already exists.) But I'm not clear how you plan to have the digital pots control the PWM'ed LEDs...
Apr 29, 2012. 9:17 PMnode-0 says:
Hi Tweac-it,

I see what your underlying intent here is, and while it's a laudable one (the reduction of lots and lots of wiring) I think you need to have firm understanding
of some fundamentals in electronics.

1.) Too much current can and will kill your components.

2.) Too much voltage can and will kill your components.

3.) Resistors are your friends, learn the Ohms law triangle and become fluent
with finding values with it, using an ohm's law calculator (there are tons of apps for this purpose) will help you in this regard.

4.) Learn to use transistors and many of your hurdles will disappear, NPNs are your friends.


Now to answer your question:

Your LED's draw a TON of current, indeed they have to to this to attain the brightness you're probably going for, that's all well and good but know this....

Current = amps which in electronics is usually expressed in milliamps, 1000 miliamps == 1 AMP, for an electronic device not designed to handle that (cough, MOSFET, or heavy duty BJT, etc.. cough) 1 AMP means certain death for an IC.

Those digipots are designed and intended to control the behavior of OTHER ICS, and what that means is... They're designed to modulate a 555's output i.e. By swapping the digipot for 'R2' of a 555's typical setup for frequency generation OR the behavior of some other IC which uses variable resistance to change it's behavior.

OK? That means a digipot is a sensitive and 'fragile' device intended to control the behavior of other sensitive and 'fragile' devices.

You're trying to use a digipot (read it's practical meaning immediately above) to control a HIGH POWERED LED, and what that amounts to is trying to control the braking of a Chevy Suburban SUV by pressing your sneaker-clad foot onto the surface of it's spinning wheels... Very soon, your sneaker will be torn up and not long after that your foot will be injured beyond recovery....

In this analogy the digipot is your sneaker-clad foot...

See what I mean?

To control the LEDs using a 1 wire (which is really an implementation of something called 'I2C'  pronouced " I Squared C " ) daisychain of digipots you'd have to wire up an additional component per LED, an NPN transistor aka a BJT type of transistor. MOSFETS would be overkill here, so just stick with an NPN transistor, you'll have to check the current rating of the NPNs you source, since your LEDs pull 700ma, you'll want to find an NPN BJT with at least 1 AMP current capacity from the emitter (negative voltage wire goes in) to the collector (negative voltage wire comes out and it's path through the BJT is altered in a controlled manner based on the stimulation or positive voltage at the 'base' using the digipot as a programmable resistor between +5v or VCC and the 'base' of the NPN BJT)

So you see, what you're trying to do is quite complex, simply as a design goal in and of itself...

You want to use an I2C daisychain of "n amount" of programmable devices to then alter the voltage on the bases of an equal "n amount" of NPN BJTs which will then and only then allow the emitter to collector current flow through their N terminals (Negative Positive Negative i.e. NPN).

So "FOR EACH LED" you will need:

1 Digipot or other i2C programmable IC which can control the base of an NPN BJT
(I bet you could find the appropriate PWM ics if you searched for "I2C compatible PWM ics")

1 NPN BJT transistor.

A few jumpers to hook up all of the short wiring you'll need to configure per LED...


So as you can see, PWM is not inherently hard or limited, it is the very high level of functioning that you want that is elevating the complexity of your project.

It sounds like a fun little excercise to embark upon, and I use the term 'embark' for good reason, this sounds like a 3 week project if taken up as a part-time project.

Good luck, and may the force be with you.
Apr 30, 2012. 1:58 AMsteveastrouk says:
This is three years old ! I don't think the author of the original question has been back since
Apr 30, 2012. 3:29 PMnode-0 says:
Obviously this page will come up upon searches for 'digipot' and other related terms. In that case the reply is quite helpful to anonymous readers, and the points raised in the reply are solid ones at that.

Feb 8, 2009. 3:08 PMgmoon says:
I'm a little fuzzy on your goals...

The Arduino itself will do the PWM, yes? (the REBEL light I see don't have built-in PWM.) What is the digital POT for? (That digital pot takes a digital input info to set the POT's output, not the other way around.)

If you're intending to use a POT as a control to set the PWM, then why not just read an analog POT with the Arduino's ADC?

But perhaps I misunderstand where you're going with this...
Feb 8, 2009. 5:38 PMgmoon says:
By it's nature, PWM control doesn't alter voltage--pulse width modulation works by varying the width of a pulse, rather than changing it's voltage--which a POT (as a voltage divider) would do...

For LED brightness, PWM itself is preferable to using a POT. I'd say you're trying to achieve a single goal by trying two different solutions at once... (it's possible to mix the two methods, but it'll be no more effective, and more complex to boot.)

Westfw is the Arduino guy here, so I'll let him help you from here on...
Feb 8, 2009. 7:01 PMgmoon says:
The digital POT (or any POT) wouldn't work as well as PWM. Digital POTs are inherently cool gadgets, but probably not the best choice here. Plus it's added expense/complexity. Unless there are some other components used, in the original article...
Feb 8, 2009. 8:51 PMgmoon says:
Well, you tell me--how are you planning to control 12 LED modules with one tiny digital POT?

"Rebel" LED modules, 12 total, 3.15V @ 700mA = 8.4 Amps = ~25 watts total.

A normal POT wattage rating is 1/4 to 1/2 watt. Only high-current "rheostats" can handle that type of wattage. The digital POT you reference has a very low voltage rating, it can't handle much current. The datasheet doesn't show wattage, but you can infer it by the max voltage (11V) and the minimum step (100K / 256 = ~380 ohms per step.) ... it works out to about 1/3 watt rating.

Hence my comment:
Unless there are some other components used, in the original article...

Like transistors (one or several), together with the POT to control current. But PWM outputs can control transistors just as handily.

And if one POT can be used to control a high-wattage transistor for a string of LED modules, one PWM output can also control the transistor...
Feb 9, 2009. 5:09 AMgmoon says:
Oh, my bad--I didn't notice you wanted "independent control."

But you still can't reliably control a 2+ watt module with a 1/3 watt POT. You'll probably need a couple transistors per LED module. Or a voltage regulator and a transistor, per module.

Here's a nice instructable; it has some "constant current" LED drivers. You'll have to modify them to be variable current (they are controlled by resistor values.)

But if you don't grok the simpler electronic math ( Ohm's Law isn't that complex or bizarre) , then it won't be trivial to redesign the driver.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!