Constant current power supplies

find a tiny, cheap, constant voltage power supply that isn't already stuck inside a wall wart to experiment with.

The simplest would be your cell phone / usb chargers. Buy one and break it apart.


That is one of those gated oscillator smps types: it turns itself on/off between 1.69v - 0.8v (on the feedback pin), making it suitable for low-power applications but largely not usable for a device needing a constant voltage.

The grandfather of those designs are the Linear LT1107.

@ dhenry I think you have some details incorrect... Again. The first switchers I remember were made WELL before integrated designs for chips were out of the development stages., Remember PWM? it was in discrete form (3 or 4 IC's) and the real cheap ones used a flyback oscillator... and a linear regulator. I remember the first one I saw, very clearly... It was plugged in and promptly went up in smoke, along with a $300.00 basic 4 function calculator.


Bob, I think he was talking about the designs to turn off the device. In 'the good ol days', they used and on-off switch and a human to turn them off. Later, inactivity timers took the job on and did a pretty well. These days, they actually sample the current and shut down when the battery or other device their hooked to stops pulling current; actually, they don't shut down completely, just drop really, really low. It's a green thing.

It's a green thing.

A gated oscillator is actually quite different from what you were talking about.

OK, I give up.

the LNK chip seems to be exactly the sort of thing you’re hoping that the LED drivers would supply. A small and only marginally regulated replacement for “ye old” 60Hz transformer and DC rectification circuit, that converts AC line voltage to something appropriate for the input to Arduino-like circuits, in a hopefully cheap circuit. That’s what it says in the datasheet:

LinkSwitch-LP switcher ICs cost effectively replace all unregulated isolated linear transformer based (50/60 Hz) power supplies up to 3 W output power.

dhenry is also correct that it’s a gated oscillator circuit. It says THAT in the datasheet too:

Unlike conventional PWM (pulse width modulation) controllers, it uses a simple ON/OFF control to regulate the output voltage.

With the suggested circuit having 220uF of output capacitance, and probably running that gated oscillator “as needed”

A lot of the confusion seems to surround the use and mis-use of the term “constant current” WRT power supplies.
A proper LED driver should a TRUE constant-current supply, holding the current constant by varying the output voltage “quite a bit”, in order to accommodate at least variations in Vf of the LED string, and perhaps a relatively wide range of number of LEDs in series. You can see this on chips specifically designed to be LED drivers; for example the Allegro Micro LC5220 series supports Vled of 6 to 90V in its “buck mode” configuration. (Datasheet) Meanwhile the “CCCV” supplies are more “Constant voltage first”, with some current limiting capability, and “well defined behavior” as the current increases beyond the limit (unlike, say, a 7805-style regulator.) I don’t know whether these chips are designed to be operated in their constant-current “operating region”; it looks more like the CC feature is a protection mechanism. It might take a power-supply engineer to figure it out :frowning:

So… Does a random “LED Driver Module” do anything useful, WRT powering hobby electronics? The fact that they’re advertised as “3 x 1W driver” or similar implies a pretty low output voltage range, so they’re probably not “true” constant-current drivers. And there’s no sign that any two supplies operate similarly, or use the same circuits. You might get lucky, or you might not, and I don’t think there is any way to tell without either getting much more detailed specifications than tend to be listed on eBay, or actually buying one and analyzing the circuit and/or behavior.

Given the average level of Power-supply-design expertise of Arduino forum readers (“nil”), I find the suggestion that they might be able to use some random cheap LED-driver module from eBay as a power supply to be … dangerous. That’s probably the reason that tempers in this thread are running a bit hot.

Given the average level of Power-supply-design expertise of Arduino forum readers ("nil"), I find the suggestion that they might be able to use some random cheap LED-driver module from eBay as a power supply to be ... dangerous. That's probably the reason that tempers in this thread are running a bit hot.

Don't misunderstand, I'm not trying to insult you but, BULL! Go back and look at the very first page and the first few posts. With the exception of Lefty, all the posts are insulting and sarcastic. But, I've gotten used to that over the years; it seems there is always a race to be the most deprecating first. If one is really worried about the newbie getting in over their head and blowing something up or getting shoved across the room by mains voltage, just say so. Something like, "This is messing with mains power and can really hurt you, and here's why it may be a bad idea" would probably do the trick.

And you folk that do this kind of thing know full well who you are.

Like I said, I keep coming back here because there are a large number of really helpful folk that actually respond.....eventually.

Go back and look at the very first page and the first few posts. With the exception of Lefty, all the posts are insulting and sarcastic.

I think you get what you deserve and in this case it is dhenery.

What do you expect from such a washy washy question coupled with your arrogance.

And, there's a perfect example right on cue. Thank you so much for your timeliness.

Did it ever occur to you that it really IS a stupid idea to connect cheap unapproved devices to your power mains? Save $2, burn down the house.

Yep, it sure did. That's a big part of why I posted here asking for thoughts about the idea. It wasn't until westfw posted the link to the video though that safety was mentioned, and it never became a big item of discussion. But, with all the (apparent) fake certifications that seem to be stuck on various devices, you can't be sure that something is actually certified or not; remember the one in the video had certifications on it.

But, that's all part of an arrogant, wishy washy question I guess.

PS, I apologize. I know you're being light hearted and friendly; I'm just a bit stung right now and will recover soon.

dhenry: Straight out, it is unlikely something like this can be used for a device needing a constant voltage.

The topology, however, is likely a fly-back smps - assuming that it is isolated. That means the led string is floating above a current sampling resistor that controls the output voltage to maintain that constant current (thus constant voltage over the current sampling resistor - likely via a zener + optocoupler).

So all you need to do is to identify that resistor and put in place a divider. That resistor is very easy to identify: it must be between the cathode (led-) and the ground.

After that, you have turned this constant current regulator to a constant voltage regulator.

I have a similar problem and try to use these power sources. Little bit wiser after reading the thread I bought 12V LED drivers,the no power drain voltage slightly exceeds this limit with 13.5 volts. I did identify the resistor between ground and cathode, however would need little bit more info what divider to use (my learning curve is steep, but really not that I know a lot). Are you reffering to simple 2 resistors like explained here ?

With respect to the post in question, modifying a … well, let’s be charitable and call it a “low cost” supply… is not a good idea. One thing I’ve noticed about some of these cheap-as-dirt solutions is they make it a point to ride the thresholds of all the components involved. Caps passing 15vDC will be rated at 15vDC for instance. You have very little margin for error, and an otherwise simple change could remove what remaining grasp on stability it has in the first place.

Further, with all due respect to the OP, using a constant current supply to power a device designed for constant voltage is not novel, it’s not “thinking outside the box”, not clever, not frugal… it’s just wrong. CC supplies are the wrong tool for the job. Can you hack it to work? Yeah, maybe. Or you can just use the right tool. Why would you risk the “load” device and the “supply” device trying to force the supply into doing something it wasn’t designed to do, when there are no shortage of devices actually designed to do it? There’s no sense in it, beyond a one-time experiment to say you managed to do it.

And yes it will be noisy. PSU noise is defined as undesired variation in the supply voltage. Guess what a CC supply does? It varies supply voltage! It’s not intended to be a low-noise supply. You put additional demands on your (redundant) regulation and filtering stages trying to undo the mess you made with shoe-horning the wrong device in there.

Look, I understand cost-cutting, but this race to the bottom for the cheapest way to turn overwhelmingly powerful sources of energy into something to power our pet projects is foolhardy. I’m not trying to be insulting, but this is serious stuff. For reals. Everyone picking up a soldering iron needs to understand when it’s OK to cut costs. Where life safety – and not JUST YOURS, by the way – is involved, that is the wrong place. Be a big shot. Spend $15 on a safe, credentialed PSU.

I am genuinely sorry for any hurt feelings this causes, but I’d rather see you all flame me than hear about your funeral. And the many… many… voices of reason along the way trying to (IMHO) gently explain why this was a bad idea from post one fell on deaf ears. So I’m going to be blunt because I care.

As far as I'm concerned, you're beating a dead horse here. (that's an Americanism for wasting your time) I started this thread to see what the possibilities of using a tiny, very low cost, ubiquitous power supply might be. The idea of a power supply that can fit inside a really small enclosure was appealing to me (and others out there), but it was a bad idea as the more 'normal' posters pointed out by mentioning noise, inadequate isolation, and safety. To the best of my knowledge, you're the first to mention durability.

As for hacking things, don't we all do that to varying degrees? Isn't that the point for a lot of us?

Your concern is appreciated and your polite manner is appreciated even more.

You're probably right, but I was inspired by the previous post by mkrsjak asking for more detail on modding a CC supply to be a CV supply. Generally, I hate answers like "if you have to ask, you're not ready to know" but this is one of those places I think it may be appropriate. There's a lot to be said for trial by fire, but this could literally result in fire, trial, or both. Not that any project in hobby electronics is intrinsically safe necessarily, but if you need help creating a voltage divider, you should probably hold off on modifying power supplies. I really don't mean that to be condescending, just more of a crawl-then-walk thing.

Keep in mind one thing: There are companies of all shapes and sizes that make electronics. I'm sitting right next to a stack of Juniper routers with T1 and DS3 and OC-xx interface cards. They make all that stuff, but... Juniper does not manufacture power supplies. They buy them from established companies that do that one thing and do it well. I expect there are engineers at Juniper that could build one, but the agency certification process and the liability of something goes wrong is such a barrier to entry that they'll stick to simple things like 6-layer PCBs clocked at multiple GHz.

I'm not going to lecture people about their choices, we're all adults and I'm no one's father. All I ask is that -everyone- consider these things when searching for the smallest, cheapest, simplest looking trinket to be found on eBay that says it'll convert mains voltage to.. anything. I hope this is a horse that still has one last breath. :-)