All projects
PRJ-04 · Embedded Systems / IoT / Industrial Electronics

IoT DIN-Rail Dual Relay Controller

Custom ESP8266-Based 1-DIN Wi-Fi Automation Controller

Complete custom hardware design from circuit architecture and PCB through power conversion and enclosure integration.

ESP8266Custom PCBWi-Fi2× RelayAC/DC PowerFlybackDIN RailEmbedded HardwareIndustrial IoT
Completed DIN-201 Wi-Fi dual relay controller in its 1-DIN enclosure
Completed 1-DIN enclosure · front-panel controls and status indicators

01 Project Overview

A compact 1-DIN Wi-Fi connected dual-relay controller built around the ESP8266. The device integrates a custom mains-powered AC/DC supply, two independently controlled relay outputs, local push-button control, status indication and wireless connectivity into a single DIN-rail module. The complete electronic hardware and PCB were designed from the ground up, with the mechanical design developed around the requirements of a compact 1-DIN enclosure.

Form factor
1-DIN modular enclosure
Control
ESP8266 + Wi-Fi
Outputs
2 independent NO relay outputs

02 My Contribution

I was responsible for the complete hardware design of the controller, including the ESP8266-based control electronics, isolated AC/DC power supply, relay output stages, user controls and PCB layout. I also supervised the mechanical design and integration of the electronics into the compact 1-DIN enclosure.

Complete Hardware Design

  • Complete electronic hardware architecture
  • Schematic design
  • Component selection
  • Custom PCB design and layout
  • ESP8266 integration
  • AC mains input interface
  • AC/DC power supply design
  • Flyback-transformer power conversion
  • Relay driver/output circuitry
  • Front-panel push-button circuitry
  • LED status indication
  • Reset interface
  • Connector / terminal selection
  • PCB bring-up and hardware debugging

Mechanical Integration

  • Enclosure requirements
  • PCB/enclosure fit
  • Front-panel alignment
  • Push-button accessibility
  • LED visibility
  • Terminal selection and accessibility
  • DIN-rail mounting
  • Mechanical design supervision
  • 1-DIN form-factor integration

03 From PCB to Finished Controller

01 / Custom PCB

ESP8266 + relays + AC/DC power

02 / Mechanical Integration

1-DIN enclosure

03 / Finished Device

Wi-Fi dual relay controller

DIN-201 1-DIN controller with status LED, reset button and two relay buttons and indicators
Finished controller — custom electronics integrated into the 1-DIN enclosure

04 Hardware Architecture

AC mains — L / N
AC/DC power supply
ESP8266
Push buttons
LED indicators
Wi-Fi
Embedded control logic
Relay 1
NO OUT 1
Relay 2
NO OUT 2
Conceptual architecture · power and control blocks

05 Integrated AC/DC Power Supply

The controller is powered directly from the L/N mains input and includes an integrated AC/DC conversion stage to generate the low-voltage DC rails required by the ESP8266 and relay-control electronics.

AC mains — L / N
Input protection
AC/DC converter
Flyback transformer
Rectification / filtering
Low-voltage DC
ESP8266
Relay stage
Conceptual power flow · component values and rail voltages not specified
  • AC mains input
  • AC/DC conversion stage
  • Flyback transformer
  • Rectification / filtering
  • DC power rails
  • ESP8266 supply
  • Relay supply / control circuitry

06 Dual Relay Outputs

Electrical Interfaces

Input

L — Line
N — Neutral

Direct AC mains input to the internal power supply.

Outputs

Relay Output 1 — Normally Open (NO)
Relay Output 2 — Normally Open (NO)

Two independent switched relay outputs.

AC mains — L / N
AC/DC power supply
ESP8266
Relay 1
NO OUT 1
Relay 2
NO OUT 2

07 Local Control & Status

Each relay can be operated locally through its dedicated front-panel push button. Dedicated LEDs provide immediate indication of relay state, while a separate status LED indicates the operating state of the embedded controller. A reset button provides direct local system reset.

DIN-201 1-DIN controller with status LED, reset button and two relay buttons and indicators
Actual front panel: Status, Reset, Relay 1 and Relay 2
STATUS
RESET
RELAY 1
RELAY 2
Din-201
Front-panel control layout · schematic
  • Output 1 push button
  • Output 2 push button
  • Reset push button
  • Output 1 LED
  • Output 2 LED
  • System Status LED

08 Wi-Fi Connectivity

Wi-Fi Connected Control

The ESP8266 provides the embedded control and Wi-Fi connectivity layer of the device. The two relay outputs can be controlled electronically through the embedded system while retaining local physical controls on the front panel.

Remote / network control
Wi-Fi
ESP8266
Relay 1
NO OUT 1
Relay 2
NO OUT 2

09 Custom PCB Design

Custom Hardware & PCB

The PCB integrates the ESP8266 communication and control platform, two relay output stages, the mains-powered AC/DC supply, local push buttons, status LEDs and terminal interfaces on a compact board designed specifically for the DIN-rail enclosure.

Assembled custom DIN-rail controller PCB with Wi-Fi module, two relays, terminal connectors and front-panel buttons and LEDs
Assembled custom PCB · internal electronics and front-panel interfaces
  • ESP8266 module
  • Two electromechanical relays
  • AC/DC power conversion circuitry
  • Flyback transformer
  • Power-supply capacitors and filtering
  • Terminal connectors
  • Push buttons
  • Status LEDs
  • PCB sized for the 1-DIN enclosure

10 1-DIN Mechanical Integration

The electronic design was developed specifically around the dimensional constraints of a standard 1-DIN enclosure. I supervised the mechanical design to ensure correct PCB fit, terminal accessibility, front-panel alignment and practical DIN-rail installation.

Inside / Custom PCB
Assembled custom DIN-rail controller PCB with Wi-Fi module, two relays, terminal connectors and front-panel buttons and LEDs
Assembled custom PCB · internal electronics and front-panel interfaces

ESP8266, dual relay stages, AC/DC power conversion and local interfaces developed for the enclosure’s dimensional constraints.

Outside / Completed 1-DIN Controller
DIN-201 1-DIN controller with status LED, reset button and two relay buttons and indicators
Electrical/mechanical integration in the DIN-201 enclosure
  • Enclosure requirements
  • PCB/enclosure fit
  • Front-panel alignment
  • Push-button accessibility
  • LED visibility
  • Terminal selection and accessibility
  • DIN-rail mounting
  • Mechanical design supervision
  • 1-DIN form-factor integration

11 Testing & Bring-Up

My hardware-development contribution included PCB bring-up and hardware debugging, alongside integration of the electronics into the compact 1-DIN enclosure.

  • PCB bring-up
  • Hardware debugging

12 Technology Stack

ESP8266Custom PCBWi-Fi2× RelayAC/DC PowerFlybackDIN RailEmbedded HardwareIndustrial IoT