Arduino Forum

Using Arduino => General Electronics => Topic started by: draythomp on Nov 30, 2012, 11:56 pm

Title: Constant current power supplies
Post by: draythomp on Nov 30, 2012, 11:56 pm
Has anyone else noticed that there are a ton of constant current power supplies out there for extremely low prices that are very small and quite powerful?  I've got a couple I'm experimenting with that supply 6-11 volts at 350ma.  I take it that that means they go as low as 6V and as high as 11V trying to supply 350ma to a fancy led or string of leds.

Well, why can't we hook one of those up to an arduino and have it run just fine.  There's already a regulator on the arduino that will take the incoming voltage and hold it at 5V for the board, so it shouldn't matter that the CCPS (constant current power supply, I just made that up) is varying its voltage as the current load changes.

Right???  Thoughts.
Title: Re: Constant current power supplies
Post by: Grumpy_Mike on Dec 01, 2012, 12:06 am
I have no idea what you want to acheave by connecting an arduino to a constant current supply. You will just end up supplying the maximum voltage into the arduino's vin pin.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 12:17 am
The supplies are amazingly cheap, on the order of a couple of bucks a piece and small, on the order of 1/2 x 3/4 x 1/2.  They hook directly to wall power, 85 - 265 VAC is not uncommon.  And, they're available all over the place.

One could put an entire arduino, power supply and all in a wall wart size package to do some project or other.

Such an item (cheap, small, common) doesn't exist for constant voltage supplies unless you gut one of those tiny wall warts, and that's a pain sometimes.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 02:20 am
go to ebay and take a look at LED power supplies.  There should be about a thousand or so.  Here's the link for the first one I found:

http://www.ebay.com/itm/Led-Driver-6-12x2W-Inside-Driver-Power-Supply-for-E27-GU10-Led-Light-Lamp-2pcs-/110982585621?pt=Lamps_US&hash=item19d713dd15

And, that was just a basic search.  Alibaba, sourcingmap, etc have many, many of these at prices that made my jaw drop.  I have two that I bought (quantity 1) for 3.95 free shipping.  If I bought ten of them and redeemed the coupon I got I would have gotten them for about .80 cents each (still free shipping).
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 02:32 am

go to ebay and take a look at LED power supplies.  There should be about a thousand or so.  Here's the link for the first one I found:

http://www.ebay.com/itm/Led-Driver-6-12x2W-Inside-Driver-Power-Supply-for-E27-GU10-Led-Light-Lamp-2pcs-/110982585621?pt=Lamps_US&hash=item19d713dd15

And, that was just a basic search.  Alibaba, sourcingmap, etc have many, many of these at prices that made my jaw drop.  I have two that I bought (quantity 1) for 3.95 free shipping.  If I bought ten of them and redeemed the coupon I got I would have gotten them for about .80 cents each (still free shipping).


Well check out what I bought a few days ago in the power supply regulator section of E-bay. Five buck switching regulators for $1.53 each. At that price I bought 5. Plus free shipping  ;)

http://www.ebay.com/itm/251066005460?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Lefty
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 04:25 am
taken from the web (as usual):

LED Drivers: are current control devices that replace the need for resistors. LED Drivers respond to the changing input voltage while maintaining a constant amount of current (output power) to the LED as its electrical properties change with temperature.

And, that's why they are rated with varying voltage and a single current rating.  The point is not to argue about the definition of constant current, or whether or not a particular device fits one's definition completely, the point is they are incredibly small, cheap and available.  After I get done with some testing, they may represent a really cheap and small method of powering small smart devices from wall power without a wall wart and a bunch of circuitry that takes up space.

And, Lefty, that was a heck of a find.  NIce job.  I love using those little things to battery power devices.  My problem has always been that I have exactly zero skill at making low power devices.  I can measure and control 440V three phase welders with the best of them, but I can't make a darn battery last over night......sigh.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 06:33 am
That yellow thing is the transformer that's normally used on a switching power supply, not a step down transformer.  And, as for price, I already told you the deal I got on two of them by just searching around a little bit.  The example I cited was simply the first one I came across on ebay; there's tons of them out there in many, many configurations and prices.  Once again, these things are constant current supplies and would require a voltage regulator to keep the voltage correct for a processor circuit; maybe an extra 50 cents or so if the board doesn't already have one.  The ones I have supply a constant 350ma until the load resistance drops enough to cause it to shut down.  On the high side, they max out at a little over 11V and don't go any higher.  Carefully hooking it to the VIN on an arduino (UNO), they seem to work fine.  The problems may come when the combination of arduino and other devices need more than the 350ma and the thing shuts down.  But I won't trust it until I have much more experience with it.

