Skip to the content
2 layers165 × 110 mmClean room, the printed circuit board in 3D

ESP32-based slave controller board for cleanroom equipment — RS485/Modbus, isolated I/O, 220V mains control (KiCad)

Size
165 × 110 mm
Copper layers
2
Thickness
1.6 mm
Parts
213
Nets
136
Pads
649
Tracks, vias
1,170, 492
Pours
28
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
9 Sep 2026
Updated
9 Sep 2026

Overview

Clean room is an open-source printed circuit board by trieuhuyduc, from the trieuhuyduc/Clean_room_slave repository on GitHub. It is a 2-layer board of 165 × 110 mm with 213 parts on 136 nets, routed with 1,170 tracks and 492 vias.

It is built around the MAX485ED, ESP32-WROOM-32 and HLK-10M12, with the ISO7721DR-Y, AMS1117 and SI2302 among its other parts. Its parts include 74 resistors, 42 capacitors, 15 transistors, 11 ICs and 9 connectors. It belongs with the interfaces and adapters boards and the ESP32 boards of this library.

Main components

10

README

README.md

Clean_room_slave_v1 — ESP32 Cleanroom Equipment Controller

An ESP32-WROOM-32 based slave controller board for cleanroom equipment, designed in KiCad with RS485/Modbus industrial communication, digitally isolated I/O, and a 220 V mains control stage. Designed by Triệu Huy Đức.

Status: design complete, pre-production review in progress — not yet released to fabrication. See Project Status below; this is deliberate, not an oversight — the review that caught the remaining issues is part of what this repo documents.

🇬🇧 English · 🇻🇳 Tiếng Việt


English

Overview

This board acts as an RS485 slave node that reads digital/analog inputs and drives a 220 V mains-side control stage (relay/TRIAC), reporting over an isolated RS485 bus back to a master controller. It was designed from schematic capture through layout to manufacturing-file export in KiCad.

Key specs

MCUESP32-WROOM-32
Schematic6 hierarchical sheets · 211 symbols · 212 footprints · 136 nets
PCB2-layer, ~163 × 110 mm · 1,165 tracks · 456 vias · 647 pads · 29 copper zones
IsolationISO7721 (2-channel digital isolator) + MAX485 on the RS485 side; EL357 optocouplers on mains-referenced digital inputs
Other ICsDS3231M (battery-backed RTC), AMS1117 (LDO regulation)
InterfacesRS485 (isolated), opto-isolated digital inputs, 220 V relay/TRIAC control, buzzer
Manufacturing outputsBOM, CPL (placement), Gerber + drill archive — see OUTPUT_CLEARROOM_SLave/

Design highlights

A few of the calculated decisions behind this board — not just "which part was used" but why, with the numbers to back it:

  • RS485 fail-safe biasing recalculated. The original 4.7 kΩ bus-bias resistors gave far too little differential voltage to guarantee a defined idle state. Recomputed to 470 Ω, yielding VAB = 300 mV against the 200 mV receiver threshold — with the resulting 56.4 Ω driver load (26.6 mA) confirmed to stay within the MAX485's rated drive capability.
  • Optocoupler CTR budget corrected. The original 1 kΩ pull-up demanded 290 % CTR from the EL357 optocoupler — physically impossible. Recalculated the sink current against a 47 kΩ pull-up instead, dropping the requirement to a realistic 6.2 % CTR.
  • ESP32 EN-pin reset timing tuned. Set the power-on reset RC constant to 10 ms (10 kΩ + 1 µF) per Espressif's official guidance, resolving unreliable resets on power-up.
  • GPIO2 strapping divider re-derived so that VGPIO2 stays below the 0.825 V boot-strap threshold across the entire supply voltage range, rather than at one nominal voltage only.
  • ISO7721 pinout traced against the datasheet and documented explicitly — channel A runs side-2→side-1 while channel B runs side-1→side-2, a detail easy to misread that had previously led to an incorrect "fix" being applied to a circuit that was already wired correctly.

Project status

This board has not been released to fabrication yet. A self-conducted pre-production design review — built around an automated clearance checker run directly against the PCB netlist and copper geometry — found two classes of issues before any board was ordered:

  • Mains ↔ SELV creepage as low as 1.335 mm, against a ~6 mm safety requirement (15 objects flagged under 3 mm).
  • RS485 isolation barrier spacing as low as 0.200 mm, against a ≥1 mm target (11 objects flagged under 1 mm).
  • Root cause: the KiCad project's min_clearance design rule was set to 0, so the built-in DRC was not enforcing any minimum spacing at all — a normal "DRC passed" run gave false confidence.
  • Zero copper-to-copper shorts between different nets were confirmed (762/762 verified trace endpoints land on the correct net).

