Ir al contenido

AC Dimmer Safety: Mains Voltage, Isolation, and Wiring

What the optical isolation boundary protects and what it does not. Wire sizing, fuse selection, enclosure rules, and a safe first-assembly procedure.

TL;DR: AC dimmer modules use optical isolation — the MCU-side pins (ZC, DIM, VCC, GND) are electrically separated from 230V mains. The AC terminals (AC-IN, AC-N, AC-OUT) are live mains voltage. Size wire as S = I / 8 (copper, mm²) — see table for AWG equivalents. Fuse at I_load × 1.25. Always disconnect power before wiring. Enclose all AC terminals.




How Optical Isolation Works

Each rbdimmer module contains two optocoupler circuits that bridge the 230V AC side and the 3.3V/5V MCU side without a direct electrical connection:

Zero-cross optocoupler — detects each AC zero-crossing and generates a digital pulse on the ZC pin. The high-voltage detection circuit and the low-voltage output are separated by the optocoupler's LED/phototransistor barrier.

TRIAC driver optocoupler — receives the DIM signal from the MCU and triggers the TRIAC gate. The gate trigger signal crosses the isolation barrier through the optocoupler, not through a direct wire.

text
MCU side (3.3V/5V)     Isolation barrier     AC side (230V)
──────────────────     ─────────────────     ─────────────
ZC pin ◄─── optocoupler ◄─── ZC detector ◄── AC-L and AC-N
DIM pin ───► optocoupler ───► TRIAC gate
VCC, GND                        AC-IN → TRIAC → AC-OUT

⚠️ The ZC detector requires both AC-L and AC-N to function. ZC will not work if only one wire is connected to the module.

The insulation across the optocoupler barrier is rated for at least 400V — safely above the peak voltage of a 230V AC line (~325V).

For a detailed explanation of TRIAC phase-cut operation and the zero-cross circuit, see: TRIAC Operation Principles




Isolation Boundary

Understanding what is and is not isolated:

Component Side Live at 230V? Notes
ZC pin MCU (isolated) No Safe to touch (MCU only)
DIM pin MCU (isolated) No Safe to touch (MCU only)
VCC, GND pins MCU (isolated) No MCU logic voltage only
PCB — MCU side MCU (isolated) No
AC-IN terminal Mains Yes Live when connected
AC-N terminal Mains Yes ² Live when connected
AC-OUT terminal Mains Yes Live when connected
TRIAC body Mains Yes TRIAC is in-line with load
TRIAC tab (TO-220) Mains Yes ¹ See heatsink note below

¹ On TO-220 packaged TRIACs the metal mounting tab is electrically connected to MT2 — one of the main AC terminals. If you add an external heatsink, place an insulating silicone or mica pad between the TRIAC body and the heatsink, and use an insulating bushing for the mounting screw. Without this the heatsink is live at mains potential.

² AC-N is close to earth potential only in a correctly grounded (TN/TT) system. Always treat neutral as live — it carries return current and is dangerous when grounding is absent or wiring polarity is reversed.

⚠️ Touching any AC-side terminal while the module is plugged in can cause electrocution regardless of whether the load is on or off. The neutral (AC-N) wire carries return current and is not a safe reference.




Before You Wire

Do these before touching any terminal:

  1. Turn off the circuit breaker that feeds the dimmer circuit.
  2. Test with a multimeter (voltage range) at the point where you will work — confirm 0V before touching anything.
  3. Lock out or tag the breaker if others are nearby.
  4. Use insulated tools rated for the working voltage.
  5. Do not work alone on mains circuits — electric shock causes involuntary muscle spasm that prevents self-rescue; a second person can disconnect power immediately.



Wire Sizing

Use the formula from the hardware documentation:

S (mm²) = I (A) / 8 — copper wire, in free air up to 30 °C

Module Max current Min wire (copper) AWG equiv.
1CH 4A 4 A 0.5 mm² 20 AWG
1CH 8A / 2CH 8A 8 A per ch 1.0 mm² 17 AWG
4CH 10A 10 A per ch 1.5 mm² 15 AWG
1CH 16A 16 A 2.5 mm² 13 AWG
1CH 24A 24 A 3.0 mm² 12 AWG
1CH 40A 40 A 5.0 mm² 10 AWG

Additional sizing rules:

  • If wires run inside a conduit or bundled with others, increase by one standard size (e.g., 1.0 mm² → 1.5 mm²).
  • Inside an enclosure: ambient temperature rises with load. At 40°C or above, derate by 20% — use the next standard size up.
  • Use stranded wire for flexible connections, not solid-core. Per IEC 60228, stranded wire of the same nominal cross-section carries the same rated current as solid-core — no derating needed.
  • Crimp bootlace ferrules (end sleeves) on stranded wire ends before inserting into screw terminals — prevents stray strands from bridging adjacent terminals.
  • The neutral wire to the ZC detector (AC-N → zero-cross module) carries only 5–10 mA. Use 0.25–0.5 mm² (AWG 22) for this connection — it does not carry load current.
  • Copper wire is strongly recommended. If aluminum wire is unavoidable: S = I / 5 (aluminum conducts less current per mm²).
  • All insulation must be rated for at least 400V (standard mains-grade PVC insulation is rated 300/500V or 450/750V).