It's obvious that you only want to argue rather than look into possibilities for cheaper smaller devices, so get the wall wart and be happy with it; I have dozens of them and they work fine if you want that kind of thing.  I also gut them and use the power supply inside directly for some projects.

However, if one wants a self contained device that just plugs into the wall and works in the smallest possible size, there may well be better solutions.  That's what I'm exploring.
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 06:44 am
I don't see the point.

1) Arduino is designed to be connected to a constant voltage power supply.
2) Constant voltage power supplies are equally common and cheap.

Essentially, you're buying "wall wart guts", but not the type that Arduino was designed for...

You can add that a supply designed for LED lighting may not provide isolation from the house power wiring, making it suitable for self-contained lamps of various sorts, but NOT for an experimental device like an Arduino with exposed wiring that you poke your fingers at.

Also, cheap Chinese import power supplies (of all types) are getting significant publicity recently for being poorly designed, lacking safety certifications (and in fact having poor safety design aspects that would make it impossible to get safety certifications), and having very questionable performance (poor regulation, high ripple, etc)  For example http://www.youtube.com/watch?v=T88ej64aXUM
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 07:07 am
westfw, that's the kind of response I was looking for.  Good point about the isolation, I'll check that in the next few days, but I suspect you're right in that there may well be a potential difference that sets the Arduino above ground and could cause problems.  Regarding Chinese manufactured power supplies being crappy, I've see good ones and bad ones.  However, I haven't seen wall warts or small power supplies that were made anywhere else.

Every cotton picking one I have in the house was made in China, even the ones that are 10-15 years old and are stored in a box in the garage.  The one that powers my Japanese alarm clock was made in China???  So, it appears that we're stuck with Chinese devices until we start building our own in the garage.

The point I'm trying to get to is that I'm tired of the power supply for the device I'm building being twice the size of the device itself and having a big lump that plugs into the wall.  Things got a little better when Apple came out with their small USB supplies (also made in China), but it's still annoying.
Title: Re: Constant current power supplies
Post by: Chagrin on Dec 01, 2012, 07:23 am
The ones I have supply a constant 350ma until the load resistance drops enough to cause it to shut down.  On the high side, they max out at a little over 11V and don't go any higher.  Carefully hooking it to the VIN on an arduino (UNO), they seem to work fine.  The problems may come when the combination of arduino and other devices need more than the 350ma and the thing shuts down.


But isn't that an important issue? These LED drivers are sensitive to the load they're driving; too little load and they shut off, too much load and they shut off. Only under fairly specific circumstances would you have a circuit that could keep that constant load.
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 07:26 am
Quote
I haven't seen wall warts or small power supplies that were made anywhere else.

Good point.  The danger sign is probably "cheaper than it seems possible", rather than "made in China."
Although "shipped direct to you from China, bypassing regulatory approval processes" is probably also a bad sign.
The Apple USB-supply cube is impressive engineering (much smaller than the LED supplies you linked), now widely (and sadly) "faked" with a much less worthy/safe circuit.  Much of the recent publicy has surrounded fake Apple chargers.  http://www.youtube.com/watch?v=wi-b9k-0KfE
http://www.arcfn.com/2012/03/inside-cheap-phone-charger-and-why-you.html
(Real Apple or Amazon chargers aren't "inexpensive.")
Title: Re: Constant current power supplies
Post by: krupski on Dec 01, 2012, 07:30 am

Has anyone else noticed that there are a ton of constant current power supplies out there for extremely low prices that are very small and quite powerful?  I've got a couple I'm experimenting with that supply 6-11 volts at 350ma.  I take it that that means they go as low as 6V and as high as 11V trying to supply 350ma to a fancy led or string of leds.

Well, why can't we hook one of those up to an arduino and have it run just fine.  There's already a regulator on the arduino that will take the incoming voltage and hold it at 5V for the board, so it shouldn't matter that the CCPS (constant current power supply, I just made that up) is varying its voltage as the current load changes.

Right???  Thoughts.


A constant current source (theoretically) would supply infinite voltage if it were open circuited. Of course, real-world current sources are limited by their design. The maximum open circuit voltage is called the "compliance" voltage.

If you tried to power a voltage regulator (like the input to an Arduino board) with a constant current source, one of two things would happen:

(1) if the Arduino needed more current that the CC source supplied, the voltage would be too low and the Arduino would not even boot up.

(2) If the current source was set to a higher current that the Arduino required, the current source would swing right up to it's maximum voltage (the compliance voltage).

Since both 1 and 2 are worthless :) You see that you don't want to power an Arduino (or most anything else) with a constant current source.

