AVR Schematic Review

I’ll definitely check the LED resistors. I haven’t spec’d the final LED’s yet, though. I’ll definitely post the PCB after I breadboard the circuit.

You guys have been a great help! Thanks!!! :slight_smile:

One note on the LEDs. In my experience, it is always preferred to sink current from an LED rather than source current into it. Not all parts can drive enough current to provide the LED brightness you desire. It also may cause problems on some parts with regard to maximum current per bank (though I don’t think your ATmega has that problem).

So rather than have the LEDs go to ground, better to have VCC through the diode and resistor into your part. So, setting the output to 0 will turn on the LED, and setting it to Vcc will turn it off.

If you don’t want the inversed polarity, you can use an NPN with the emitter to ground, a series resistor between the base and your ATmega, and the LED and resistor in series between Vcc and the collector. Something rather like here:

http://www.kpsec.freeuk.com/images/trtest2.gif.

Quick question about the resistors…

I’m specing out surface mount resistors. I was going to use all 0805 size, so they would be 1/8W. Also, I was looking at 5% tolerance.

Is this ok for my circuit?

Yupp. I use 0603 1/10 watt with 5% so 1/8th watt will work absolutely fine.

As for the caps. Would you say that +/- 10% would be fine for all of the MAX232 caps and +/-5% for the crystal caps?

Thanks!

In addition to the question above… when selecting a PTC, do I have to over estimate the voltage? For example, I expect 8-12VDC to be the input voltage to my circuit. Should I double the max voltage and get a 24V PTC or would a 12V (or maybe 16V) PTC be fine?

The parts you suggest are fine.

Over-rating the PTC won’t do any harm, though it’s not that big a deal. The PTC only ever sees the circuit voltage (12V in this case) when it’s actually tripped; in normal use the voltage across it is very small indeed.

Hello everyone.

So, I’ve bread-boarded my design, and it works great with one potential problem… I’ve noticed that my 5V regulator gets very hot. So hot that I would get burned if I held my finger on it. This was a TO-220 package. The 3.3V (also TO-220) didn’t feel hot at all. I’ve measured that my circuit draws about 185mA while up and running, and it draws about 250mA as inrush when starting up. I calculated that I’m burning about 2W of power over the 5V regulator with 12V input. I was going to use SOT-223 packages for the final PCB, but now I’m thinking that this isn’t going to work.

