LEDs are built for DC power, but two very common power sources in hobby and landscape applications output AC, not DC: 12V AC landscape lighting transformers and DCC model railroad track power. This applies whether you are using pre-wired LEDs (resistor already built in) or bare component LEDs (resistor added externally). Connect either type directly to AC without conversion and you may get dim, flickering, or no light — and animated LEDs will not work at all. This guide explains why and shows exactly how to fix it.
Pre-wired vs. Component LEDs — What's the Difference?
Pre-wired LEDs come with lead wires already attached and a current-limiting resistor built in and sized for a specific DC supply voltage (6V, 9V, or 12V). You connect power and ground — no resistor calculation needed.
Bare component LEDs (DIP or SMD) do not include a resistor. You must add a current-limiting resistor in series. The resistor value depends on your supply voltage and the LED's forward voltage: R = (Vsupply − Vf) ÷ If. For a typical 12V supply with a 2V LED at 20mA: R = (12 − 2) ÷ 0.020 = 500Ω — use a standard 470Ω or 510Ω resistor. See our resistors for sizing options.
The bridge rectifier and capacitor circuits below work identically for both types. The only difference is where the resistor lives — built into the pre-wired LED, or added as a separate component in series with a bare LED.
Why AC Causes Problems
A standard LED is a one-way device — current flows in one direction only. When AC voltage is applied, the LED conducts on the positive half-cycle and blocks on the negative half-cycle. At low frequencies (60Hz mains) this can cause visible flicker; at higher frequencies (DCC is typically 5–9kHz) the switching is too fast to see. So a standard non-animated LED will illuminate on AC, though DC is always recommended for rated brightness and longevity.
Animated LEDs are different. Both animated pre-wired LEDs and animated component LEDs contain a small integrated circuit (IC) that drives the flashing, flickering, or color-cycling effect. That IC requires a stable DC supply voltage to run its internal timing circuit. Feed it AC — or unsmoothed pulsed DC — and the IC will reset, misfire, or produce erratic behavior on every cycle. The LED may flash randomly, not animate at all, or simply not light up.
The solution is a bridge rectifier, and for animated LEDs, a smoothing capacitor too.
Circuit 1: Bridge Rectifier + Standard LED
A bridge rectifier converts AC into pulsed DC by routing both half-cycles of the AC waveform in the same direction. The MB1S mini bridge rectifier is an excellent choice for this application — it handles up to 500mA continuous, operates up to 35V, and is small enough to fit inside a locomotive shell or landscape fixture base.
What You Need
- MB1S mini bridge rectifier
- Your LED — either a pre-wired LED (resistor built in, match voltage to your supply) or a bare component LED with a correctly sized series resistor
- Small lengths of wire, soldering iron and solder
Wiring Steps
- Identify the MB1S pins. The MB1S is a small 4-pin SOP package. Pin 1 (marked with a dot or notch) and pin 3 are the AC input pins (AC~). Pin 2 is DC negative (−) and pin 4 is DC positive (+). Refer to the MB1S datasheet for the pinout diagram.
- Connect your AC source. Solder the two wires from your 12V AC transformer output (or DCC track wires) to pins 1 and 3 (AC~). Polarity does not matter on the AC input side.
- If using a bare component LED: solder the current-limiting resistor in series between pin 4 (DC+) and the LED's anode (+). The resistor can go on either side of the LED — in series means anywhere in the same current path.
- Connect the LED. For pre-wired LEDs, solder the red wire (+) to pin 4 (DC+) and the black wire (−) to pin 2 (DC−). For bare component LEDs, connect anode → resistor → DC+, cathode → DC−.
- Test. Apply power. The LED should illuminate at full brightness. If it does not light, verify polarity and that the resistor value is correct for your supply voltage.
Note: The rectifier output is pulsed DC, not smooth DC. For a standard (non-animated) LED this is perfectly fine — there is no IC inside to destabilize, and the pulsing is too fast to appear as flicker.
Circuit 2: Bridge Rectifier + Smoothing Capacitor + Animated LED
For animated LEDs — whether animated pre-wired or animated component LEDs — we add one component: a 100µF electrolytic capacitor wired in parallel with the LED. The capacitor charges during each DC pulse and discharges between pulses, smoothing the supply into steady DC. This gives the built-in IC the stable voltage it needs to run its timing circuit reliably.
What You Need
- MB1S mini bridge rectifier
- 100µF electrolytic capacitor, rated 25V or higher
- Your animated LED — animated pre-wired (resistor built in) or animated component LED with series resistor
- Small lengths of wire, soldering iron and solder
Wiring Steps
- Wire the MB1S the same way as Circuit 1. AC source to pins 1 and 3; DC+ on pin 4, DC− on pin 2.
- If using a bare component animated LED: add the series resistor in the same way as Circuit 1 — between DC+ and the LED anode.
- Add the capacitor in parallel. The capacitor connects between the DC+ and DC− rails — directly across the LED's positive and negative connections. Electrolytic capacitors are polarized: the longer leg (or the leg opposite the stripe on the body) is positive (+). Connect positive to DC+ and negative to DC−. Reversing polarity will damage the capacitor.
- Connect the animated LED. The capacitor and LED share the same + and − rails — they sit in parallel, not in series.
- Test. Apply power. The animated LED should light up and begin its sequence within 1–2 seconds. If it lights steadily without animating, verify the capacitor is wired in parallel (not in series) and that polarity is correct.
Common Questions
Do I need a resistor with a pre-wired LED?
No — pre-wired LEDs already have the resistor built in and sized for their rated voltage (6V, 9V, or 12V). Just match the LED's voltage rating to your DC supply. Bare component LEDs always require an external series resistor; without one the LED will draw excessive current and burn out quickly.
Does the capacitor value need to be exactly 100µF?
Not exactly. Values from 47µF to 220µF will work well. Larger values provide more smoothing but take longer to charge. 100µF is a practical middle ground. The voltage rating must exceed your supply voltage — for a 12V supply, use a capacitor rated 25V or higher.
Do I need a capacitor for DCC layouts?
For standard (non-animated) LEDs on DCC: no. DCC operates at high enough frequency that pulsed DC from the rectifier cycles too fast for the eye to detect, and there is no IC to destabilize. The rectifier alone is sufficient.
For animated LEDs on DCC: yes, add the 100µF capacitor. The built-in IC needs stable DC regardless of the AC source frequency — this applies to both animated pre-wired and animated component LEDs.
What if my landscape transformer already outputs DC?
Modern LED-compatible landscape transformers often output DC directly. Check your transformer label — if it says "DC output" or shows a DC symbol (straight line over dashed lines), you do not need a bridge rectifier. Connect the LED directly, matching polarity. If it says "AC output" or shows a sine wave symbol (~), follow the circuits above.
Quick Reference
| LED Type | Power Source | Series Resistor? | Need Rectifier? | Need Capacitor? |
|---|---|---|---|---|
| Pre-wired LED (standard) | 12V AC landscape / DCC | Built in | Recommended | No |
| Component LED (standard) | 12V AC landscape / DCC | Yes — external | Recommended | No |
| Pre-wired LED (animated) | 12V AC landscape / DCC | Built in | Yes — required | Yes — required |
| Component LED (animated) | 12V AC landscape / DCC | Yes — external | Yes — required | Yes — required |
| Any LED | DC power supply | Pre-wired: built in / Component: external | No | No |
Browse our pre-wired LEDs, component LEDs, resistors, and MB1S bridge rectifiers, and 100µF smoothing capacitors to get started.