What they ARE good for, however, it powering LED's and LASER DIODES. These devices have a nominal forward voltage drop, but it varies from part to part and varies with temperature. You NEVER want to power an LED or laser diode with a constant VOLTAGE source.

A constant current source is like an "electronic spring". It will flex - give and take a little bit to accommodate the LED or laser. The nominal voltage drop across the LED or laser, times the constant current equals the input power to the device. As the device warms up, it's forward drop will change slightly, and the current source will simply adjust itself and keep providing the correct current to the device.

Without the electronic "spring" to take out fluctuations in operating parameters, the device could work fine one minute and burn out the next.

That's why, in simpler setups, you always use a resistor in series with an LED... to limit the current. The resistor acts like an electronic "spring".

Did all this make sense?
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 07:57 am
The little transformers provide ("are supposed to provide") as much isolation as the traditional large "step down transformer."  They can be smaller because they operate at a much higher frequency.  You can think of a switch-mode power supply as modulating the high-voltage side of the supply so that the frequency and waveform are varied in a way that causes them to provide exactly the right amount of power needed by the load.
Title: Re: Constant current power supplies
Post by: krupski on Dec 01, 2012, 08:00 am

The little transformers provide ("are supposed to provide") as much isolation as the traditional large "step down transformer."  They can be smaller because they operate at a much higher frequency.  You can think of a switch-mode power supply as modulating the high-voltage side of the supply so that the frequency and waveform are varied in a way that causes them to provide exactly the right amount of power needed by the load.



So George Westinghouse was right after all?  :)
Title: Re: Constant current power supplies
Post by: be80be on Dec 01, 2012, 08:18 am
I read this stuff and wounder is this for real. Constant current supply's Are mainly used for driving Led's or led displays, Now there no way anyone can tell the OP any thing about his supply that's not a guess. Now if he would run down the chip used on this we would have a place to start. I use a constant current led driver you set the dang thing to 25 mA which is changeable in code to a point meaning you can change the range a little up or down to hit the 25 on the head.

Let's see a show of hands how many of you have used cel phone charger even like the iphone charger  or any of the newer smart phone chargers. Well how may hands are up in the air Guess what there constant current supply that do to things one
there output is fixed at 5 volts till you over load them then it drops off to a point that they shut down.

So the bottom line is if this doesn't put out more then the happy 7 to 12 volts it would work fine as long as it doesn't need to be loaded.

But you may have to add filtering and a regulator to keep the power clean and under the happy zone of 12 volts to 7.  
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 08:30 am
Quote
Let's see a show of hands how many of you have used cel phone charger even like the iphone charger  or any of the newer smart phone chargers. Well how may hands are up in the air Guess what there constant current supply that do to things one
there output is fixed at 5 volts till you over load them then it drops off to a point that they shut down.


Not sure what you are trying to say here exactly. However as far as cell phone charger modules most are indeed just fixed DC voltage regulators, typically rated at 5.1 or 5.2 vdc output and at some maximum current rating. The chip that handles how much constant current to allow to charge the phones Li battery and when to shutdown charging current when the cell is fully charged is inside the phone itself. I find these power modules at second hand stores for usually $1-2 and they work fine for powering small digital projects drawing an amp or less.

Lefty
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 08:48 am
I believe that the root of the question is essentially: "look!  Cheap switchmode power supplies being produced in the millions for the LED lighting market!  While they're supposed to be "constant current", don't they have a practical limit on output voltage that falls in the range needed at the input of an Arduino?"

