Question on Dual-Voltage (110VAC -> 18VDC/5VDC) Power Sup

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm starting on my first AVR project outside of my STK500 and am trying to figure out how to power it. I spent some time searching the forums and couldn't find an answer, but if I've overlooked something please share the link!

I am powering an LED lighting effect system. Essentially it's a string of LEDs in serial and parallel, requiring 18VDC. This will be controlled through a TIP41 on a GPIO of an AVR. Since the AVR is powered by 5VDC, the question is, "What is the best way to get both 18V and 5V?"

I've got an 18VDC power supply (mains-powered) and was thinking of just connecting a 7805 to it, but that's 13W if I'm calculating it correctly, which seems a bit high. 5V current draw should be pretty low but the 18V side will be a couple amps due to the LEDs.

Keeping things relatively simple (i.e., few components) is desirable (but not required) since this is my first 'big' electronics project.

I also considered using both the 18V power supply ('wall-wart') as well as a 5V supply, with the negative side of each tied together, though I was concerned that they may not be at the same potential, resulting in high current (and damage) between the supplies.

Any advice/direction is appreciated!

Related: I've blown up a couple 7805s hooking it directly to the 18VDC with no diode or load. I'm not certain why that's happening but I'm currently reading through The Power Supply page, linked from the sticky thread, and I think that'll tell me what I need to do.

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 7805s should tolerate your 18VDC unless you've wired them incorrectly. Load or no load should make a difference. You can get switcher modules that replace a 7805 and have lower temperature rise due to lower losses. Something like a Recom 785 series.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are lots of inexpensive 5V switchers now. ebay? They wont even get warm.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vaxocentric wrote:
I've got an 18VDC power supply (mains-powered) and was thinking of just connecting a 7805 to it, but that's 13W if I'm calculating it correctly, which seems a bit high. 5V current draw should be pretty low but the 18V side will be a couple amps due to the LEDs.

It loosk to me that you think the AVR will consume 1 full amp own to get to 13W dissipated power on the 7805. I very much doubt this is true. Your AVR will consume a couple of mA, probably <20mA, so the dissipated power in the 7805 will be below 250mW. Even a 78L05 (TO-92) can handle that. A 7805 has plenty of headroom.

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Kartman already stated, you should not have blown up the 7805s.

You might wish to post a schematic of your circuit, and a close up photo of your system, so we can see if we can help you determine what went wrong.

The point is, it is hard to keep from blowing them up until you determine, with certainty, what you were doing incorrectly.

I'd either use a switching power supply for the 5 V, as has already been suggested, or use a TO-220 case 7805 with a heat sink. As you noted, it has to dissipate (Vin-Vout)* (Iload) Watts in heat. It won't take much current draw on the load to end up generating a lot of heat. (I don't trust my thermal calculations as well as Markus... But I've had a few thermal failures over the years ;) )

The question of tying the grounds together of several Wall Warts is actually very interesting. In the "old days", with true transformers in the Wall Warts, you could tie their grounds together. These days it would sure be nice to know exactly what was inside the Wall Wart before making this decision.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you everyone for the quick and helpful replies! It sounds like my initial approach is okay (for now) and I'm just doing something wrong that's getting my 7805 overly excited, which I'll investigate more carefully.

Markus: Thanks for the clarification - for some reason I thought the 7805 would still dissipate all that power, regardless of load. Now it looks like I might be able to use that [TO-220] regulator with my 18V supply, but I'll measure the 5V current draw to be sure and add a heatsink for protection. Once I get the first prototype complete I'll look at moving to a switching regulator.

Kartman/JC: I'll recheck my wiring, source voltages, pinouts, and if that all looks good I'll post a schematic and photo. Thank you!

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Related: I've blown up a couple 7805s hooking it directly to the 18VDC with no diode or load. I'm not certain why that's happening but I'm currently reading through The Power Supply page, linked from the sticky thread, and I think that'll tell me what I need to do.

