Skip to the content
PCBKitNew board
2 layers148 × 105 mmShutters, the printed circuit board in 3D

All safety-relevant design aspects (galvanic separation, flyback protection, low coil current) are explicitly addressed in the extern hardware design, which is not part of the schematics attached.

Size
148 × 105 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
184
Pads
374
Tracks, vias
881, 1
Pours
1
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
15 Oct 2023
Updated
3 Feb 2026

Overview

Shutters is an open-source printed circuit board by mhammer3, from the mhammer3/shutters repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 148 × 105 mm with 40 parts on 184 nets, routed with 881 tracks and 1 via.

It is built around the ESP32-DEVKITC-VE and ULN2003A. Its parts include 14 connectors, 10 ICs, 4 capacitors and 4 resistors. It belongs with the ESP32 boards of this library.

Main components

2

README

README.md

ESP32 Shutter Control System

This project implements a ESP32-based shutter control system designed for controlling shutter motors via relays, with clear separation between hardware abstraction and business logic. The system combines ESP32, Microchip MCP23017 I/O expanders, and ULN2003A Darlington arrays, and is implemented in C++ using PlatformIO with the Arduino framework.


System Overview

The shutter system consists of:

  • An ESP32 as the central controller
  • MCP23017 I/O expanders for scalable digital input and output via I²C
  • ULN2003A Darlington transistor arrays for driving relay coils
  • A dedicated external 5 V power supply for stable I/O operation

All safety-relevant design aspects (galvanic separation, flyback protection, low coil current) are explicitly addressed in the extern hardware design, which is not part of the schematics attached.


Hardware Architecture

Inputs (Buttons / Wall Switches)

  • Digital inputs are handled by an MCP23017 configured as input expander

  • Button press and release events are captured

  • Each input event triggers a hardware interrupt

  • The interrupt line is connected to the ESP32

  • Upon interrupt, the ESP32:

    1. Starts an I²C transaction
    2. Reads the MCP23017 input registers
    3. Determines the exact event (press or release)

This approach ensures:

  • Low latency
  • Minimal polling
  • Efficient I²C bus usage

Outputs (Shutter Actuation)

  • Outputs are handled by a second MCP23017 configured as output expander
  • Output states are sent from the ESP32 via I²C
  • MCP23017 outputs drive ULN2003A Darlington arrays
  • The Darlington arrays drive the relay coils
Relay Driving
  • Relay coil current is low enough to be safely driven by ULN2003A
  • Flyback diodes are mounted directly at the relay coils
  • This protects the Darlington arrays and improves EMC robustness

⚠️ Note: Mains voltage must only be handled by qualified personnel.


Power Supply

  • All MCP23017 inputs and outputs are powered by a stable external 5 V supply

  • This ensures:

    • Reliable logic levels
    • Noise immunity
    • Stable operation independent of ESP32 load conditions

Software Architecture

The firmware is written in C++ and built using:

  • PlatformIO
  • Arduino framework
  • ESP32 target

The software is cleanly structured into three main layers using dedicated FreeRTOS tasks. The communication between these tasks are done via message queues:

1. Sensors

  • Abstraction of all input devices
  • MCP23017 input handling
  • Interrupt processing
  • Debouncing and event detection (press / release)

2. Actuators

  • Abstraction of all output devices
  • MCP23017 output handling
  • Relay control logic
  • Hardware-independent actuator interface

3. Shutter Business Logic

  • High-level shutter control logic
  • Direction handling (up / down)
  • Timing and safety constraints
  • Mutual exclusion of motor directions
State Machine

The business logic is implemented using a state machine based on:

👉 Quantum Leaps – State-Oriented Programming https://github.com/QuantumLeaps/State-Oriented-Programming

This provides:

  • Explicit, deterministic state handling
  • Clear separation of states and events
  • Improved maintainability and testability
  • Robust behavior for asynchronous events (buttons, interrupts)

Documentation & Schematics

  • Hardware schematics are included in the repository