Answer: maybe.  But the cheap switchmode power supplies being produced by the millions for the cellphone/etc market are more appropriate and not that different in price.  (although, the price goals of the supply for a $10 lightbulb are probably lower than the goals for the supply for a $100 cellphone/videogame/whatever.)
Title: Re: Constant current power supplies
Post by: be80be on Dec 01, 2012, 08:56 am
Cel phone charger are a constant current supply fixed at 5 volts. That's the newer one's like the iphone use's and most smart phones use

What part don't you understand I'm talking about the charger that plugs in the wall
not how it disconnects the battery from it.  
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 09:09 am

Cel phone charger are a constant current supply fixed at 5 volts. That's the newer one's like the iphone use's and most smart phones use

What part don't you understand I'm talking about the charger that plugs in the wall
not how it disconnects the battery from it.  


No, you are giving these cell phone charger modules more functionality then they actually have. I've used many in my projects, they put out a constant regulated +5vdc voltage only, and not at a constant current. I have wired one up to power my arduino board via It's 5V and ground shield pins and the board draws about 80ma and the voltage is fixed at 5.1vdc. The constant current part is performed by a chip inside the cell phone that handles the chore of properly charging the battery at a proper constant current, using the regulated voltage supplied by the external cell phone charger module.

Again a typical 'cell phone charger module' is simply a switch mode DC voltage regulator outputting a regulated nominal +5vdc (most are rated at 5.1 or 5.2vdc) and can supply any current demand from 0 to typically 1 amp.

Lefty
Title: Re: Constant current power supplies
Post by: be80be on Dec 01, 2012, 09:15 am
I not giving them any thing there I just tested about 100 of them as to there rating
and did a lot of digging on the net

Quote
TND329
5 W Cellular Phone CCCV
(Constant Current Constant
Voltage) AC-DC Adapter

better charger like the smart phones and iphone use these in them and there
Not this same chip but one like it.
Quote
This reference document describes a built-and-tested,
GreenPoint solution for a cellular phone Constant Current
Constant Voltage (CCCV) AC-DC adapter. This design is
intended for isolated, low power, universal input off-line
applications where a constant current/constant voltage
output (CCCV) is required for charging NiCd, NiMH,
Lithium-ion or similar batteries. Typical applications would
include cell phone chargers or cordless phone chargers.


Back to the Op you may be able to use the supply you posted if like I said they fit the happy spot of 7 to 12 volts but may need to add a regulator and filtering  

See I have a bunch of these old ones and new ones and got to wondering why some of the old one where no way near there rated voltage and the newer one where dead on 5 volts and I got my kids two new phones so we had 4 of the same
chargers that open the door to cut one open and have a look and as I figured
they have CCCV
So draythomp test it for output voltage and see what it is you may be able to use
the E-Bay supply but I have to say one thing if the output is 350mA and it's 2 watts it's only good for about 5.7 volts at that load
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 09:37 am

I not giving them any thing there I just tested about 100 of them as to there rating
and did a lot of digging on the net

Quote
TND329
5 W Cellular Phone CCCV
(Constant Current Constant
Voltage) AC-DC Adapter

better charger like the smart phones and iphone use these in them and there
Not this same chip but one like it.


Well I guess we will just continue talking past each other. I will state that from an ohms law point of view that a 'constant current constant voltage output 'module' could only work with single fixed value resistance load, and thus would be of very limited usefulness. You can't have both a constant current and a constant voltage at the same time with a variable resistance load.

A DC power supply module either changes it's output voltage to maintain a constant current when presented with variable resistance loads, or it maintains a constant voltage by supplying more or less current to match a variable resistance load, it can't do both simultaneously except at one 'perfect' load resistance value.  I've used these modules with different value loads, the current didn't stay constant but the voltage did, hence they are indeed simply fixed output voltage regulators.

If you study the datasheet for the TND329 device you talked about, you will find that it is in fact a regulated constant voltage regulator when operating at any current demand from 0ma to 1 amp. If however the load attempts to draw more then 1 amp (load resistance decreases below 5.1 ohms) the module enters a current limiting mode where it will lower it's output voltage to maintain the maximum current drawn by the load to a constant 1 amp value. So that one acts like a simple fixed 5.1vdc output voltage regulator up to it's maximum rated output current, above that value it enters a fixed current limiting mode by lowering it's output voltage to maintain 1 amp. So no ohms laws broken and does never at any time maintain a constant current and a constant voltage at the same time, the load resistance always has a say in the matter.

