October 30th, 2010

ST1S10 calculator

ST1S10 calculator

Since I was working with the ST1S10 for an upcoming project I decided to publish this little calculator. The ST1S10 is one of the cheapest if not the cheapest 3 A, 900 kHz, monolithic synchronous step-down regulator. The high frequency switching allows the use of tiny SMD components so the board space taken by this regulator its pretty tight. The calculator is written in OpenOffice Calc and saved as XLS, so you can open it with both MS Office and OpenOffice. The calculator works for Vout > 2.5V. You have to enter the requested values on brown boxes and you’ll get the result in the yellow boxes. If you notice any mistake in the formulas please let me know.

Download here: ST1S10 calculator

In this article I continue my project where I needed a constant current source. In the previous article I talked about the first approach the LM317 constant current source which didn’t worked out that well but could of been improved as suggested by some of my readers in the comments. So I decided to use a dc-dc converter and turn it into a constant current source. Since I’m using the TPS54232 in another project and I have it around I decided to use it. This technique can also be applied to other dc-dc converters with a bit of reading on the subject.

I’ve started by reading SLVA374 app report from TI which is a Step-Down LED Driver Design Guide based on the TPS54160 dc-dc converter, normally used as a buck voltage regulator. The schematic from the app report can be easily adapted to our device with a few changes like adding a sense resistor and an output capacitor:

TPS24232 constant current source schematicTPS24232 constant current source board

If you remember from my last post I needed 1.12 A to power the two led packs that I’ve  build connected in parallel. We have a simple equation that we use to find out the feedback resistor value: R=Vref/Io In our case Vref is 0.8V taken from TPS54232 datasheet, Io is our desired current of 1.12 A. Doing the math we get the R value = 0.71 ohms. This is not a standard value, but we can use two 1.5 ohms resistors in parallel(R1 and R2) to get 0.75 ohms which is pretty close. With 0.75 ohms feedback resistor I have 1.06A at the output which divided by 56(the number of white LED’s) means 18.9 mA for each white led.

We must consider the power dissipation for this resistor and we can calculate it : Pdis = Vref^2/R In our case we have Pdis = 0.8^2/0.75 = 0.85W. The only 1.5 ohms resistors that I could find locally were 5 W so I had to work with a bigger package. The EN pin is used to enable and adjust the Undervoltage Lockout but I’m not going to use that feature since my input voltage is always gonna be high enough not to cause any problems. The resistors are placed on the pcb anyways so you could use those pads and soldere the necessary resistors.

We also must consider the power dissipation in the low side diode. During the converter on time, the output current is provided by the internal switching FET. During the off time, the output current flows through the catch diode. The average power in the diode is given by: Pdiode = (1-Voled/Vin) * Vfd * Io , where: Vfd is the led forward voltage, Voled is the supplied output voltage and is approximated by: Voled = Nled * VLed + Vref where : Nled = number of LEDs, Vled = forward voltage drop of each LED. In my case Pdiode = (1-(4.2/12))*0.75*1.06=0.51W so I used a 2A 40V schottky diode part number CDBA240-G.

You would also have to consider the inductor and the input and output capacitors, but you can read all about that in the datasheet of the TPS54232 or in the app report mentioned above. After I had all of my circuit figured out, I routed the board and etched it using my photo etching technique. For such a small board its not worth taking out the solder paste so I soldered it using the soldering iron, as you can see its a mix of through hole and surface mount parts but they fit together quite nice.

TPS54232 LED constant current source pcb assembledTPS54232 constant current source pcb back side

The solder drops that you can see on the back of the board are a sort of DIY thermal vias. I’m not sure how efficient they are but I gave them a try with this board, probably because I had too much time available :-). First when I designed the board I included a area of copper in the top layer right beside the resistors. Next I drilled some 0.7 mm holes and I placed 0.7 copper wire in the wholes securing it by soldering on both sides. The trick is to make the solder joint as small as possible so it doesn’t spaces your component from the board. As I’ve said I don’t know their efficiency but I think they work, I can feel the heat transferring from one side to the other faster. If you like them you can try them.

The testing went smooth, the LED’s light up perfectly, no problems at all. During the testing I noticed one bug though: if the input wires are not firmly attached or secured and there is an imperfect contact the converter will tend to output less current than the programmed 1.02A. I’m not sure why this is happening, it might have something to do with the Undervoltage Lockout feature that I skipped on but I’m not sure. Anyway its not that much of a problem since once in place the power source will have the cables firmly attached so no worries. That’s why I used the cable connectors on the PCB in the first place, I knew it would save me some trouble later.