I’ve looked in the datasheet for the LD1117 and did some checking on line, but I’m not really sure on how to calculate thermal resistance and things like that. Perhaps someone could explain this to me? The data sheet (http://www.st.com/stonline/stappl/st/co … 000544.pdf) lists that that SOT-223 part has a Rjc=15, but it doesn’t list Rja. I’m a little confused with this, so please correct me if I’m wrong. I figured that at 2W, I’m raising the case temperature of the SOT-223 by 15*2=30 degC above ambient. Say the max ambient temp is 35 degC, then the max temp that the case would be is 30+35=65 degC which is lower than the maximum of 125 degC. This seems to indicate that I’ll be ok, but then where does the junction-to-ambient come into play? For example, for the TO-220 at 2W, I calculate that the temp will rise ((50+5) * 2) = 110 degC above ambient. So if ambient is 35 degC, then I’ve exceeded the maximum operating temperature. I guess one question would be when do you use the Rjc and when do you use Rja.

I’d really appreciate any help with this.

Now, while looking all of this thermal information up, I came across some information saying that I should be using switching regulators instead of linear regulators. I guess that would eliminate the heat problem, correct? Should I use switching regulators? Which ones are the equivalent to the LD1117’s? Will they still allow me to have the same input spec of 8-12VDC?

Now for a related question…

I originally sized my PTC at 500mA, but if the current actually goes to 500mA @ 12V input, then my regulator would surely burn up. If I keep the linear regulators, should I change my PTC to a lower value? Given that the operating current of the circuit is 185mA and the inrush is 250mA, what should the PTC be sized to? What if I change to switching regulators?

Sorry for the long post. I’m at least happy that my first PCB project worked correctly on the breadboard!

Thanks for the help! :slight_smile:

Rjc is usually the more useful figure, because the relationship between the semiconductor die and the package of the device is consistent, well defined and always the same. You can measure the package temperature and calculate the amount of power being dissipated in the device, and that allows you to work out the junction temperature with a fair degree of accuracy.

Rja is much less useful, because it depends so strongly on the nature of your product. Is the package upright, or laying down? Does it touch the PCB? If it’s touching the PCB, is it touching copper or bare laminate? Is there solder mask in the way? What’s the air flow like? And what does the manufacturer mean by “ambient” anyway? (Air temperature, board temperature, something else…?)

Dropping 12V to 5V with a linear regulator is bound to generate some heat. A couple of Watts will cause any device to get very hot on its own, though a modest heat sink will bring the temperature down a lot. That would be the easiest fix.

A more elegant fix would be to swap the linear regulator for a switcher, which will still get warm but not nearly as much so as a linear regulator. You can certainly get a pre-assembled module that will go 8-12V in, 5V out. In fact, a wide input voltage range is a very common feature of switching regulators, and is one reason they’re often used.

Your PTC is there as a protection device, it’s there to trip if some major fault occurs (eg. a slip of the voltmeter probe!) which would cause a device to be damaged. You can’t use it to reduce the normal operating current of your circuit; you have to choose one which won’t trip when the board is operating normally. If the board requires 500mA, you need to choose one which definitely won’t trip at 500mA, and you need to provide adequate cooling for your regulator so it doesn’t burn up. If your circuit requires 185mA, then a 250mA device might be more suitable. Don’t worry about the inrush, PTC devices just aren’t that fast.

If you change to a switcher, the input current will reduce. Your switcher module might well incorporate some overcurrent protection which means you don’t really need the PTC at all.

This is how I have always interpreted the datasheet values… All the thermal figures in the datasheet are there to be used as a guideline and unless you’re attaching a heatsink to the device I would start with the junction-to-ambient figure. So let’s think about your scenario…

2W are to be dissipated by the linear regulator,

Trise = Rja * Pd = 50 * 2 = 100 degrees C above ambient (you didn’t need to add both Rjc and Rja together)

Now as I mentioned earlier, these are guidelines and since the maximum junction temperature is 125C then we need to raise some alarm bells and figure out a different solution. What you did in your case and actually touched the regulator is good practice, you could actually measure the temperature with a probe to find out exactly but the fact that you are thinking ahead and deciding that you might end up drawing 500 mA in the future is great thinking. Keep in mind, anything above 60-70 degrees is going to feel like its burning your finger, water boils at 100 degrees.

Anyway lets move on and see what we can do with a heatsink…

Lets say you grab a heatsink with a thermal figure of 10 degrees C per Watt in still air (use still air unless your planning on having air flow across it). Now you can go ahead and use Rjc…

Case temperature: Tcase = Rjc *Pd = 5 * 2 = 10 degrees above ambient

Junction temperature: Tjunction = Pd * (Rjc + Rhs) = 2 * (5 + 10) = 30 degrees above ambient

Even at 35 degrees ambient, a estimated 30 degrees temperature rise seems like a good figure and you can feel much more confident you wont’ exceed the maximum junction temperature.

However, what happens up at 500 mA, now we are all of a sudden up to just over a 50 degrees rise even with the heatsink. You still have ~30 degrees headroom and if you’re confident that you wouldn’t always be running up at 500 mA, personally I wouldn’t be all that concerned.

Switching regulators are always nice and are easy to use as long as you follow the device manufacturer guidelines. I find Microchip provides awesome documentation and its hard to go wrong with their parts. Check out the MCP16301 for one such example.

If the heat sink is rated at 10 degrees per Watt, and the regulator is dissipating 2W, then the heat sink temperature will be 20 deg C above ambient. Assuming that the device and the heat sink are in good thermal contact, the case of the device will also be 20 deg above ambient.

Whoops, thanks for the correction Andy.

Yes. Since it is getting hot that is a lot of power going to waste. I would consider , like mentioned above, a switching mode regulator. They are quite efficient, and thus meaning less heat. Your wall wart will thank you also.

Andy, when you say that in rrpilot’s example, the case temp will be 20 deg above ambient, that makes sense. But, is it still also correct that the junction temp is still 30 degrees above ambient? Just wanted to make sure.

So, I took some current measurements on the linear regulators and found that the max (not counting inrush) was the following:

222mA @ Vin

213mA @ 5Vout

177mA @ 3.3Vout

Note: I took my measurements with 9VDC (really 8.5V measured on my unregulated supply). I checked Vin with 12V (11.3V measured) and the current was the same. Was this an error on my part? Should the Vin current change if the voltage changes on these regulators? I’m guessing that the current stays the same and the extra wattage is just burned off as heat. Is my thinking correct?

Now, I’m not sure if I was tired last night or what happened, but going over my math again, I don’t get the 2 Watts that I thought I had. Here’s my math. Please let me know if I’ve made an error. (This is for the SOT-223 package.)

12V - 5V = 7V

7V * 0.222A = 1.554W

Junction Temp = 1.554W * (15 degC/W + 50 degC/W) = 101.01 decC above ambient which would be too hot if the max ambient is 65 degC.

Note: I found on the web that using a 0.5x0.5 inch, 1oz copper plane on the PCB as a heat sink provides 50 degC/W of dissipation. Is that number correct? I could only confirm it on one website which doesn’t make me feel too good. :? (See here: http://www.daycounter.com/Calculators/H … ator.phtml)

Now, when calculating the Pd for these regulators, do I use the input current or the output current? For example, should I use 222mA or 213mA when calculating the Pd for the 5V regulator?

As a side note, I did notice that the Wiznet board uses 25mA less when an Ethernet cable is connected versus when one is not connected. Seems backwards to me. Any guesses on why this might be?

I’m going to read though the MCP16301 switching regulator datasheet and decide if I want to go in that direction. I could always change my spec to 9V for the input. I think that would keep the regulators in spec, provided that the 1oz copper plane on the PCB provided the cooling that I read online. On the other hand, the switcher, would use less energy overall anyway. If I go with the switcher, would you use two, one for the 5V and another for the 3.3V or just change the 5V and keep the 3.3 a linear regulator?

Thanks! :slight_smile:

steve1515:
I’m guessing that the current stays the same and the extra wattage is just burned off as heat. Is my thinking correct?

That is correct.

steve1515:
Now, when calculating the Pd for these regulators, do I use the input current or the output current? For example, should I use 222mA or 213mA when calculating the Pd for the 5V regulator?

Input current because a portion of the current is used within the regulator itself but this too must be dissipated as heat.

steve1515:
If I go with the switcher, would you use two, one for the 5V and another for the 3.3V or just change the 5V and keep the 3.3 a linear regulator?

From the numbers you posted, you’re actually using very little +5V (~20 - 30 mA), the majority of it is regulated further to +3.3V. I would just do a switcher for the +3.3V directly from the input voltage of 12V and leave the +5V as a linear regulator.

Another question about switching regulators…

When selecting one, there are many options, but I’m not sure what I need. For example, what would I want for the following options:

PWM Type, Switching Frequency, Synchronous Rectifier (Yes or No).

For PWM type, I’m thinking that it should be current mode, but I’m not sure what I can change when searching for a part.

Thanks!

There is bucket loads of information surrounding those topics, Google is your friend. What you need depends on what you want and what you’re willing to trade off.

Note: I took my measurements with 9VDC (really 8.5V measured on my unregulated supply). I checked Vin with 12V (11.3V measured) and the current was the same. Was this an error on my part? Should the Vin current change if the voltage changes on these regulators? I’m guessing that the current stays the same and the extra wattage is just burned off as heat. Is my thinking correct?

Quite correct. The current drawn from the supply depends on your load, so if it draws (say) 200mA @ 5V, the regulator will draw about 200mA at whatever voltage you provide. Think of the regulator as a variable resistor, constantly adjusting its resistance (between Vin and Vout) in order to keep the voltage drop the same regardless of how much current your draw.

A little current flows from Vin to GND without going through the load. Normally this is quite a small proportion of the total, and it’s just what’s needed to power the regulator. For a good regulator this current is often negligible.

Now, I’m not sure if I was tired last night or what happened, but going over my math again, I don’t get the 2 Watts that I thought I had. Here’s my math. Please let me know if I’ve made an error. (This is for the SOT-223 package.)

12V - 5V = 7V

7V * 0.222A = 1.554W

Junction Temp = 1.554W * (15 degC/W + 50 degC/W) = 101.01 decC above ambient which would be too hot if the max ambient is 65 degC.

Where does the 50 deg/W figure come from?

If 50 deg C/W is Rca (ie. resistance from case to ambient), then you’re correct. Normally what’s specified is Rja (resistance from junction to ambient), in which case your calculation is pessimistic; the correct answer would be that the junction temp is (7*0.222)*50 = 77.7 deg above ambient.

However, I always treat anything involving the word “ambient” with a hefty dose of cynicism, because it’s such a poorly defined term, and any calculations involving it are so strongly affected by factors unique to the particular project - in particular, how the device is mounted and what the air flow is like around it.

Note: I found on the web that using a 0.5x0.5 inch, 1oz copper plane on the PCB as a heat sink provides 50 degC/W of dissipation. Is that number correct? I could only confirm it on one website which doesn’t make me feel too good. :? (See here: http://www.daycounter.com/Calculators/H … ator.phtml)

See above! It may be a reasonable approximation, but if you have the opportunity to actually build and test it for yourself, you’ll get a figure much more applicable to your design.

Now, when calculating the Pd for these regulators, do I use the input current or the output current? For example, should I use 222mA or 213mA when calculating the Pd for the 5V regulator?

It’s actually 213mA * (Vin-Vout) + (222-213)mA * Vin. For 12V in and 5V out, it’s dropping 7V @ 213mA and 12V @ 9mA.

The regulator’s own power use is a small proportion of the total. Pd = 1.491W + 0.108W = 1.599W.

As a side note, I did notice that the Wiznet board uses 25mA less when an Ethernet cable is connected versus when one is not connected. Seems backwards to me. Any guesses on why this might be?

Odd. Normally plugging in an Ethernet cable makes the link come up and the PHY consumes more power. But I’ve no idea what a Wiznet board is, so I wouldn’t like to speculate.

I’m going to read though the MCP16301 switching regulator datasheet and decide if I want to go in that direction. I could always change my spec to 9V for the input. I think that would keep the regulators in spec, provided that the 1oz copper plane on the PCB provided the cooling that I read online.

A physically larger linear regulator (eg. a TO220 packaged device) with a clip-on heat sink might be a simpler solution. If you can reduce your input voltage then that can only help too; anything above your regulator’s minimum input voltage (for a 5V output) is just wasted anyway.

On the other hand, the switcher, would use less energy overall anyway. If I go with the switcher, would you use two, one for the 5V and another for the 3.3V or just change the 5V and keep the 3.3 a linear regulator?

I’d first consider dropping the requirement for a 9V or 12V intermediate supply voltage entirely, and think about powering the board from a regulated +5V mains brick. Then you only have to go from 5V to 3.3V anyway.

Even if all the current is drawn from the 3.3V rail (worst case), the dissipation in a linear regulator going from 5V to 3.3V would be 1.7 * 0.213 = 362mW. This will get warm, but certainly shouldn’t be a problem. (Check that your chosen regulator can actually deliver 3.3V out from a 5V input, as some old / inexpensive types might struggle. Anything described as low drop-out or LDO will be fine).

If that’s not an option, then my next choice would be to use a switcher to drop from 12V (or 9V) to 5V.

If the current you actually need at 5V is very small, then you might be better off using the switcher to drop from 12V down to 3.3, and a linear regulator to drop from 12V to 5V. Calculating the power dissipation in each case is straightforward enough.

Hello everyone.

I’ve updated my project to include a switching regulator in place of the 3.3V linear regulator. I kept the 5V regulator as it was, but the 3.3V regulator will now be powered off of the input voltage (12VDC).

Here’s a link to the latest schematic: http://img443.imageshack.us/img443/1845 … ateway.png

Could you guys please look it over? I believe that I’ve selected the correct parts for the switching regulator.

The datasheet is here: http://ww1.microchip.com/downloads/en/D … 25004A.pdf

I think I’m also going to change the PTC to 250mA holding current, but I haven’t put that in the drawing yet.

One interesting thing that I noticed… While looking for a 1N4148 diode, I noticed that Diode’s Inc. has a 1N4148W part and a BAV16W part. They appear to be identical as far as I can tell. Why would a manufacturer do this? Seems that it would just confuse things.

Anyway, I hope you guys approve. :slight_smile:

Thanks again!

steve1515:
Here’s a link to the latest schematic: http://img443.imageshack.us/img443/1845 … ateway.png

Could you guys please look it over? I believe that I’ve selected the correct parts for the switching regulator.

The datasheet is here: http://ww1.microchip.com/downloads/en/D … 25004A.pdf

Looks good to me, would like to see your layout too.

steve1515:
One interesting thing that I noticed… While looking for a 1N4148 diode, I noticed that Diode’s Inc. has a 1N4148W part and a BAV16W part. They appear to be identical as far as I can tell. Why would a manufacturer do this? Seems that it would just confuse things.

Definitely interesting, could always just ask Diodes Inc., the device manufacturers are usually very willing to help out.