Lefty
Title: Re: Constant current power supplies
Post by: be80be on Dec 01, 2012, 10:03 am
lefty I'm not trying to get you mad or any thing but your missing a part here

Take a Iphone charger there made to do to things one is supply 5 volts .
Now if the battery is dead you want a fast charge these supply's can dump a amp on the battery and still keep the voltage at 5 volts and charge current at there rating but at no load they just keep the voltage at 5 volts they use CCCV

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&ie=UTF-8#hl=en&sugexp=les%3Bernk_cprob&gs_nf=3&gs_rn=0&gs_ri=hp&gs_mss=cel%20phone%20chargerconstant%20current&tok=uaof38zD-Ak5L0pEYPwIcQ&cp=34&gs_id=k&xhr=t&q=cell+phone+charger+constant+current&pf=p&tbo=d&sclient=psy-ab&oq=cel+phone+charger+constant+current&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=de6c3c9910299377&bpcl=39314241&ion=1&biw=1137&bih=570
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 10:05 am
I'm pretty sure that a constant current switchmode power supply (LED Driver) and a constant voltage switchmode power supply (cell phones) are awfully similar.  One would take feedback from the load voltage, and the other would take feedback from current sense resistor om series with the load.  Any switchmode chip ought to be able to implement either type of supply with minor changes in wiring.

In "Lab" power supplies, "CCCV" generally means "constant voltage with a current LIMIT", and defines the way the supply behaves when the current limit is exceeded.  This is supported by the TND329 datasheet:
Quote
(section 5: "Circuit operation")
For output currents less than 1 A the circuit performs as a constant voltage source.  ... Although very simple, this current sense circuit will provide a constant current output of approximately 1 A all the way down to an output voltage of 1 V.

In other words, a "CCCV supply" provides a constant voltage up to the current limit, and then decreases the voltage as needed not to exceed the desired current.  (as opposed to simpler regulators, that might just shut down in over-current situations.)  Some Li-ion battery charging chips assume that the power supply has a current limit built-in to it, but a cell phone supply will normally operate in a constant voltage mode.

In general, that's not quite the behavior you'd want from an LED driver style of CC supply.  In that case, you want the voltage to go to any value needed to force the target current through the load.  This permits you to use varying numbers of LEDs in series in your light, for instance.   I haven't studied the current flood of "LED driver" chips to see how they're different from other switchmode chips; there may be other simplifying factors that permit a cheaper design and justify having a separate chip (oh, like not needing to provide clean DC, for instance.)
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 10:18 am

I'm pretty sure that a constant current switchmode power supply (LED Driver) and a constant voltage switchmode power supply (cell phones) are awfully similar.  One would take feedback from the load voltage, and the other would take feedback from current sense resistor om series with the load.  Any switchmode chip ought to be able to implement either type of supply with minor changes in wiring.

In "Lab" power supplies, "CCCV" generally means "constant voltage with a current LIMIT", and defines the way the supply behaves when the current limit is exceeded.  This is supported by the TND329 datasheet:
Quote
(section 5: "Circuit operation")
For output currents less than 1 A the circuit performs as a constant voltage source.  ... Although very simple, this current sense circuit will provide a constant current output of approximately 1 A all the way down to an output voltage of 1 V.

In other words, a "CCCV supply" provides a constant voltage up to the current limit, and then decreases the voltage as needed not to exceed the desired current.  (as opposed to simpler regulators, that might just shut down in over-current situations.)  Some Li-ion battery charging chips assume that the power supply has a current limit built-in to it, but a cell phone supply will normally operate in a constant voltage mode.

In general, that's not quite the behavior you'd want from an LED driver style of CC supply.  In that case, you want the voltage to go to any value needed to force the target current through the load.  This permits you to use varying numbers of LEDs in series in your light, for instance.   I haven't studied the current flood of "LED driver" chips to see how they're different from other switchmode chips; there may be other simplifying factors that permit a cheaper design and justify having a separate chip (oh, like not needing to provide clean DC, for instance.)



Yes, you have explained it all very well and better then me I' sure. There is a difference between a DC power module that has automatic current limiting protection and a true constant current regulator. I'm just trying to make sure that people understand that ohms law is still applicable here no matter what name a DC power module uses.  ;)