A coordinate-indexed remediation list was produced to guide the clearance fixes before this board goes to fabrication. The full review trail is kept in its original Vietnamese — these were written as working documents during the review itself, including the false starts and corrections along the way:

Repository structure

text
Clean_room/
├── Clean_room.kicad_pro/.kicad_sch/.kicad_pcb/.kicad_prl   top-level project, schematic, PCB, local settings
├── 220V_Control.kicad_sch     mains-side relay/TRIAC control
├── MCU.kicad_sch               ESP32-WROOM-32 core
├── INPUT_COM.kicad_sch         opto-isolated digital inputs
├── PW_SUPPLY.kicad_sch         power supply (AMS1117 LDO, etc.)
├── RS485_COM.kicad_sch         RS485 transceiver + ISO7721 isolation
├── fp-lib-table                 footprint library table (project-relative, portable)
├── lib/ProjectFP.pretty/        custom footprint library
├── OUTPUT_CLEARROOM_SLave/      BOM, CPL, Gerber + drill archive
├── REVIEW_TONG_THE.md            full schematic-vs-netlist design review (Vietnamese)
├── KIEM_TRA_RS485.md             RS485 / isolation channel deep-dive (Vietnamese)
├── KIEM_TRA_TRUOC_SAN_XUAT.md    pre-fabrication safety-clearance gate (Vietnamese)
└── DANH_SACH_SUA_LAYOUT.md       coordinate-indexed copper remediation list (Vietnamese)

Getting started

  1. Install KiCad 7 or newer (project files declare schema version 7).
  2. Open Clean_room/Clean_room.kicad_pro.
  3. The custom footprint library resolves automatically via a project-relative path (${KIPRJMOD}/lib/ProjectFP.pretty) — no manual library configuration needed.

The ISO7721 datasheet is not bundled here (third-party copyrighted material) — see TI's ISO7721 product page instead.

License

Not yet chosen. If you'd like to reuse this design, please open an issue or contact the author first — an open-hardware license (e.g. CERN-OHL) is under consideration but not yet applied.

Author

Triệu Huy Đức


Tiếng Việt

Tổng quan

Đây là board slave điều khiển thiết bị phòng sạch, đọc tín hiệu vào số/analog và điều khiển khối 220V (relay/TRIAC), báo cáo về bộ điều khiển trung tâm qua bus RS485 cách ly. Thiết kế hoàn chỉnh từ sơ đồ nguyên lý, layout PCB đến xuất file sản xuất trên KiCad.

Thông số chính

MCUESP32-WROOM-32
Sơ đồ nguyên lý6 sheet phân cấp · 211 symbol · 212 footprint · 136 net
PCB2 lớp, ~163 × 110 mm · 1.165 track · 456 via · 647 pad · 29 vùng phủ đồng
Cách lyISO7721 (isolator số 2 kênh) + MAX485 phía RS485; opto EL357 cho ngõ vào số tham chiếu lưới điện
IC khácDS3231M (RTC có pin dự phòng), AMS1117 (ổn áp LDO)
Giao tiếpRS485 (cách ly), ngõ vào số cách ly quang, điều khiển relay/TRIAC 220V, còi báo
File sản xuấtBOM, CPL (vị trí đặt linh kiện), Gerber + file khoan — xem OUTPUT_CLEARROOM_SLave/

Điểm nổi bật trong thiết kế

