If you are designing a smart home automation enclosure, a workshop control box, or a security system rack, you need reliable low-voltage DC. When researching components, you might ask: what is a switch power supply? More accurately termed a Switched-Mode Power Supply (SMPS), this device converts AC mains voltage into regulated DC by rapidly switching a semiconductor on and off, rather than burning off excess voltage as heat.
In residential and commercial control panels, DIN-rail mounted SMPS units are the standard for stepping 120VAC or 240VAC down to 12VDC or 24VDC. They power relays, PLCs, ESP32 sensor nodes, and motor controllers. But choosing the right topology, calculating thermal derating inside a sealed steel enclosure, and wiring the mains input to a subpanel requires precise electrical and electronic knowledge. Here is the bench-to-jobsite guide to specifying and installing an SMPS.
Linear vs. Switching Topologies: Efficiency, Heat, and Noise
To understand the value of an SMPS, you have to compare it against the legacy alternative: the linear power supply. A linear supply uses a heavy iron-core transformer to step down AC voltage, rectifies it, and then uses a linear regulator (like an LM317) to drop it to the final DC target. The problem? The linear regulator acts like a variable resistor, burning the voltage difference as waste heat.
When deciding between linear vs switching for this load, the decision almost always favors switching for anything above 10 watts. If your control panel requires 24VDC at 1.5A (36W), a linear supply dropping from a 32VDC rectified bus would dissipate roughly 12W of pure heat inside your enclosure. An SMPS achieves the same result by storing energy in inductors and capacitors, generating barely 4W of heat.
| Topology | Efficiency | Heat Dissipation | Output Noise/Ripple | Cost per Watt |
|---|---|---|---|---|
| Linear (Transformer + LDO) | 30-45% | High (Wasted as heat) | Very Low (<5mV p-p) | High ($0.50-$1.00/W) |
| Flyback SMPS (Isolated) | 75-85% | Low | Medium (50-100mV p-p) | Low ($0.10-$0.20/W) |
| Buck SMPS (Non-Isolated) | 85-95% | Very Low | Medium-High (30-80mV p-p) | Very Low ($0.05-$0.15/W) |
| LLC Resonant SMPS | 90-96% | Minimal | Low (20-40mV p-p) | Medium ($0.25-$0.40/W) |
Ripple and Noise Expectations: The trade-off for SMPS efficiency is high-frequency switching noise. A typical Flyback SMPS operating at 65kHz to 130kHz will exhibit 50mV to 100mV peak-to-peak ripple on the DC output. For driving mechanical relays, LED strips, or digital logic (like an Arduino or ESP32), this ripple is entirely harmless. However, if your panel includes sensitive analog audio amplifiers or precision ADC sensors, you must add a downstream LC (inductor-capacitor) pi-filter or a low-dropout (LDO) post-regulator to clean the rail. For a deep dive into switching noise mitigation, refer to the Switch-Mode Power Supply Basics guide on All About Circuits.
Design Example: Sizing a 24V DIN-Rail SMPS for a Smart Home Subpanel
Let us spec out a real-world power supply for a NEMA 1 smart home control subpanel. The load consists of eight 24VDC ice-cube relays, a 24VDC security siren, and a 5VDC Raspberry Pi 4 running Home Assistant.
We will use a Mean Well HDR-30-24, a 30-watt, ultra-slim DIN-rail SMPS. This isolated Flyback topology provides the necessary safety barrier between the 120VAC mains and the low-voltage control wiring.
| Parameter | Value | Engineering Notes |
|---|---|---|
| Input Voltage Range | 85 - 264 VAC | Universal input; handles 120V nominal and 240V nominal without a manual switch. |
| Output Voltage | 24 VDC | Adjustable via trim potentiometer (21.6V - 29V range). |
| Output Current | 1.5 A (Continuous) | Supports 2.0 A peak for up to 30 seconds (useful for relay inrush). |
| Isolation Withstand | 4,000 VAC | Primary-to-secondary isolation ensures low-voltage safety. |
Dropout and Headroom Math: The Raspberry Pi requires 5.1VDC at up to 3A. To step the 24VDC bus down to 5VDC, we use a buck converter module based on the Texas Instruments LM2596. The LM2596 requires a minimum dropout voltage (headroom) of roughly 1.5V to maintain regulation. With 24V in and 5V out, the delta is 19V—far exceeding the dropout requirement. This guarantees the buck converter stays in continuous conduction mode (CCM) and prevents brownouts when the Pi CPU spikes. For more on regulator headroom, consult the TI Power Topologies Handbook.
Wiring, Protection, and Grounding the SMPS Input
An SMPS is only as safe as its mains wiring. Because this unit is being installed in a home automation subpanel fed from the main service panel, we must follow strict NEC-style guidelines for wire sizing, breaker protection, and grounding.
Input Protection and Wire Sizing:
The HDR-30-24 draws a maximum of 0.5A at 120VAC under full load. However, SMPS units feature large input filter capacitors that draw a high inrush current (often 20A to 40A for a few milliseconds) upon initial power-up. Therefore, you cannot use a tiny 1A breaker.
- Breaker Sizing: Use a standard 15A, single-pole thermal-magnetic breaker in the subpanel. This handles the inrush spike without nuisance tripping while still protecting the wiring.
- Wire Gauge: Run 14 AWG THHN stranded or solid copper wire. 14 AWG is rated for 15A (based on the NEC 60°C/75°C ampacity columns) and is physically robust enough to survive the vibration of a closing panel door.
- Color Codes: Use Black for the 120VAC Hot (Line), White for the Neutral, and Green (or bare) for the Equipment Grounding Conductor (EGC).
Grounding vs. Bonding in the Subpanel:
This is where many DIYers make a critical, dangerous mistake. The SMPS chassis and the metal DIN rail must be grounded to clear fault currents. You will land the Green EGC wire on the subpanel's ground bar, and run a bonding jumper from the ground bar to the DIN rail.
However, because this is a subpanel and not the main service disconnect, the neutral bar and the ground bar must remain completely isolated. Do not install the main bonding screw or strap in this subpanel. If you bond neutral and ground at the subpanel, normal neutral return current will travel back to the main panel along the bare ground wires, energizing the DIN rail and creating a severe shock hazard. For a complete breakdown of subpanel grounding rules, reference NFPA 70 (National Electrical Code) Article 250.142 and Article 409 regarding industrial control panels.
By pairing the high efficiency of a switched-mode topology with proper subpanel wiring practices, you ensure your control enclosure runs cool, operates reliably through summer heatwaves, and remains electrically safe for anyone who opens the dead front.