Lefty
Title: Re: Constant current power supplies
Post by: krupski on Dec 01, 2012, 10:27 am

Let's see a show of hands how many of you have used cel phone charger even like the iphone charger......


Let's see a show of hands how many of you built your first computer in the 1970's with an 8008, 256 bytes of static ram and toggle switches for address and data input.

Let's see a show of hands how many of you know the difference between a triode and a pentode (and have actually built circuits using both).

Lots of people here have forgotten more about electronics than you know. Don't be smug.

(rant off).
Title: Re: Constant current power supplies
Post by: Grumpy_Mike on Dec 01, 2012, 10:31 am
Me on all counts, although it was 2650 processor and it was 1976.

Quote
Cel phone charger are a constant current supply fixed at 5 volts

That sentence is so wrong unless the charger has the ability to change the impedance of its load. But as others have pointed out this is just sloppy talk.
Title: Re: Constant current power supplies
Post by: dhenry on Dec 01, 2012, 11:30 am
A constant voltage smps can be easily modified to become a constant current power supply.

The same holds true for a linear power supply.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 06:33 pm
Wow, I finally got a discussion started.  Thank you folks.

A bit more inspection of the device shows that it really can power an Arduino, but there are things that concern me.  First, it does have a top voltage limit (open circuit) that falls within the range an Arduino can handle as well as a current limit that, when exceeded, shut it down.  It doesn't taper off, it just quits.  The killer though is that it is very noisy.  I don't have a scope so I can't paint you a picture of the noise, but measuring voltage through various capacitors to block the DC shows a substantial noise or ripple coming out of the supply.  Comparing that to an apple two board wall wart ( one of the 1 inch cubes ) the apple one has almost no noise at all and the CC supply has a ton.  This noise wouldn't make any difference to an LED, but it could to a more complex device, and it appears the Arduino has enough filtering on board to work.  This may not be true of something that I threw together in the garage one evening.

I can't tell you what the chips are that it uses, the markings are blurred or missing on almost every part; the inductor has rings, but I can't tell exactly what colors they are.  You've all seen this before. 

Regarding the size, the two CC supplies I have are about 3/4" x 1/2" x 1/2", and I got two of them under 5 bucks, so you see why they are appealing as a possibility.  Remember, the link I posted was just the first one I hit on ebay, that may have been a mistake since several folk grabbed on that as a negative.  The point was that these CC devices are incredibly easy to find and don't cost much, which only a couple of people noticed.  Tiny little constant voltage supplies that run off wall power are not anywhere as numerous or cheap.  I venture to say that you'll find 10 or so CC led supplies or more for each little CV supply and they'll cost substantially more (not counting getting a usb charger and gutting it).