Một vài quyết định có tính toán đằng sau board này — không chỉ "dùng linh kiện gì" mà là tại sao, kèm số liệu chứng minh:

  • Tính lại fail-safe biasing cho RS485. Trở kéo bus gốc 4.7 kΩ cho điện áp vi sai quá thấp để đảm bảo trạng thái nghỉ xác định. Tính lại còn 470 Ω, đạt VAB = 300 mV so với ngưỡng thu 200 mV — tải driver 56.4 Ω (26.6 mA) được xác nhận vẫn trong khả năng của MAX485.
  • Sửa ngân sách CTR cho opto. Trở kéo gốc 1 kΩ đòi hỏi optocoupler EL357 đạt CTR 290% — bất khả thi về vật lý. Tính lại dòng hút với trở kéo 47 kΩ, hạ yêu cầu xuống còn 6.2% CTR khả thi.
  • Hiệu chỉnh thời gian reset chân EN của ESP32. Đặt hằng số RC = 10 ms (10 kΩ + 1 µF) đúng khuyến nghị chính thức của Espressif, khắc phục lỗi reset không ổn định khi cấp nguồn.
  • Tính lại bộ chia áp GPIO2 để VGPIO2 luôn dưới ngưỡng boot-strap 0.825 V trên toàn dải điện áp nguồn, thay vì chỉ đúng ở một mức điện áp danh định.
  • Đối chiếu pinout ISO7721 với datasheet và ghi lại rõ ràng — kênh A đi từ phía 2 sang phía 1, kênh B đi xuôi từ phía 1 sang phía 2, chi tiết dễ nhớ nhầm từng khiến một "sửa lỗi" trước đó áp dụng sai vào một mạch vốn đã đấu đúng.

Tình trạng dự án

Board này chưa được gửi sản xuất. Một đợt design review trước sản xuất tự thực hiện — dựa trên công cụ kiểm tra khoảng hở tự động chạy trực tiếp trên netlist và hình học lớp đồng của PCB — đã phát hiện hai nhóm vấn đề trước khi đặt board:

  • Khoảng hở điện lưới ↔ SELV chỉ 1.335 mm, so với yêu cầu an toàn ~6 mm (15 đối tượng dưới 3 mm).
  • Khoảng hở hàng rào cách ly RS485 chỉ 0.200 mm, so với mục tiêu ≥1 mm (11 đối tượng dưới 1 mm).
  • Nguyên nhân gốc: thiết lập min_clearance trong luật thiết kế của dự án KiCad bị đặt bằng 0, nên DRC mặc định không hề kiểm tra khoảng hở tối thiểu nào — một lượt chạy "DRC pass" bình thường đã tạo cảm giác an toàn giả.
  • Không có chập đồng giữa các net khác nhau (762/762 đầu dây được xác nhận rơi đúng net).

Một danh sách khắc phục theo toạ độ đã được lập để hướng dẫn sửa khoảng hở trước khi board này được gửi sản xuất. Toàn bộ quá trình review được ghi lại nguyên văn tiếng Việt trong 4 tài liệu:

Cấu trúc repo

Xem mục Repository structure ở phần tiếng Anh phía trên — cấu trúc thư mục giống nhau.

Bắt đầu

  1. Cài KiCad 7 trở lên (file dự án khai báo schema version 7).
  2. Mở Clean_room/Clean_room.kicad_pro.
  3. Thư viện footprint tự động phân giải qua đường dẫn tương đối theo dự án (${KIPRJMOD}/lib/ProjectFP.pretty) — không cần cấu hình thủ công.

Datasheet ISO7721 không đính kèm trong repo (tài liệu bản quyền bên thứ ba) — xem tại trang sản phẩm ISO7721 của TI.

Giấy phép

Chưa lựa chọn. Nếu bạn muốn tái sử dụng thiết kế này, vui lòng mở issue hoặc liên hệ tác giả trước — đang cân nhắc giấy phép phần cứng mở (ví dụ CERN-OHL) nhưng chưa áp dụng chính thức.

Tác giả

Triệu Huy Đức

Parts

