Skip to the content
PCBKitNew board
2 layers109.3 × 80 mmSmart fan, the printed circuit board in 3D

ESP32-S3 smart fan retrofit with custom KiCad hardware and ESPHome firmware. Wi-Fi + Home Assistant control, OTA updates, and UART protocol support for upgrading legacy fan controllers.

Size
109.3 × 80 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
53
Pads
160
Tracks, vias
179, 17
Pours
11
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
9 May 2026
Updated
9 May 2026

Overview

Smart fan is an open-source printed circuit board by ben-willis, from the ben-willis/smart-fan repository on GitHub. It is a 2-layer board of 109.3 × 80 mm with 40 parts on 53 nets, routed with 179 tracks and 17 vias.

It is built around the ESP32-S3-MINI-1U-N8 and AP7361C-33E. Its parts include 11 resistors, 10 diodes, 3 capacitors, 3 ICs and 2 connectors. It belongs with the home automation and IoT and radio and wireless boards and the ESP32 boards of this library.

Main components

2

README

README.md

Smart Fan Project

A WiFi-enabled smart fan controller built on ESP32-S3 with Home Assistant integration, using ESPHome for firmware management.

Overview

This project transforms a traditional fan into a smart, connected device with the following capabilities:

  • WiFi Connectivity: ESP32-S3 microcontroller for wireless control
  • Home Assistant Integration: Full API integration for home automation
  • Physical Controls: GPIO-based buttons for manual operation
  • IR Remote Support: NEC protocol infrared remote control
  • Advanced Features: 3-speed control, oscillation mode, preset modes (Sleep, Nature, Normal)
  • Custom PCB: Professionally designed KiCad PCB with production-ready Gerber files

Documentation

If you are new to this repository, start with Project Story, then use UART Protocol while reviewing firmware behavior.

Hardware

Microcontroller

  • Board: ESP32-S3-DevKitC-1
  • Framework: Arduino

Physical Controls

  • On/Off Button: GPIO11
  • Speed Control Button: GPIO10 (cycles through 3 speeds)
  • Oscillation Toggle Button: GPIO34
  • Mode Button: GPIO9 (reserved for future use)
  • Timer Button: GPIO8 (reserved for future use)

IR Remote

  • Protocol: NEC
  • Address: 0xFE01
  • Supported Commands:
    • On/Off: 0xFC03
    • Speed Cycle: 0xF807
    • Oscillation: 0xEC13

Visual Indicators

  • Low Speed LED: GPIO15
  • Medium Speed LED: GPIO18
  • High Speed LED: GPIO19
  • Normal Mode LED: GPIO14
  • Rhythm Mode LED: GPIO17
  • Sleep Mode LED: GPIO20

Communication

  • Fan UART: GPIO43 (TX), GPIO44 (RX) @ 334 baud
  • Remote Receiver: GPIO7 (inverted, NEC protocol via RMT channel 4)

Features

Fan Control

  • 3-Speed Operation: Low, Medium, High
  • Oscillation Mode: On/Off toggle
  • Preset Modes:
    • Sleep mode
    • Nature mode
    • Normal mode
  • State Preservation: Always powers off on restart

Connectivity

  • WiFi: Configurable SSID and password with fallback hotspot
  • API: Home Assistant encrypted API communication
  • OTA Updates: Over-the-air firmware updates via ESPHome

Debugging

  • Serial Logging: DEBUG level logging enabled
  • UART Debug: Bidirectional UART debugging for fan communication
  • State Tracking: Comprehensive logging of all state changes

Project Structure