In answer to the various comments about the apple chargers ( 1" cubes ) the one I have torn apart provides a constant 5.1 volts regardless of the state of the battery in the device it's hooked to.  If I hook it to a resistor and force it past the rating of 1A by lowering the resistance, it drops below the 5V level until it reaches some point where it shuts off.  That's usually just after the resistor burns a blister on my hand.  This little device lists a ton of certifications on the bottom in print so small I have to get the big magnifier out to read it.  So, it appears that something in the device with the battery helps the charge cycle along somehow.  I don't own a single apple device to look at to see; I probably wouldn't pull an expensive device apart to check either.

See, I don't just discount a possibility simply because it doesn't have the right name; I want to actually see if it will work or not.  Bouncing it off other folks helps fill in the gaps that I don't think of or understand (yet).  That's why I asked for your thoughts in the very first post.

Your various comments led me to check for noise in the output, so I don't think this particular kind of device is the answer to my need for a tiny power supply, even if it was a compelling possibility.

Title: Re: Constant current power supplies
Post by: dhenry on Dec 01, 2012, 07:00 pm
Get a scope and put it on that sucker, you will be surprised.

Mine (a large collection of apple stuff) shows 100mv or so Vpp, ranging well into Mhz. Linear regulators have practically zero rejection to those ripples.
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 07:57 pm
Quote
300mA+/-5%. Now, why on earth would I want to power my Arduino board using something
like this?
Can anyone explain why my board would want to have a device trying to drive a
fixed 300mA current into it? Makes no sense, unless maybe the p/s were jiggered after the
fact.


You would never want to power an arduino board with a true constant current power supply. An arduino board with nothing wired to it's output pins or 5V or 3.3 pins draws only around 80ma, and a true CC power source would raise it's output voltage as high as it could trying to force 300ma into the arduino board, which would most likely burn up many components on the board due to the high voltage.

There are some Asian DC constant current LED driver modules designed to power 1 and 3 watt power leds that also have a TTL level input that allows for PWM control for the module effectively allowing a dimming function if one wants to use such a feature, or as a simple on/off control using an arduino digital output signal. However you have to look carefully at the maximum PWM frequency that is allowed for the specific CC drivers that have this extra feature.

Lefty
Title: Re: Constant current power supplies
Post by: westfw on Dec 01, 2012, 08:43 pm
draythomp: can you post a link to the actual modules that you have purchased?  And/or photos or reverse-engineered schematics (without chip numbers, since they're unreadable.)
eBay will let you link to completed auctions for quite a while after they're over...

Also, what voltage to these end up putting out when you connect them to an Arduino?
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 09:05 pm
Here's the closest thing to what I got that is on their website.  I actually ordered it through sourcing map and they don't have it up any more.  After I got it and played with it a little there was a series of mails back and forth with them in extremely broken English and Chinese (we were both using google translate) to determine the lowest voltage (6V) and the highest (12V) instead of what's on their site.  Seems there was a mistake somewhere.  I paid practically nothing for them; I'm unclear on the exact price though because there was a few cents adjustment after shipping for currency differences that happened during the day or so it took to get it actually ordered.

http://www.microtek-led.com/ArticleShow.asp?ArticleID=116

So, you see that the voltage, 6-12, was right in the sweet spot that the arduino likes and its regulator would take care of the voltage, and of course, experimental results were different from either the specs or the conversation.  I was pretty bummed when I saw how much noise it puts out, but nothing ventured, nothing gained.

Letfy, you're right, no one (well maybe me) would want to put a perfect constant current supply on any device that has some limits on acceptable voltage; it would blow up in a heartbeat.  However, there ain't no perfect CC supply, and this ones parameters showed possibilities for a really cheap and easy power supply.

oric, you don't have to do this.  I never suggested you do this.  Don't do this.  For crying out loud, I brought up a subject for discussion and got attacked like a teenager that told her dad she got a tattoo on her face.

I asked for thoughts, not a diatribe.
Title: Re: Constant current power supplies
Post by: retrolefty on Dec 01, 2012, 09:09 pm
Quote
For crying out loud, I brought up a subject for discussion and got attacked like a teenager that told her dad she got a tattoo on her face.


Good, so you learned a lesson.  :D

Lefty
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 09:12 pm
Yep, I ain't never getting no darn tattoo on my face.
Title: Re: Constant current power supplies
Post by: dhenry on Dec 01, 2012, 09:12 pm
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.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 01, 2012, 09:37 pm
Sorry folks, I just have to do this:

<flame_on>
Oh, for goodness sake, I asked a question.  Yes a question.  I started off light-hearted and wanting to have fun with the possibility, then I was told that I was basically an idiot for even bringing up the subject, it wasn't constant current, had a step-down transformer, didn't have certifications, it didn't make sense to attempt such a thing, and that others would never ever do such an unsafe thing.  Fine, don't do it.

As for the number of people that thought it was a bad idea, a couple of them actually said something reasonable about why it might be a bad idea.  Things like isolation, noise, etc.  That's the kind of thing the inexperienced folk should be learning, not that someone THINKS it's a bad idea because they hadn't looked into the possibility.

The tone of this board is sad.  I tolerate it because there are a lot of people that have really good ideas and experience that have helped me a lot in the past.  However, there are some that just want to belittle the poster as quickly as they can.  I'm way too old to be put off by people that use sarcasm as their initial response because I know there are others that will contribute really good ideas.

So, thank you very much to the folks that came up with good suggestions and novel ideas; the rest of you,...

Have a nice day.
</flame_on>
Title: Re: Constant current power supplies
Post by: dhenry on Dec 01, 2012, 10:19 pm
Quote
I just have to do this:


It is a process thing: you will learn to talk to those whom you can talk to and don't talk to those whom you cannot talk to.

Title: Re: Constant current power supplies
Post by: westfw on Dec 02, 2012, 12:37 am
Quote
http://www.microtek-led.com/ArticleShow.asp?ArticleID=116

It looks very much like the "fake" Apple power supplies (one or two transistor flyback), though not misleadingly labeled and bare for anyone to look at the details (and nicely priced, and not needing "decasing.")

It doesn't look like they'd come much closer to meeting safety specs.  I love the "fuse" implemented as a squiggly little trace on the PCB (clever and probably effective, but probably not "legal.")
Title: Re: Constant current power supplies
Post by: be80be on Dec 02, 2012, 03:24 am
Here is one out of a broke led light bulb I bet it's made right off the data sheet
the chip on this one is LNK562-564. It was rated at 300mA

Quote
The circuit shown in Figure 5 is a typical implementation of
a 6 V, 330 mA, constant voltage, constant current (CV/CC)
output power supply.

http://www.powerint.com/sites/default/files/product-docs/linklp_family_datasheet.pdf
Title: Re: Constant current power supplies
Post by: draythomp on Dec 02, 2012, 05:16 am
If you prowl around that site a bit there's example after example of flyback power supplies and how they can be made.  I gather that, given their chips, it all boils down to the flyback transformer design and choice of resistors that are used.  They even offer a transformer prototyping service that can build a transformer for you based on their application notes.  I don't want to build one, I want to use one.

Now, all I have to do is find a tiny, cheap, constant voltage power supply that isn't already stuck inside a wall wart to experiment with.

See, I have this dream of a device that houses an XBee, a minimal arduino and a couple of screw terminals all built inside a wall wart like this: http://www.polycase.com/gs-2415 .  That way I can deploy a sensor and read its data remotely.  Things like the inside temperature of the chicken coup, voltage of the generator battery, open-closed state of the North gate, become easily done.  Add a few more terminals and a couple of tiny relays and you have a sprinkler system, a remote gate opener for the UPS guy, an auto drain for the horse watering trough (mosquito prevention).  With a simple sealed float switch I can remotely tell when the septic tank starts to rise so I can go out and clean the output filter and hose out the input.  Yes, the chicken coup has power, this is Arizona, they even have a swamp cooler in the summer.

I have practical uses for this kind of thing.
Title: Re: Constant current power supplies
Post by: dhenry on Dec 02, 2012, 02:54 pm
Quote
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.
Title: Re: Constant current power supplies
Post by: dhenry on Dec 02, 2012, 03:08 pm
Quote
LNK562-564.


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.
Title: Re: Constant current power supplies
Post by: Docedison on Dec 02, 2012, 11:33 pm
@ *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
Title: Re: Constant current power supplies
Post by: draythomp on Dec 03, 2012, 04:25 pm
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.
Title: Re: Constant current power supplies
Post by: dhenry on Dec 03, 2012, 11:25 pm
Quote
It's a green thing.


A gated oscillator is actually quite different from what you were talking about.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 04, 2012, 01:41 am
OK, I give up.
Title: Re: Constant current power supplies
Post by: westfw on Dec 04, 2012, 06:19 am
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:
Quote
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:
Quote
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 (http://www.allegromicro.com/Products/Sanken-Products/Sanken-ICs/Sanken-LED-Driver-ICs/~/media/Files/Sanken/Datasheets/LC5222D-LC5223D-LC5225D-LC5226D-LC5222S-LC5225S-Application-Note.ashx))   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 :-(

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.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 04, 2012, 06:54 am
Quote
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.
Title: Re: Constant current power supplies
Post by: Grumpy_Mike on Dec 04, 2012, 11:31 am
Quote
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.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 04, 2012, 03:36 pm
And, there's a perfect example right on cue.  Thank you so much for your timeliness.
Title: Re: Constant current power supplies
Post by: draythomp on Dec 05, 2012, 12:27 am
Quote
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.
Title: Re: Constant current power supplies
Post by: mkrsjak on Jan 30, 2013, 08:16 pm

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 http://en.wikipedia.org/wiki/Voltage_divider ?
Title: Re: Constant current power supplies
Post by: SirNickity on Jan 31, 2013, 01:04 am
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.
Title: Re: Constant current power supplies
Post by: draythomp on Jan 31, 2013, 02:06 am
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.
Title: Re: Constant current power supplies
Post by: SirNickity on Jan 31, 2013, 03:16 am
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.  :-)