assume you have put a load resitor on the wall wart and verified ac and dc output voltages....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some more remarks: Your calculation of the dissipated heat was correct, you just assumed that the current will be 1A. I did a back-of the napkin calculation with the assumption that your 5V circuit will not consume more than 20mA. Using this value I got to a 1/4W of heat dissipation. However, you will have to verify that this assumption is correct. Of course you can always rely on smoke signals from the regulator to tell you about excessive heat.

About the 'blown up' regulators: Most 7805 style regulators should work until >30V, so the 18V you have should not kill them. But they need the input and output capacitors to be there to work well. I suspect you did connect them wrongly. What was the symptom ?

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As suspected, I had done something stupid -- I had reversed the polarity from the 18V source to the board (I was using a barrel connector and took the positive off the negative pin and vice-versa. Whoops!

I've since added a diode (1N4001) and two filtering caps to improve the power quality.

This is the current schematic, except with 18VDC instead of 9, and no switch. Works great!

I'm able to get my 18V (which is a little high because I think it's an unregulated supply, but I don't think this is a big deal with my application), along with a filtered 5V output.

One final question - I'm taking my 18V from the positive side of C1 (right after the diode). Since I'm going to have 500mA+ worth of LEDs flashing in various sequences (sometimes slow, sometimes fast) would I want a larger cap than 100uF to help keep the 7805 input stable? Is there an easy way I can determine the appropriate value? The 18V source is rated for 1.1A, and as pointed out I will probably have less than ~50mA used from the 5V output.

Thanks again, everyone - your comments have been extremely helpful!

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't think the ripple on the input will be large enough after the 7805 to impact something. Tt has 13V voltage drop to work with. I would not worry about that.

You say you will not need more than 50mA, that's fine. But with 50mA you'll dissipate 0.65W, this amount of power probably needs a (small) heatsink.

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perfect. I'll get some heatsinks with my next Jameco order, and until then I'll just watch the current, runtime, and temperature.

Thanks, Markus!

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You probably already planned to do this, but just in case:

You probably ought to have a fuse in the 18V 1+ Amp line.

Thought I'd mention it before you place your next Jameco order.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you put a rectifier bridge near your barrel connector, right where you currently have a diode, you won't ever have to bother about the input polarity.

The Dark Boxes are coming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JC: I was just updating my schematic and thinking to myself that the only fuse I've used so far was in my multimeter (when it blew during a current measurement!) Excellent advice! I need to get some additional ones anyway for the DMM! ;) I'm inclined to fuse the 5V 7805 output as well, mostly because I need to keep the current limited otherwise I'll melt the 7805. Once I figure out the final current draw and temperature with a heatsink I'll select an appropriate value (maybe 50mA delayed.)

I'm also thinking of getting a few PTCs - mostly to save me some fuses in the long run when prototyping. Are there any issues with incorporating PTCs into a final project as a 'self-resetable' fuse? (Or caveats with PTCs in general?)

Svofski: Great suggestion! I've only ever thought of those for rectifying AC, but I can see how that'd work nicely. I think I'd like to know when I've reversed the polarity, and the lack of power (due to a single diode) would be the kick in the butt to wake me up, but if I find myself building a more robust PSU I'll definitely remember this!

For anyone interested - just a half-watt of power dissipated by a 7805 warms it up to a toasty 85C without a heatsink!

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I'm inclined to fuse the 5V 7805 output as well, mostly because I need to keep the current limited otherwise I'll melt the 7805.

Generally one would put the fuse on the input side of the 7805. The 7805 itself has output short circuit protection and thermal overload shutdown built in.

I'll let others comment on PTC usage.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vaxocentric wrote:
For anyone interested - just a half-watt of power dissipated by a 7805 warms it up to a toasty 85C without a heatsink!

This is a bit more than what is to be expected from 0.5W. The TI datasheet gives the thermal resistance of the TO-220 package as 60C/W. So it should heat up 30 C for the 0.5W you are using. I'd stick a simple heatsink on it.

As was said before, the 7805 is quite robust, it is difficult to destroy in circuit as it has short circuit and over-temperature protection built in. Reverse polarity is one way to kill it as you found out, but other than that you have to try hard !

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are using a TIP41 connected to the AVR. Be aware that a resitor is needed between the base of TIP41 and the GPIO, otherwise the base will act as a shortcut. You may choose a value like (5V - 1.2V) / 20mA = 190ohms appr. to limit current to 20mA. Multiply by hFE of TIP41 to find max. collector current. If insufficient, I would choose a logic level power mosfet rather than the transistor.

If you are running the AVR at default 1MHz, current consumption would likely be less than 1mA plus GPIO current, max. 20mA. The LED in the power supply consumes much more current than the AVR in case, about 10mA. Regulating power could be (18V - 5V) * 30mA = 0.39W. Replace the TIP41 with a power mosfet and remove the LED, and a 78L05 could supply the 1mA without any cooling.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your thoughts about the TIP41 are important. From a datasheet I see that its hFE goes down to 15 with larger load currents. That meant that the base current must be 1/15 of the load current. If your load is 1 amp, then your base current needs to be 70mA, this is too much for a port of the AVR. To solve this you either add a driver transistor or you something else than the TIP41. As said by peteralarsen, a power MOSFET is a good choice. But you must choose a MOSFET with a logic-level gate, otherwise the AVR will not have enough voltage to drive it (normal MOSFETs like to have >5V gate drive voltage).

I've used the FDN337N and NDS331N in the past with good success, but those are SMD. You probably would like it in a TO220 package. Googling 'logic level mosfet TO-220' comes up with example.

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In addition to your electrolytics, put 330n on the input and 100n on the output of the regulator to keep it from oscillating.
/mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Peter: You actually beat me to my next question (I was going to start a new thread about it since it's out of the scope of the power supply question). Without going in to too much detail here I'm looking at driving <200mA per TIP41 (attached to the GPIO). I connected it directly and monitored the current and it seemed to work okay in this particular instance, but I would appreciate learning about the correct way to do this. I'll articulate my questions along with a schematic for illustration in a new thread (perhaps tomorrow). Thank you for the comments about how to minimize my 5V current!

Markus: If I'm understanding correctly I would need 13mA for driving 200mA off the TIP41 (this is double what I'm expecting), which I think might work for the chip's GPIO. Based on Peter's comments I think I need a resistor in series, but again this is part of a larger set of questions I have with interfacing transistors with the MCU. Your comments on the MOSFET (especially regarding the logic-level gate and part recommendations) are very helpful!

n1ist: Thanks for the feedback. Could you help me understand what the practical impact is if I omit these caps? I.e., the current circuit seems to work well, and I'd like to understand when and why it wouldn't.

The truly evil murder with style.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You will have to study the TIP41 data sheet. It looks like the TIP41 has a sweet spot at 150mA where the current gain (hFE) is >30 so you can get away with less than 10mA base current to drive 200mA. On the other hand base current should be plenty, better too much than too little for such a switching application.
http://pubpages.unh.edu/~aperkins/pdf/TIP-devices/TIP41.pdf

I'm convinced that for your app, a logic-level MOSFET would be a better choice.

The caps at the input and output of the 7805 are there to prevent it from oscillating. These are *necessary*, again, read the datasheet of your particular device about their size. If you omit them your regulator may oscillate and superimpose a nice signal on top of the 5V supply.

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@vaxocentric:

If you end up choosing a power mosfet, you should still use a current limiting resistor between GPIO and mosfet gate. Reason is that the gate despite its high impedance at DC, acts as a capacitor. When switching the GPIO the gate acts as a shortcut for a few microseconds while charging this capacitor. The "builtin" capacitor may be as large as a few nF. If you are switching at high frequency (from tens of kHz upwards), you may need a dedicated driver for the mosfet.

If you stay with the TIP, you should be shure to saturate it with more base current than needed according to hFE. This will minimize the collector-emitter voltage. The hFE listed in the datasheet is usually a minimum value, your actual sample could be much better.

However, AVR's seem to be quite robust. I am using an atmega328 for automated ligthing control in a 12V DC system at home, and forgot the resistors between GPIO's and the mosfets. This has been running non-stop for 2 years now, with no faults. But switching is in the range of a few switches per day.

Peter