text
smart-fan/
├── README.md                  # Project documentation
├── secrets.yaml               # WiFi and API credentials (not in git)
│
├── firmware/                  # ESPHome firmware configuration
│   └── smart-fan.yml          # Main ESPHome configuration
│
├── hardware/                  # KiCad PCB design files
│   ├── smart-fan.kicad_sch    # Schematic
│   ├── smart-fan.kicad_pcb    # PCB layout
│   ├── smart-fan.kicad_pro    # Project file
│   ├── Gerber/                # Manufacturing files
│   │   ├── smart-fan-F_Cu.gbr
│   │   ├── smart-fan-B_Cu.gbr
│   │   ├── smart-fan-*.gbr    # Additional layers
│   │   ├── smart-fan-PTH.drl
│   │   └── smart-fan-NPTH.drl
│   └── production/            # Production data
│       ├── bom.csv            # Bill of materials
│       ├── designators.csv
│       ├── positions.csv      # Pick & place
│       └── netlist.ipc
│
├── docs/                      # Project docs, protocol notes, and hardware references
│
└── venv/                      # Python virtual environment

Setup & Installation

Prerequisites

  • Python 3.8+
  • ESPHome CLI or Web UI
  • ESP32-S3-DevKitC-1 board
  • USB-C cable for programming

Configuration

  1. Create secrets.yaml with the following variables:

    yaml
    api_encryption_key: "your_api_key_here"
    ota_password: "your_ota_password"
    wifi_ssid: "your_wifi_ssid"
    wifi_password: "your_wifi_password"
    ap_password: "fallback_hotspot_password"
  2. Create a virtual environment and install dependencies:

    bash
    python -m venv venv
    source venv/Scripts/activate
    python -m pip install -r requirements.txt
  3. Build and Upload Firmware:

    bash
    esphome run firmware/smart-fan.yml
  4. First Flash:

    • Connect ESP32-S3 via USB-C
    • Select the COM port
    • Let ESPHome handle the flashing process

WiFi & API Setup

  • Normal Operation: Connects to specified WiFi SSID
  • Fallback Mode: If WiFi connection fails, opens "Smart Fan Fallback Hotspot"
  • API Encryption: Uses Home Assistant encrypted API for secure communication
  • OTA Updates: After initial flash, updates can be done wirelessly

Home Assistant Integration

Once configured, the Smart Fan will appear in Home Assistant with:

  • Fan entity: Full control (on/off, speed, oscillation)
  • Preset modes: Select Sleep, Nature, or Normal modes
  • Binary sensors: Button press detection
  • Switches: Individual control for lights and modes

Add to Home Assistant configuration.yaml:

yaml
esphome:
  - firmware/smart-fan.yml

Development

Building PCB

  • KiCad 8.0+ compatible
  • Design files in hardware/
  • Gerber files ready for ordering from fabricators
  • Production data includes BOM, designators, and pick & place positions

Serial Communication

The fan communicates via UART at 334 baud. Commands are 5-byte packets with checksums:

  • Format: [0x5a, SPEED_BITS, MODE_BITS, OSCILLATION_BITS, CHECKSUM]
  • See docs/uart-protocol.md for protocol details

OTA Updates

After initial programming, update firmware wirelessly:

bash
esphome run firmware/smart-fan.yml

Debugging

View Logs

bash
esphome logs firmware/smart-fan.yml

Monitor UART Communication

UART debugging is enabled with bidirectional logging. Connect to the serial monitor to see raw commands sent to the fan:

bash
esphome logs firmware/smart-fan.yml

Future Enhancements

  • Mode button functionality for additional control modes
  • Timer button integration for scheduled operation
  • Display integration for status information
  • Additional preset modes and customization
  • Mobile app control via Home Assistant

License

[Specify your license here]

References

Parts