213
QtyValueFootprintReferences
14100GIT_THAO_FP:R_0603R14, R20, R21, R22, R23, R30, R31, R32, R33, R38, R51, R52, R53, R54
11100nFGIT_THAO_FP:C_0603C2, C3, C10, C19, C22, C35, C36, C38, C39, C40, C41
1110kGIT_THAO_FP:R_0603R2, R3, R6, R11, R24, R25, R34, R35, R49, R50, R55
11SI2302GIT_THAO_FP:SOT23-3Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Q10, Q11
9LedGIT_THAO_FP:LED0603LE1, LE2, LE3, LE4, LE5, LE6, LE7, LE8, LE9
8470GIT_THAO_FP:R_0603R26, R27, R36, R37, R61, R62, R63, R64
61kGIT_THAO_FP:R_0603R10, R46, R69, R70, R73, R74
51N4148WSGIT_THAO_FP:D_SOD323D2, D3, D4, D5, D6
4100kGIT_THAO_FP:R_0603R67, R68, R71, R72
4100nfGIT_THAO_FP:C_0603C16, C17, C20, C33
410D561IoT_Footprint:RV_Disc_D12mm_W5.8mm_P7.5mmRV2, RV3, RV4, RV5
410uFGIT_THAO_FP:C_0603C1, C6, C8, C32
422ufGIT_THAO_FP:C_0603C24, C25, C26, C27
430kGIT_THAO_FP:R_0603R18, R19, R28, R29
4Conn_01x04GIT_THAO_FP:Terminal_HT-3.96mm-4P-Vertical-PluggableJ5, J7, J8, J9
4G5NBGIT_THAO_FP:Relay_G5NB-1A-E DC5RL1, RL2, RL3, RL4
4MountingHoleIVSFootprint:MountingHole_3.2mm_M3_Pad_ViaH2, H3, H4, H5
4si2301Package_TO_SOT_SMD:SOT-23-3Q13, Q14, Q15, Q16
310KGIT_THAO_FP:R_0603R15, R16, R39
34.7kGIT_THAO_FP:R_0603R7, R12, R13
347kGIT_THAO_FP:R_0603R48, R59, R60
3D_TVSGIT_THAO_FP:D_SMATVS1, TVS2, TVS5
3D_TVSIoT_Footprint:D_SMATVS3, TVS4, TVS6
2100nf/0805GIT_THAO_FP:C_0805C12, C15
210ufGIT_THAO_FP:C_0603C21, C30
2120GIT_THAO_FP:R_1206R65, R66
2180kGIT_THAO_FP:R_0805R41, R42
21ufGIT_THAO_FP:C_0603C18, C23
2330IoT_Footprint:R_0603R8, R9
2471/2kCapacitor_THT:C_Disc_D4.3mm_W1.9mm_P5.00mmC4, C5
2680GIT_THAO_FP:R_0603R57, R58
2EL357IoT_Footprint:OPTO_EL357N-GU10, U11
2FANGIT_THAO_FP:Terminal_HT-3.96mm-2P-Horizontal-PluggableJ3, J4
2ISO7721DRIoT_Footprint:SOIC-8_3.9x4.9mm_P1.27mmU8, U9
2LED_Housing_DualIoT_Footprint:LED_Housing_DualL2, L3
2MAX485EIoT_Footprint:SOIC-8_3.9x4.9mm_P1.27mmU12, U13
2PolyfuseIoT_Footprint:Fuse_1812_4532MetricF5, F6
2PolyfuseGIT_THAO_FP:Fuse_1812_4532MetricF3, F4
2SW_PushGIT_THAO_FP:SW_SPST_CK_RS282G05A3SW1, SW2
10.1uF/275VACIVSFootprint:C-Polyester-Rect-L16.5mm-W5.0mm-P15.00mm-MKTC7
10.1uF/275VACIoT_Footprint:C_Rect_L16.5mm_W5.0mm_P15.00mm_MKTC9
11.5kGIT_THAO_FP:R_0603R1
110D561ThaoFootprint:RV_Disc_D12mm_W5.8mm_P7.5mmRV1
110nF/275VGIT_THAO_FP:C_Disc_D12.5mm_W5.0mm_P10.00mmC31
110nfGIT_THAO_FP:C_0805C28
110uF/0805GIT_THAO_FP:C_0805C37
110uf/0805GIT_THAO_FP:C_0805C14
1180GIT_THAO_FP:R_0603R40
11N4148GIT_THAO_FP:D_SOD323D9
11uFIVSFootprint:C_0603C42
120mHIVSFootprint:ACFilterChoke-UU9.8FL1
1220GIT_THAO_FP:R_0603R5
1220ufGIT_THAO_FP:CP_Alu_SMD_8x10.5mmC11
122kGIT_THAO_FP:R_0603R45
12AIVSFootprint:Fuse_HolderGlass5x20mmF1
12kGIT_THAO_FP:R_0603R56
1330/1WGIT_THAO_FP:R_Axial_DIN0414_L11.9mm_D4.5mm_P5.08mm_VerticalR43
14.7KGIT_THAO_FP:R_0603R17
14.7uFGIT_THAO_FP:C_0805C34
1470/1WGIT_THAO_FP:R_Axial_DIN0414_L11.9mm_D4.5mm_P5.08mm_VerticalR44
1470uFGIT_THAO_FP:CP_Alu_SMD_10x10.5mmC13
147nF/275GIT_THAO_FP:C_Disc_D12.5mm_W5.0mm_P10.00mmC29
156/1WGIT_THAO_FP:R_Axial_DIN0414_L11.9mm_D4.5mm_P5.08mm_VerticalR47
16.8kGIT_THAO_FP:R_0603R4
168uHGIT_THAO_FP:L_Bourns_SRR1208_12.7x12.7mmL1
1AMS1117IoT_Footprint:SOT-223-3_TabPin2U2
1B0505S/B1205STAMFootprint:B0505s-2wr2U7
1BAT54CGIT_THAO_FP:SOT23-3D10
1BTA16-6000BTAMFootprint:TO-220-3_Vertical_heatsink_TRIAC_N_MOSFETD8
1Battery_CellIVSFootprint:BatteryHolder-SMD-CR1220BT1
1BuzzerGIT_THAO_FP:Buzzer_12x9.5RM7.6BZ1
1CHENH_APGIT_THAO_FP:Terminal_HT-3.96mm-4P-Horizontal-PluggableJ6
1Conn_01x07_PinIVSFootprint:PinHeader_1x07_P2.54mm_VerticalJ11
1Conn_01x10TAMFootprint:TerminalBlock_Screw_HB9500_10P_P9.5mmJ2
1EL357GIT_THAO_FP:OPTO_EL357N-GU6
1ESP32-WROOM-32GIT_THAO_FP:ESP32-WROOM-32EU4
1FuseIVSFootprint:Fuseholder-Littelfuse_Nano2_154xF2
1HLK-10M12Converter_ACDC:Converter_ACDC_Hi-Link_HLK-10MxxPS1
1LM317_SOT-223IoT_Footprint:SOT-223-3_TabPin2U3
1LOGOTAMFootprint:Logo_IotVision_20x6.6G***

