Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
Voltage Regulator PCB Layout: LM2596 & LM317 Power Supply Design
After designing dozens of power supply boards over the years, I can tell you that the difference between a rock-solid regulator circuit and one that oscillates, overheats, or radiates noise everywhere often comes down to layout. The LM2596 switching regulator and the LM317 linear regulator are workhorses in countless projects, but their PCB layouts require completely different approaches. This guide walks you through the practical considerations for both, based on real-world experience and datasheet recommendations.
Understanding the Fundamental Differences Between LM2596 and LM317
Before jumping into layout specifics, it helps to understand why these two regulators demand different treatment on your PCB.
The LM2596 is a buck (step-down) switching regulator operating at 150kHz. It chops the input voltage at high frequency, stores energy in an inductor, and delivers regulated output through an LC filter. This switching action creates fast current transitions and voltage transients that can radiate EMI if your layout has excessive loop inductance. The payoff is efficiency—typically 80% or better—which means less heat to manage.
The LM317, by contrast, is a linear regulator. It works by continuously adjusting an internal pass transistor to maintain the output voltage, essentially burning excess voltage as heat. There is no switching, so EMI is minimal. However, the thermal management challenge can be significant when the input-to-output voltage difference is large or load current is high.
Parameter
LM2596 (Switching)
LM317 (Linear)
Topology
Buck converter
Linear pass element
Efficiency
80-90% typical
Varies with Vin-Vout differential
Output Current
Up to 3A
Up to 1.5A
Switching Frequency
150kHz
N/A (no switching)
Primary Layout Concern
Loop inductance, EMI
Thermal dissipation
External Components
Inductor, diode, capacitors
Capacitors, resistor divider
Noise Output
Higher ripple (mV range)
Very low (μV range)
LM2596 PCB Layout: Critical Design Rules
The Current Loop Problem
The most important concept for LM2596 layout is the high-frequency current loop. During each switching cycle, current flows through different paths depending on whether the internal switch is on or off. When the switch turns on, current flows from the input capacitor, through the IC, through the inductor, and returns through the output capacitor to ground. When the switch turns off, current freewheels through the catch diode, the inductor, and the output capacitor.
The transition between these two states happens in nanoseconds. Any inductance in these paths—from long traces, inadequate ground returns, or poor component placement—creates voltage spikes proportional to L × di/dt. These spikes cause ringing, radiate EMI, and can even damage components.
Component Placement Strategy for LM2596
Component placement for the LM2596 should follow a specific order of priority:
Step 1: Position the IC first. Place it near the center of the power section, with the input on one side and output on the other. Leave room for a heatsink if using a TO-220 package, or plan thermal vias if using surface mount.
Step 2: Place the catch diode. This Schottky diode (typically a 1N5824 or similar) must be as close as possible to pins 2 (output switch) and 3 (ground). The trace from pin 2 to the diode cathode should be short and wide—this path sees the full switching current during the off-time.
Step 3: Position input and output capacitors. The input capacitor needs to be within a few millimeters of pins 1 (Vin) and 3 (GND). It supplies the pulsed current demanded by the internal switch. The output capacitor goes close to the inductor output and ground, filtering the final output.
Step 4: Route the inductor. Connect it from pin 2 to the output. The inductor can be placed a bit farther from the IC than the diode or capacitors since the current through it changes relatively slowly (it is an integrating element).
Step 5: Add the feedback network last. The voltage divider resistors (R1 and R2 for adjustable versions) should be close to pin 4, with short traces to minimize noise pickup. Keep these traces away from the inductor, especially if using an unshielded inductor.
Trace Width and Copper Pour Guidelines
Current-carrying traces in the LM2596 circuit should be sized according to the maximum load current. For 3A capability, I recommend:
Trace/Connection
Minimum Width (1oz copper)
Recommended Practice
Input power (Vin to IC)
80 mils (2mm)
Use polygon pour
Output switch (pin 2)
100 mils (2.5mm)
Keep short, use polygon
Ground returns
100+ mils
Solid ground plane preferred
Feedback traces
10-15 mils
Keep away from inductor
Inductor connections
80 mils
Moderate length acceptable
Ground management deserves special attention. A solid ground plane on layer 2 (for a 2-layer board) or a dedicated inner layer (for 4+ layer boards) provides the low-inductance return path that switching regulators need. Connect all ground pins and capacitor negatives to this plane with multiple vias placed close to the component pads.
Managing EMI in LM2596 Designs
The LM2596 generates conducted and radiated emissions primarily at its 150kHz switching frequency and harmonics. Several layout practices help contain this noise:
Minimize the hot loop area. The “hot loop” is the path carrying switched current: input capacitor positive → pin 1 → internal switch → pin 2 → inductor → output capacitor → ground → input capacitor negative. Make this loop as small as physically possible. Every square millimeter of loop area acts as an antenna.
Use shielded inductors when possible. Open-core inductors radiate magnetic fields that can couple into nearby sensitive circuits. Shielded or semi-shielded inductors contain this flux within their structures.
Add input filtering if needed. For sensitive applications, a small LC filter (10-100μH choke plus ceramic capacitor) on the input can attenuate conducted emissions back to the source.
Keep signal traces away from the switching node. Pin 2 of the LM2596 is the noisiest point in the circuit. Route any analog signals or sensitive digital lines far from this area.
LM317 PCB Layout: Thermal and Stability Considerations
Why LM317 Layout is Simpler But Still Matters
The LM317 does not switch, so you will not find EMI problems in the same way as with the LM2596. However, poor layout can still cause oscillation, noise pickup, or thermal failure. The key concerns are:
Input and output capacitor placement for stability
Feedback resistor positioning for noise immunity
Thermal management for high power dissipation
Grounding topology to prevent ground loops
Capacitor Placement for LM317 Stability
The LM317 datasheet specifies a 0.1μF ceramic capacitor on the input when the regulator is more than 6 inches from the main filter capacitors. In practice, I always include this capacitor regardless of distance—it costs almost nothing and prevents potential oscillation.
The output capacitor (typically 1μF to 10μF) helps with transient response and provides some filtering. Place it close to the VOUT pin. If you are using an electrolytic, add a 0.1μF ceramic in parallel for high-frequency bypassing.
An optional capacitor on the ADJ pin (typically 10μF) significantly improves ripple rejection. This is especially useful when feeding the LM317 from a rectified AC source. Place this capacitor with its negative terminal connected to the same ground point as the output capacitor to avoid ground loop issues.
The Feedback Divider Network
For adjustable output voltage, the LM317 uses two resistors (R1 and R2) to set the output according to the formula:
Vout = 1.25V × (1 + R2/R1) + (IADJ × R2)
The IADJ current is typically 50-100μA, so its contribution is usually negligible with reasonable resistor values.
Layout considerations for these resistors include keeping R1 physically close to the LM317 output pin and the ADJ pin. This minimizes the trace length that could pick up noise. Route the trace from R1/R2 junction to the ADJ pin away from any high-current paths or noisy signals.
Use 1% metal film resistors for best temperature stability and accuracy.
Thermal Management Strategies
The LM317 dissipates power equal to (Vin – Vout) × Iload. For example, converting 12V to 5V at 1A means burning 7W as heat. Without proper thermal management, the IC will hit its thermal shutdown threshold (typically 125°C junction temperature) and shut down.
Heatsink selection: Calculate the required thermal resistance based on your operating conditions. The TO-220 package has roughly 4°C/W junction-to-case. If ambient temperature is 40°C and you want to keep the junction at 100°C, you have a 60°C budget. With 7W dissipation, you need total thermal resistance under 60/7 = 8.6°C/W. Subtracting the 4°C/W junction-to-case leaves 4.6°C/W for the heatsink plus mounting interface.
PCB as heatsink: For lower power applications or surface mount packages (like D2PAK), the PCB copper can serve as a heatsink. The TO-263 package thermal resistance to PCB is roughly 32°C/W with a 1-inch square copper pour. Add thermal vias under the tab to conduct heat to the bottom layer or internal planes.
Airflow considerations: Forced air can dramatically reduce heatsink requirements. Even modest airflow (100 LFM) can cut heatsink thermal resistance by half or more.
Power Dissipation
Recommended Thermal Solution
Under 0.5W
No heatsink needed for TO-220; SMD uses PCB copper
0.5W to 1.5W
Small clip-on heatsink or generous PCB copper pour
1.5W to 3W
TO-220 with dedicated heatsink, thermal compound
Over 3W
Large heatsink with forced air; consider switching regulator instead
Component Selection Tables for Both Regulators
LM2596 Component Selection Guide
Component
Recommended Value
Notes
Input Capacitor
100-470μF, 50V, low ESR
Aluminum electrolytic; place within 5mm of IC
Output Capacitor
220-470μF, 35V, low ESR
ESR critical for loop stability (0.02-0.3Ω typical)
Catch Diode
1N5824 or equivalent
3A, 30V Schottky; fast recovery essential
Inductor
33-100μH, 3A rated
Shielded preferred; saturation current > 3A
Feedback Resistors
1kΩ R1, calculate R2
1% metal film; Vout = 1.23 × (1 + R2/R1)
Feedforward Capacitor
See datasheet graphs
Optional for improved transient response
LM317 Component Selection Guide
Component
Recommended Value
Notes
Input Capacitor
0.1μF ceramic minimum
Add 10-100μF electrolytic for rectified AC input
Output Capacitor
1-10μF
Improves transient response
ADJ Pin Capacitor
10μF (optional)
Improves ripple rejection by 15dB
R1 (Program Resistor)
240Ω typical
1% metal film; sets reference current
R2 (Adjust Resistor)
Calculate based on Vout
Vout = 1.25 × (1 + R2/R1)
Protection Diode
1N4001 or similar
Recommended across Cin and Cout for reverse protection
Common Layout Mistakes and How to Avoid Them
LM2596 Layout Mistakes
Mistake 1: Long traces between the catch diode and IC. Every centimeter of trace adds inductance, creating voltage spikes during switch transitions. Keep the diode cathode within 5mm of pin 2.
Mistake 2: Inadequate ground plane. Using thin traces for ground returns instead of a solid plane increases loop inductance and causes ground bounce. Always use a continuous ground plane under the power section.
Mistake 3: Routing feedback traces near the inductor. The inductor generates alternating magnetic fields that can couple into nearby traces. If using an unshielded inductor, route the feedback resistor traces on the opposite side of the IC.
Mistake 4: Ignoring input capacitor ESR and ripple current. The input capacitor sees high RMS ripple current in a buck converter. Use capacitors rated for this service, not generic electrolytics designed for filtering.
Mistake 5: Using slow recovery diodes. Standard rectifier diodes like the 1N5400 series are far too slow. The resulting reverse recovery transients cause excessive EMI and power loss. Always use Schottky diodes.
LM317 Layout Mistakes
Mistake 1: Input capacitor placed too far from IC. This can cause high-frequency oscillation due to input lead inductance. Always place a 0.1μF ceramic directly at the input pin.
Mistake 2: Poor thermal connection to heatsink. An air gap between the IC tab and heatsink dramatically increases thermal resistance. Use thermal compound and ensure flat, clean surfaces.
Mistake 3: Ground loops in the feedback network. If the ground return for R2 connects to a different point than the output capacitor ground, voltage drops in the ground plane can affect regulation accuracy. Use a star-ground topology for precision applications.
Mistake 4: No protection diodes. If the input can be disconnected while a charged output capacitor is present, current can flow backward through the IC and damage it. Add protection diodes across the regulator.
Mistake 5: Using the LM317 where a switching regulator belongs. When Vin-Vout is large and load current is significant, the power dissipation may exceed practical heatsinking. Know when to switch to a switching regulator.
Practical Design Checklist
LM2596 Layout Checklist
Catch diode placed within 5mm of pins 2 and 3
Input capacitor within 5mm of pins 1 and 3
Solid ground plane under entire power section
Ground plane connects to capacitor and IC grounds via short paths
Hot loop area minimized
Feedback traces routed away from inductor
Inductor rated for DC current with margin above maximum load
Output capacitor ESR in recommended range (0.02-0.3Ω)
Thermal vias under IC for SMD packages
Input filtering added if EMI-sensitive application
LM317 Layout Checklist
0.1μF ceramic capacitor at input pin
Output capacitor close to VOUT pin
Feedback resistors close to IC, away from noise sources
Thermal path to heatsink or copper pour verified
Thermal compound used if mounting to heatsink
Protection diodes added if load can back-drive regulator
Power dissipation calculated and thermal solution adequate
The LM2596 relies on the ESR of the output capacitor for loop stability. Ceramic capacitors have extremely low ESR (milliohms), which can cause oscillation. If you must use ceramics, you may need to add a feedforward capacitor (CFF) across the upper feedback resistor to compensate. This requires careful testing with a Bode plot analyzer. For most applications, stick with aluminum electrolytic or solid tantalum capacitors that have ESR in the 0.02-0.3Ω range recommended by the datasheet.
How do I know if my LM317 needs a heatsink?
Calculate the power dissipation: P = (Vin – Vout) × Iload. Then calculate the junction temperature rise: Tjunction = Tambient + (P × Rth), where Rth is the total thermal resistance from junction to ambient. If Tjunction exceeds 125°C, you need better thermal management. For the TO-220 package without a heatsink, Rth is typically 50-65°C/W. At 1W dissipation, that is a 50-65°C rise above ambient—acceptable for many applications. At 2W, you are looking at 100-130°C rise, which will likely cause thermal shutdown in a warm environment.
Why does my LM2596 circuit have high output ripple?
High ripple usually indicates one of several issues: the output capacitor ESR is too high (or the capacitor has degraded with age), the inductor value is too low for the operating conditions, or there is excessive trace inductance in the output loop. Check capacitor specifications and consider adding a second capacitor in parallel to reduce effective ESR. Also verify the inductor is not saturating at your load current—saturation causes inductance to drop suddenly, increasing ripple dramatically.
Can I parallel two LM317s for higher output current?
Directly paralleling LM317s without ballast resistors will result in current hogging—one device will try to supply most of the current due to slight differences in reference voltage. Add 0.1-0.5Ω ballast resistors in series with each output, sized so the voltage drop at full current exceeds the typical unit-to-unit variation in output voltage (about 50mV). For higher current needs, consider the LM350 (3A), LM338 (5A), or move to a switching regulator.
What causes the LM2596 to oscillate?
Oscillation in the LM2596 typically stems from inadequate output capacitor ESR (too low with ceramic caps), insufficient input capacitance, excessive trace inductance in the feedback path, or marginal component values. Start troubleshooting by verifying the capacitor ESR is within the 0.02-0.3Ω range. Check that input and output capacitors are genuine parts with correct values—counterfeit components from unreliable sources often fail to meet specifications. Also ensure the feedback resistor traces are not picking up noise from the switching node.
Final Thoughts
Getting voltage regulator PCB layout right is not about following rules blindly—it is about understanding the physics behind those rules. The LM2596 needs tight, low-inductance current loops because it switches at 150kHz and the parasitic inductance creates voltage spikes proportional to di/dt. The LM317 needs good thermal management because it converts voltage difference directly into heat.
Once you internalize these principles, you can adapt to different board constraints, different packages, and different operating conditions. The specific trace lengths I mentioned are guidelines, not absolute limits. What matters is keeping the high-frequency current loops as small as possible for the LM2596, and ensuring adequate heat dissipation for the LM317.
Both regulators have been around for decades, and both continue to be manufactured by multiple vendors. That longevity speaks to their fundamental soundness when applied correctly. Take the time to lay out your power supply section properly, and you will have a reliable foundation for the rest of your circuit.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.