Previous Posts:
Epidode 1: Forget Me Not: Application
Episode 2: Forget Me Not: The Best Laid Plans ...
Episode 3: Forget Me Not: Setup EnOcean with openHAB
Episode 4: Forget Me Not: Medication System
Episode 5A: Forget Me Not: Using Notify My Android with OpenHab
Episode 6: Forget Me Not: Plant Watering System Design
Episode 7: Forget Me Not: Medication System Demo
Episode 8: Forget Me Not: Using Twitter
Episode 9: Forget Me Not: Sunshine, Lollipops, and Rainbows
Problems to Date:
I haven’t received all of my Newark order and I’m also still waiting for my soil sensor from DX.com Most of the Newark order came in, but a key piece for the air conditioning system was not with the order. Newark does not carry the STM 320U, but Christian was able to get me two samples! Thanks Christian.
What to Talk About?
I began building my interface circuit for the soil sensor. The same circuit that I presented in my last blog post. The circuit performs three functions:
- Regulate 12 Volts to 5 Volts
- Determine from the soil sensor and comparator circuitry when to water
- Interface to the Raspberry Pi
While building the circuit I was attaching my heat sink to my linear regulator and wondering what I should blog about this week. It occurred to me that maybe I should talk about heat sinks and power dissipation, so this post will be about calculating power dissipation in a linear regulator and whether or not you will require a heat sink.
Power
For a linear regulator, such as the 7805 series, the power dissipation is a simple calculation. In fact, it’s as simple as calculating the power dissipation of a resistor. It’s simply the voltage drop across the device multiplied by the current through the device:
So, if a 7805 has an input voltage of 7 Volts, a regulated output voltage of 5 Volts, and is delivering a 500 mA load current the resulting power dissipated would be (7V-5V)*0.5A or 1 Watt. For the linear regulator this power dissipation is in the form of heat, so we’ll need a basic understanding of heat.
Heat
So what exactly is heat anyway? A basic definition would likely be worded to say “the energy transfer across a thermal gradient” or “the energy transfer between two objects of different temperatures” but that’s not exactly clear when we think about regulators. In fact, it may not be clear what temperature is, which of course is a measure of the kinetic energy of the atoms or particles in an object. How even more confusing! It’s no wonder so many hobbyists and even electrical engineers shy away from thermal analysis. I use to think it was just hobbyists until I saw engineers snapping on heatsinks to TO-220 packages “just in case” it got hot.
Analysis
I will use the LT1529CT-5 regulator as an example of calculating the thermal requirements for a project. I purchased a power supply that converts 120 VAC to 12 VDC with part of my budget. I require 2 Amps at 5 Volts to drive the sump pump that will water my plant. At a basic level I will require a regulator (linear) that can dissipate:
14 Watts is a lot of dissipation for a regulator. But that’s ok, we’ll just open the LT1529CT-5 datasheet and look for the maximum power dissipation spec … wait a minute … they don’t give one! Why not? Because we should be more concerned with the internal junction temperature of the regulator since it depends on the ambient temperature we operate the device at. The amount of power that can be dissipated will vary with the ambient temperature, but the maximum junction temperature cannot change. This is where the regulator design begins to differ from choosing the correct wattage resistor. We’ll need to create a thermal circuit to analyze our thermal requirements.
Here is a basic thermal circuit. We can analyze it the same as an electrical circuit where power is current, temperature is voltage, and thermal resistance is electrical resistance.
Fig 1: Basic Thermal Circuit
TJ is the junction temperature,
TA is the ambient temperature,
P is the power being dissipated by the regulator,
and ƟJA is the junction to ambient thermal resistance.
Let’s do a quick calculation to determine the temperature my regulator would reach by operating it in an ambient temperature of 45 degrees Celsius (I’m in California)
That’s just a tad hot, considering the maximum junction temperature for the device is 125°C (sarcasm). Note, the thermal resistance value comes from the device datasheet. So we have a few options:
- Use a different regulator topology (more efficient)
- Use a heatsink
Since I’ve got the budget, I’ll explore using a heatsink. A heatsink helps reduce the thermal resistance of the circuit we analyzed earlier, and therefore reduces the junction temperature of the device. It does this by removing heat from the regulator. If you've never seen a heatsink, I provided a picture below. This is the heatsink I purchased with part of my Newark budget.
Figure 2: AAVID Thermalloy 1.25GY-50 Heat Sink (Picture from Newark)
Ever wonder why they have “fins” like the one in Fig 2? Heat is transferred through surface area; more surface area allows for more heat to be transferred. More surface area is created by carving fins into the metal. If the heat sink were a solid block it would have less surface area and would be less effective at removing heat from the regulator. Looking at the datasheet for the heat sink we see two thermal resistances given:
- Horzontal Mount: Ɵ = 6.8°C/W
- Vertical Mount: Ɵ = 8.6°C/W
That's not a typo! Two different thermal resistances depending upon how you mount the heat sink. Look at the heat sink picture and imagine it is laying flat like in the picture. Remember, "heat rises", so the heat being transferred to the air around the heat sink goes directly from the heat sink into the air. If the heat sink is mounted vertically any heat leaving the heat sink must rise upward through the fins, reducing the effectiveness of the heat sink. So let's modify our thermal circuit for a horizontally mounted heat sink.
Fig 3: Thermal Circuit with Heat Sink
TJ is the junction temperature,
TA is the ambient temperature,
TC is the case temperature,
P is the power being dissipated by the regulator,
ƟCA is the case to ambient thermal resistance,
and ƟJC is the junction to case thermal resistance.
Note the difference, before we had a single thermal resistance: the junction to ambient. The junction to ambient was composed of two parts although it was hidden from us. They were: The junction to case and the case to ambient thermal resistances, just like in the circuit above. We have no control over the junction to case thermal resistance. It is part of the regulator design. However, we can change the case to ambient thermal resistance by adding a heat sink to the device. So, let's calculate the new junction temperature:
Note, ƟCA comes from the regulator datasheet, usually in a thermal considerations section. We've managed to reduce the junction temperature from over 700°C to 175°C, but that is still too hot for this regulator. In fact, to do a complete thermal analysis the insulator and thermal compound thermal resistances should also be included. This arises because you will need a thin insulator between the regulator and the heat sink. I could drop the ambient requirements to -10°C, that would meet the 125°C junction temperature maximum, but I don't think that's a wise decision.
It's around this point that it becomes a good idea to sit back and think about what this analysis means. If I constantly run this regulator it will overheat and shutoff. Fortunately this regulator has a thermal shutoff, but not all of them do. I'm not going to be running this regulator continuously. In fact, it will likely only run for a minute or two before shutting off. I ran a test where I drove the regulator for about 3 minutes with the heat sink attached and it did not reach thermal shutdown, which means I will be testing this regulator in the watering system. I should point out that when I tried to test this regulator without the heat sink it entered thermal shutdown immediately. It's kind of nice when calculations work out eh?
Conclusions
Always calculate that expected junction temperature, you might just need a heat sink.