The 203 most common of 213 parts.

Similar boards

  • 2 layers80 × 70 mmATM90E26 EVAL, the printed circuit board in 3D

    ATM90E26 EVAL

    vivmchp/atm90e26_ref

    atm90e26 reference board for kick start

    43 parts
  • 4 layers77.9 × 81.6 mmLilygo, the printed circuit board in 3D

    Lilygo

    Ndambia/lilygo

    A custom 4-layer KiCad PCB design integrating an ESP32 Wi-Fi/Bluetooth microcontroller with a SIM7600G-H 4G LTE Cat-4 cellular module, comprehensive power management, GPS tracking, GPRS connectivity, USB-C charging…

    188 parts
  • 2 layers98.5 × 59.8 mmNeuron, the printed circuit board in 3D

    Neuron

    giant-axon/lu.i-neuron-pcb

    Lu.i is an electronic neuron circuit mimicking and illustrating the basic dynamics of real, biological neurons. The printed circuit board (PCB) features a configurable, fully analog implementation of the leaky…

    90 parts73CERN-OHL-S-2.0
  • 2 layers50 × 75 mmLocalTrack, the printed circuit board in 3D

    LocalTrack

    krakrukra/LocalTrack

    OSHW GPS Tracker (Logger)

    63 parts18MIT
  • 2 layers63.2 × 23.8 mmWand, the printed circuit board in 3D

    Wand

    ayuusweetfish/Malletwand

    A pendulum as a hands-on musical interface for all · NIME 2024 Short Paper

    68 parts1CERN-OHL-S-2.0
  • 4 layers140 × 90 mmCore evb, the printed circuit board in 3D

    Core evb

    itead/ITEADHW_Core-EVB

    1.4

    219 parts
  • 2 layers40 × 80 mmSenseBeTx rev1, the printed circuit board in 3D

    SenseBeTx rev1

    Appiko/sense_snap_hw

    This repository contains all the KiCad based PCB design and related documentation for all the PCBs developed at Appiko.

    38 parts2
  • 2 layers37 × 106 mmBut1, the printed circuit board in 3D

    But1

    roman-khvatov/RoboWay

    Кружок робототехники RoboWay

    24 parts1MIT

Questions

How big is the Clean room PCB?

It measures 165 × 110 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Clean room use?

213 parts, built around the MAX485ED, ESP32-WROOM-32, HLK-10M12 and ISO7721DR-Y. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Clean room KiCad files?

From the trieuhuyduc/Clean_room_slave repository on GitHub, at the commit this page was made from: the board is Clean_room/Clean_room.kicad_pcb and its schematic Clean_room/220V_Control.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Clean room design in my own project?

Its repository states no licence, so its author keeps all rights: ask trieuhuyduc before reusing the design.