40
QtyValueFootprintReferences
10100Resistor_SMD:R_1206_3216MetricR3, R4, R5, R6, R7, R8, R9, R10, R11, R12
21uFCapacitor_SMD:C_1206_3216MetricC2, C4
10.5HLED_THT:LED_D3.0mmLED1
110kResistor_SMD:R_1206_3216MetricR1
11HLED_THT:LED_D3.0mmLED2
12HLED_THT:LED_D3.0mmLED3
13.3VTestPoint:TestPoint_Pad_D2.0mmTP1
14.7uFCapacitor_SMD:C_1206_3216MetricC3
14HLED_THT:LED_D3.0mmLED4
15VTestPoint:TestPoint_Pad_D2.0mmTP2
1AP7361C-33EPackage_TO_SOT_SMD:SOT-223-3_TabPin2U2
1Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_HorizontalJ3
1Conn_01x04_PinConnector_JST:JST_XH_S4B-XH-A_1x04_P2.50mm_HorizontalJ1
1ESP32-S3-Mini-1UPCM_Espressif:ESP32-S2-MINI-1UU1
1GNDTestPoint:TestPoint_Pad_D2.0mmTP3
1HLED_THT:LED_D3.0mmLED10
1LLED_THT:LED_D3.0mmLED8
1MLED_THT:LED_D3.0mmLED9
1MODEButton_Switch_THT:SW_PUSH_6mm_H9.5mmKEY4
1NORLED_THT:LED_D3.0mmLED5
1ON/OFFButton_Switch_THT:SW_PUSH_6mm_H9.5mmKEY6
1RHYLED_THT:LED_D3.0mmLED6
1SLPLED_THT:LED_D3.0mmLED7
1SPEEDButton_Switch_THT:SW_PUSH_6mm_H9.5mmKEY5
1SWButton_Switch_THT:SW_PUSH_6mm_H9.5mmKEY3
1TIMERButton_Switch_THT:SW_PUSH_6mm_H9.5mmKEY2
1TSOP382xxOptoDevice:Vishay_MINICAST-3PinU3

The 37 most common of 40 parts.

Questions

How big is the Smart fan PCB?

It measures 109.3 × 80 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Smart fan use?

40 parts, built around the ESP32-S3-MINI-1U-N8 and AP7361C-33E. 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 Smart fan KiCad files?

From the ben-willis/smart-fan repository on GitHub, at the commit this page was made from: the board is hardware/smart-fan.kicad_pcb and its schematic hardware/smart-fan.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smart fan design in my own project?

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

Similar boards

  • 4 layers36 × 36 mmRTK GPS V2, the printed circuit board in 3D

    RTK GPS V2

    Besix2/Flight-Controller-companion-board

    A finished prototype companion board.

    41 partsGPL-3.0
  • 2 layers140.6 × 25.9 mmESP32 SmartGlass, the printed circuit board in 3D

    ESP32 SmartGlass

    jobitjoseph/ESP32-AI-SmartGlass

    The ESP32 AI Smartglass is an innovative wearable device that blends the power of artificial intelligence with the convenience of home automation.

    47 parts16
  • 4 layers154.5 × 112.9 mmLibrePLC32, the printed circuit board in 3D

    LibrePLC32

    AndreiVladescu/LibrePLC32

    The goal of the project is to create a compact, hackable, and well-documented PLC platform for industrial automation experiments, prototyping, education, and open hardware development.

    295 parts14CERN-OHL-P-2.0
  • 6 layers100 × 60 mmAether, the printed circuit board in 3D

    Aether

    nasheed-x/aether

    Aether is a versatile flight computer for testing flight hardware and software, focusing on sensor fusion to monitor rocket states and interface with on-board systems.

    180 parts10
  • 2 layers50.2 × 95.2 mmCheetoPet, the printed circuit board in 3D

    CheetoPet

    Cheet0sDelet0s/cheetoPet

    an esp32 s3 based tamagotchi

    104 parts3GPL-2.0
  • 2 layers30.1 × 59.9 mmADACHI, the printed circuit board in 3D

    ADACHI

    AREIVAN/ADACHI-BOARD

    minisumo esp32

    64 parts2
  • 6 layers90 × 90 mmCansat, the printed circuit board in 3D

    Cansat

    DevKiDCosmo/SATELLITE-EDGE-MODULE

    A satellite edge module ready for competition

    220 parts2GPL-3.0
  • 4 layers79.9 × 80 mmVidyut, the printed circuit board in 3D

    Vidyut

    D-Coder-42/Vajra-Team-Indra

    All codes and files for Team B of thrustMIT subscale

    94 parts1MIT