56 white LED

Now I had one last thing to do. Since this circuit is going to be operated in the outdoors the corrosion would set in pretty quickly so I improvised once again. I had this idea for quite a long time but never actually tried it. So I used my Bison universal hobby glue, which is transparent, and covered the copper traces on the PCB in glue. After it hardened, it looks like you could dip these board into water and nothing would happen to them. Well, except from the terminals which stick out of the PCB :-). Nonetheless I think these boards will run no problems even after a few years. If you’re wondering where the bubbles come from, they form when the glue dries out :-).

TPS54232 constant current source covered in gluewhite led packs pcb's covered in glue

I’m pretty happy how this project ended up and I feel like I know more about LED’s and ways to power them. I’ll definitely need to experiment more with some high power LED’s, maybe use them to light my workbench. As for the efficiency of this circuit I don’t know if I’m calculating the right way because I’m using the equations from page 16 of TPS54232 datasheet, and those are clearly stated to be used only under continuous conduction mode. Since the circuit has been modified to act as a constant current source I’m not sure the same equations apply. But I did the math anyway and I got an efficiency of 75.36% and according to the same equation if I would connect the two led packs in series I would get an efficiency of 79.01%. Once again I’m not sure these calculations are correct and I ask the readers to comment on these.

There is more that you can do to improve the efficiency of this circuit. It turns out you can reduce the power losses in the current sense resistor by lowering the voltage across the resistor. The solution is to inject a bias voltage, but I’m not going to try this solution since I’m already happy with my design. You can read more about it in SLEA004 app report from TI.


October 2nd, 2010

LM317 constant current source

Recently a friend of mine asked my help about replacing some 12V light bulbs with LED’s for longer battery life. After doing some searches the cheapest solution was to use a bunch of 5 mm white LED’s powered from a constant current source. A constant current source is not cheap to buy and since were in the spirit of making why not make that also. But where to start ? there are voltage regulators that you can turn into constant current sources, dc-dc converters that you can turn into constant current sources or you can choose a specialized circuit designed exactly for powering LED’s. Obviously the first option is the cheapest and simplest to implement but it comes with its drawbacks.

Anyway, I had everything needed on hand so I proceeded and designed a PCB in Eagle. I used two LM317 voltage regulators because I want to power two sets of LED’s. Each set of LED’s is composed of 28 LED’s tied in parallel. I’m gonna set the current on each LED to 20 mA so that is 560mA for each set of LED’s. I wanted to spread all that load on two LM317 so I used two.

28 x 5mm white LEDs wired in parallel Dual LM317 constant current source schematic

The PCB were easy to route and ended up like this:

28 x white LEDs in parallel PCBDual LM317 constant current source PCB

Kind of small and nice looking. The LED pack could of been smaller but since LED’s don’t spread light on a wide angle I decided to spread the LED’s a bit to spread the light. The LM317 board was designed so that it would fit perfectly under a heatsink I had around. Actually the heatsink is from an old video card I had in my junk box; its nice to reuse these things, its like recycling.

old video card ripped out of heatsink

I proceeded and used my DIY photo etching method but something went wrong and I messed up all of the PCB’s, they ended up looking like this:

messed up PCB

The thing is I stopped using ferric chloride a while ago. Instead I turned to ammonium persulfate which comes as a white powder that you need to dissolve in watter. The watter stays clear, it doesn’t smell and it doesn’t stain (not checked yet). It only catches a blueish color after you’ve used it and copper accumulates in it. The only disadvantage for using ammonium persulfate is that it etches slower than ferric chloride, other than that is great. The problem with mine is that it was mixed with water more than 6 months ago and it turns out it doesn’t last that long when mixed with water, so keep it as powder and only mix it when you need it. Unfortunately I couldn’t get more of it locally so I had to return to the good old ferric chloride. I did all the process again and the boards came out great this time.

The assembled LED packs look like this:

Assembled 28 led packsAssembled 28 led packs back

and the assembled LM317 board look like this:

dual LM317 constant current source assembleddual LM317 constant current source assembled

Notice how I designed the board to fit just over the raised part of the heatsink? its the little things that count 🙂 (and I’m not referring to the heatsink as you will read next). The LM317 pair was mounted on the back so that it sits firmly attached to the heatsink transferring all that heat.