Key Features

  • ESP32-based central control
  • Interrupt-driven input handling
  • Scalable I/O via MCP23017
  • Safe relay driving using ULN2003A
  • Clear separation of concerns in software
  • State-machine-driven business logic

⚠️ WARNING

This project uses electromechanical actuators. Improper handling can result in serious injury, fire, or death.

This project is provided for educational and experimental purposes only. The author assumes no liability for any damage, injury, or loss resulting from the use, misuse, or modification of this hardware or software.

Only qualified personnel should work with mains voltage systems.


This project is not certified for commercial or residential use. No compliance with CE, VDE, UL, or any other safety standard is claimed.

Use at your own risk!

Parts

40
QtyValueFootprintReferences
8Screw_Terminal_01x08TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-8-5.08_1x08_P5.08mm_HorizontalJ2, J3, J5, J6, J7, J8, J10, J11
5ULN2003APackage_DIP:DIP-16_W7.62mm_SocketU3, U4, U39, U41, U42
4100nCapacitor_THT:C_Rect_L7.0mm_W2.5mm_P5.00mmC1, C2, C3, C4
410KResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P5.08mm_HorizontalR1, R2, R3, R4
44.3mm_Mounting_HoleMountingHole:MountingHole_4.3mm_M4H1, H2, H3, H4
4Jumper_2_OpenConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJP1, JP2, JP3, JP4
4MCP23017_SPPackage_DIP:DIP-28_W7.62mmU2, U18, U36, U37
4Pin Header_01x10Connector_PinHeader_2.54mm:PinHeader_1x10_P2.54mm_VerticalJ13, J14, J15, J16
1Conn_02x05_Top_BottomConnector_PinHeader_2.54mm:PinHeader_2x05_P2.54mm_VerticalJ1
1ESP32-DEVKITCfootprints:MODULE_ESP32-DEVKITCU1
1Screw_Terminal_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_HorizontalJ4

Questions

How big is the Shutters PCB?

It measures 148 × 105 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Shutters use?

40 parts, built around the ESP32-DEVKITC-VE and ULN2003A. 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 Shutters KiCad files?

From the mhammer3/shutters repository on GitHub, at the commit this page was made from: the board is doc/shuttersKicad/shutters.kicad_pcb and its schematic doc/shuttersKicad/shutters.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Shutters design in my own project?

Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers85.5 × 71.5 mmScoreboard, the printed circuit board in 3D

    Scoreboard

    fickel0/scoreboard

    26 partsAGPL-3.0
  • 2 layers48.3 × 119.4 mmGarage, the printed circuit board in 3D

    Garage

    la-sve/home-automation

    A home automation project describing software and hardware design.

    17 parts
  • 2 layers107 × 54 mmInterface board 1, the printed circuit board in 3D

    Interface board 1

    Green-bms/SmartBMS

    Open source Smart Battery Management System

    63 parts756
  • 4 layers93.3 × 60.3 mmArduino 386EX V5, the printed circuit board in 3D

    Arduino 386EX V5

    dbalsom/arduinoX86

    An interface between an Arduino Due or Arduino GIGA and 8088, 8086, V20, V30, 186 or 286 CPUs

    56 parts114
  • 2 layers52 × 61 mmArduino motorfocus, the printed circuit board in 3D

    Arduino motorfocus

    fehlfarbe/arduino-motorfocus

    Arduino motorfocus with moonlite protocol for telescopes

    23 parts58MIT
  • 4 layers199.9 × 69.3 mmZaphod controller, the printed circuit board in 3D

    Zaphod controller

    Scottapotamas/zaphod-bot

    A DIY high performance delta-bot for fun, and lightpainting...

    251 parts53
  • 4 layers285.1 × 48.1 mmAyab esp32, the printed circuit board in 3D

    Ayab esp32

    AllYarnsAreBeautiful/ayab-hardware

    Contains the schematics and layouts for the AYAB Arduino shield

    246 parts50CC-BY-SA-4.0