Fuse Selection

I_fuse (A) = I_load (A) × 1.25

The fuse must be placed on the AC L-IN wire before the dimmer, not on the load side. This protects both the wiring and the module from short-circuit and overload.

Load current Calculated Standard fuse to use
Up to 4 A 5.0 A 5 A or 6 A
Up to 8 A 10.0 A 10 A
Up to 10 A 12.5 A 13 A
Up to 16 A 20.0 A 20 A
Up to 24 A 30.0 A 32 A
Up to 40 A 50.0 A 50 A

Never install a fuse rated higher than the module's max current. A 40A fuse on a 1CH 8A module will not protect the module — the module will fail before the fuse blows.

For permanent installations a miniature circuit breaker (MCB) is preferred over a fuse: it resets without replacing, and its trip curve is more predictable for motor loads.




Enclosure Requirements

Exposed AC terminals in a finished installation are a safety and legal hazard. Requirements:

Environment Minimum IP rating Typical option
Dry indoor IP20 Standard ABS project box
Damp indoor (bathroom) IP44 Sealed enclosure
Outdoor IP67 Weatherproof enclosure
Panel / DIN Rail IP40 DIN rail enclosure

The DIN Rail 2CH and 4CH modules are designed to mount directly on standard 35mm DIN rail inside a distribution board enclosure — the enclosure provides the required protection.

Additional requirements:

  • No flammable material directly behind the TRIAC — it generates heat at high loads. Use a steel or aluminium enclosure or add a heatsink with proper insulating pads.
  • Route MCU cables (ZC, DIM, VCC, GND) physically separate from AC cables. At minimum, cross them at 90°. Running them parallel increases EMI interference in the MCU logic.



Step-by-Step First Assembly

  1. Draw the circuit — sketch AC-IN → dimmer → load → AC-N and MCU connections before picking up a wire.
  2. Install upstream protection — fit a fuse or MCB rated to the load (see table above) before the dimmer's AC-IN terminal.
  3. Disconnect and verify — turn off power, test with multimeter.
  4. Prepare wire ends — strip 6–8 mm of insulation, crimp ferrules on stranded ends.
  5. Wire the load circuit first — connect AC-OUT → load → AC-N. The load can be a lamp, heater, or another resistive load.
  6. Connect AC-IN last — this wire becomes live the moment the circuit breaker closes. All other connections must be made first while the circuit remains de-energized.
  7. Tighten screw terminals — firm but not overtightened. A loose terminal is a fire hazard; a stripped screw is useless.
  8. Connect the MCU side — ZC, DIM, VCC, GND last.
  9. Inspect before closing — check for any exposed conductor strand outside a terminal, any mis-routed wire, any bridged adjacent terminals.
  10. Close and secure the enclosure — no AC terminal must be reachable by finger in the finished assembly.



Testing Safely: Light Bulb Limiter

Before first power-on of any mains device, use a series light bulb limiter:

text
MAINS L ──► [Fuse] ──► [100W bulb] ──► AC-IN on dimmer
                                         AC-OUT ──► Load
MAINS N ──────────────────────────────► AC-N

How it works:

  • No fault: the bulb barely glows or stays dark (just a small voltage drop across the filament).
  • Short circuit: the bulb glows brightly and limits fault current to ~0.4A at 230V — protecting your wiring and module.

A 100W incandescent bulb (~530 Ω when hot) is the traditional choice, but is increasingly hard to find where it has been phased out. Alternatives that work equally well:

  • 100W halogen bulb — same resistance characteristic
  • 200–500 Ω, 100W ceramic power resistor — no visual indication

Remove the limiter only after confirming normal operation.




Common Mistakes

Mistake Risk Fix
Wiring while powered Electrocution Disconnect, test 0V first
No upstream fuse Fire Add fuse: I_load × 1.25
Undersized wire Overheating, fire Use table above
Bare TRIAC heatsink Heatsink live at 230V Insulating pad required
No enclosure Shock hazard Enclose all AC terminals
MCU and AC cables parallel EMI / noise in code Separate routing
Oversized fuse No overload protection Match to module rating
Solid-core wire without ferrule Strand bridging Crimp ferrules



Pre-Power-On Checklist

Before applying mains voltage:

  • ☐ Circuit breaker / fuse installed upstream
  • ☐ Multimeter confirms 0V at all terminals before wiring
  • ☐ All screw terminals tight
  • ☐ No stray wire strands outside terminals
  • ☐ Wire gauge matches load current (see table)
  • ☐ Fuse rated at I_load × 1.25, not exceeding module max
  • ☐ TRIAC heatsink isolated from TRIAC tab (if heatsink added)
  • ☐ MCU-side cables separated from AC cables
  • ☐ All AC terminals enclosed or covered
  • ☐ Optional: resistance between AC-IN and AC-N > 0 Ω
  • plaintext
    (near-zero indicates a short circuit in load or wiring)
  • ☐ Light bulb limiter in place for first power-on test



  • Related Articles



    Still have questions?

    Ask on forum.rbdimmer.com or open a GitHub Issue.

    Compartir esta publicación
    Iniciar sesión para dejar un comentario