here’s a photo between the heatsink and the pcb:

LM317 constant current source - between heatsink and pcbLM317 constant current source - between heatsink and pcb

I was pretty happy with the overall result until I actually run it. The heatsink got very hot pretty fast and it was clear it was not dissipating enough heat. With 12 V in, LED Vf of 3.4V , 560mA and an ambient temperature of 28 degrees C, the heatsink reached almost 80 degrees C. It turns out The LM317 is not very efficient in this setup and together with the sense resistor has to dissipate allot of heat. And a simple calculation would of shown this from the beginning if I paid attention to it.  (Vin-Vf.Led-Vadj)xIo => (12V-3.4V-1.25V)x0.56A= 4.116 W for each regulator, double that and the heatsink is just too small to dissipate that kind of heat. Not to mention the poor efficiency of the circuit. Its the little things that count , I would of done that calculation earlier I wouldn’t of made that circuit just to realize that is not good for my setup.

At this point I knew this option is not good and I had to find something else to power the LED’s. I could use a specialized circuit like the LM3406 which would give me the best efficiency but I would have to wait for delivery and get some more parts, or I could use a dc-dc converter modified as constant current source which would give me decent efficiency and I could build it with parts that I already have. I decided to go with the dc-dc converter modified as constant current source. I already have the TPS54232 from another project of mine; the TPS54232 is a 2A, 28V, 1MHz, step down SWIFT™ dc-dc converter. Now its time to design a new PCB for the new power source but more about this in the next article.


Network Controlled Outlet

A very interesting project showing you how to turn on and off the power from your mains outlet through computer network. It is very well documented and very useful. Basically you could turn on or off any device from any location as long as you can connect to your network.

The on/off switching will be done by an Olimex AVR/IO board. This board is equipped with an ATmega16 microcontroller (with no initial software loaded), four low-voltage inputs, a serial interface and four 5A/250V SPDT relays. These relays can be controlled by serial, by the four inputs or both depending on the code you will write for the microcontroller. So it is a very versatile board and only your imagination is the boundary of it’s utility.

The four low-voltage inputs are optocoupler isolated so this input can accept signals with different ground. Also these inputs are very helpful if you want to use a wireless module like the XBee. A PNP transistor is used to drive these inputs without any trouble.

Each relay provides connections for both normally open and normally closed positions. The relay will be placed between the hot wire that comes from wall and the hot wire that goes into the outlet. This way it will open or close the circuit on your command. Be careful however of the power consumption of the device you plug in the outlet. The relays are rated at 5A but they can be changed if your requirements ask for it.

The network controller is the Atmel NGW100 and will allow you to control the Olimex board through the network. It has two ethernet ports, lots of GPIO ports and Linux with TCP/IP installed. Control of the GPIO ports can be a little tricky with the NGW100 but you will find the scripts in the project.

The next thing is to connect the NGW100 to the network. Once that is done you can access the NGW100 through the network and execute the scripts according to your desired action.

Controlling Mains Power Through Network: [Link][Via]


A friend of mine asked me take a look at his power supply, because suddenly it stopped working. Of course I said yes, and the first thing to check after I removed it’s top, was the fuse. The fuse was wrapped inside heat shrinking tube which made the checking a bit difficult. After peeling some of the shrinking tube I was able to measure it’s continuity and find out that it was blown. At that time I hoped this was the only problem, I replaced it and powered the supply, but my joy was short, because the new fuse was blown too.

Obviously the problem needed further investigation, so I went along and checked the rectifier bridge, which was ok. The capacitors looked ok, so the next thing I had to check was the two switching transistors. To do that I had to remove the hole radiator which contained more than the transistors. Checking the transistors gave me the answer to the problem, because I found both to be broken. But now a new problem was raised when trying to find replacements for the two transistors 2SC3320. I was only able to find these in stores across US and China and both of these places would make the shipping and tax costs to high to be worth buying from there.


Now I have only two options, one is for someone to have a broken power source that has these same transistors, and that they’re still working, and the other is to find a replacement for these transistors, which I tried but with no luck. I wasn’t able to find another transistor to match it’s characteristics.

This is the datasheet of the 2SC3320 transistor. If you have any ideas on how I could solve this, please comment.

© 2007-2011 YourITronics | Any logo, trademark and project represented here are property of their respective owners | Wordpress | Privacy Policy    RSS