Skip to the content
2 layers100 × 80 mmSmart Home Controller, the printed circuit board in 3D

Full-stack IoT home automation system with ESP32 firmware, Google Apps Script backend, web dashboard, and Flutter mobile app.

Size
100 × 80 mm
Copper layers
2
Thickness
1.6 mm
Parts
11
Nets
36
Pads
84
Tracks, vias
60, 4
Pours
4
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
6 May 2026
Updated
6 May 2026

Overview

Smart Home Controller is an open-source printed circuit board by Ajith-Anand-R, from the Ajith-Anand-R/Smart-Home-Controller repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 80 mm with 11 parts on 36 nets, routed with 60 tracks and 4 vias.

It is built around the ESP32-WROOM-32, BT136-600E and MOC3021, with the AMS1117-5.0 among its other parts. Its parts include 7 ICs and 4 transistors. It belongs with the home automation and IoT boards and the ESP32 boards of this library.

Main components

4

README

README.md

"# Smart Home Controller

Version Platform License

Full-stack IoT home automation system with ESP32 firmware, Google Apps Script backend, web dashboard, and Flutter mobile app. Controls 4 AC load channels via TRIAC phase-angle dimming with cloud synchronization, scheduling, and Amazon Alexa voice control.

Project Status

Maturity: Portfolio project / advanced prototype Tested on: ESP32-WROOM-32 with custom TRIAC controller board Known limitations:

  • Google Assistant integration (SinricPro) is stubbed but not yet functional
  • No automated test suite for firmware or backend
  • Flutter app requires manual API URL configuration

What works:

  • 4-channel TRIAC phase-angle control with zero-cross detection
  • Amazon Alexa voice control (via Espalexa, local network)
  • Google Apps Script cloud backend with polling
  • Web dashboard with real-time device control
  • Flutter mobile app with device control, schedules, and scenes
  • OTA firmware updates with rollback protection
  • Scene and schedule automation
  • WebSocket real-time state sync
  • Persistent storage across reboots
  • GitHub Actions CI for automated APK builds

Not yet implemented:

  • Google Assistant control (SinricPro code is stubbed)
  • Automated tests

UI Preview

Smart Home Controller Dashboard

Web dashboard with real-time device control and system statistics

Quick Start

  1. Deploy backend — Copy backend/google-apps-script/ files to a Google Apps Script project and deploy as a web app. See Deployment Guide.
  2. Flash firmware — Open firmware/main/main.ino in Arduino IDE, set your Apps Script URL, and upload to ESP32. See Installation Guide.
  3. Build mobile app — Run flutter build apk --release in frontend/flutter project/demo/. Or download from Releases.

Documentation

System Architecture

Components

  • Multi-core architecture: Time-critical TRIAC control on Core 1, network operations on Core 0
  • Amazon Alexa: Voice control via Espalexa (local network discovery)
  • Cloud backend: Google Apps Script + Google Sheets for remote control and configuration
  • Web dashboard: HTML5 control panel served from Apps Script
  • Flutter mobile app: Cross-platform app with device control, schedules, and scenes
  • OTA updates: Over-the-air firmware updates with rollback protection
  • Scenes & schedules: Automation and preset device combinations
  • Safety features: Watchdog timers, zero-cross monitoring, auto-shutoff
  • Persistent storage: Configuration and state retention across reboots

Repository Structure

text
smarthome-controller/
├── firmware/                      # ESP32 firmware code
│   ├── main/                     # Main 4-channel controller firmware
│   └── mini_controller/          # Simplified single-channel variant
├── backend/                       # Cloud backend
│   └── google-apps-script/       # Google Apps Script API + web dashboard
├── frontend/                      # Mobile app
│   └── flutter project/demo/     # Flutter cross-platform app
├── hardware/                      # Hardware design files
│   ├── pcb/                      # KiCad PCB design
│   ├── schematics/               # Circuit diagrams
│   └── bom/                      # Bill of materials
├── app/                          # Android APK builds (via CI)
├── docs/                         # Additional documentation
├── DEPLOYMENT.md                 # Full system deployment guide
├── INSTALL.md                    # Firmware installation and setup
├── FEATURES.md                   # Feature list
├── OTA_GUIDE.md                  # OTA update procedures
└── CHANGELOG.md                  # Version history

Hardware Requirements

ESP32 Module

  • ESP32-WROOM-32 or compatible
  • Minimum 4MB flash
  • Dual-core operation

TRIAC Controller Hardware

  • 4x TRIAC channels (BT136 or similar)
  • Zero-cross detection circuit
  • MOC3021/3041 optocouplers
  • 5V power supply

Pin Configuration

FunctionGPIO PinNotes
Zero-Cross Detection13Rising edge interrupt
TRIAC 116Channel 1 control
TRIAC 217Channel 2 control
TRIAC 318Channel 3 control
TRIAC 419Channel 4 control
Switch 132Physical button input
Switch 233Physical button input
Switch 325Physical button input
Switch 426Physical button input

Software Architecture

Core Separation

text
CORE 1 (PRO_CPU) - TIME-CRITICAL:
├── Zero-cross detection ISR (RISING edge @ GPIO13)
├── Hardware timer ISR for phase-angle control (100µs intervals)
├── TRIAC firing with <50µs accuracy
└── NO blocking calls or network operations

CORE 0 (APP_CPU) - CONNECTIVITY:
├── WiFi management with auto-reconnect
├── Google Apps Script cloud polling (2.5s interval)
├── Alexa voice assistant handling
├── Physical switch debouncing
├── Web servers (port 80, 8080, WebSocket 81)
├── OTA update handling
├── Schedule execution
├── Scene activation
├── Fade transitions
└── Watchdog monitoring (15s timeout)

Data Flow

text
Physical Switch → Debounce → Device State Update → TRIAC Control
                                      ↓
                            Cloud Sync / WebSocket Broadcast

Voice Command → Alexa → Device State Update → TRIAC Control
                                      ↓
                            Cloud Sync / WebSocket Broadcast

Local REST API (Port 8080)

EndpointMethodDescription
/statusGETCurrent device states
/controlPOSTControl a device ({"id": 0, "state": true, "brightness": 75})
/infoGETSystem information (firmware, IP, uptime, RSSI, heap)
/configPOSTUpdate device configuration
/schedulesGET/POSTList or create schedules
/schedules/{id}DELETEDelete a schedule
/scenesGET/POSTList or create scenes
/scenes/{id}/activatePOSTActivate a scene
/scenes/{id}DELETEDelete a scene
/restartPOSTRestart device
/factory-resetPOSTFactory reset (requires {"confirm": true})

WebSocket on port 81 provides real-time device state updates.

License

MIT License — See LICENSE file for details.

Support

Parts

11
QtyValueFootprintReferences
4BT136-600EPackage_TO_SOT_THT:TO-220-3_VerticalQ1, Q2, Q3, Q4
4MOC3021Package_DIP:DIP-6_W7.62mmU2, U3, U4, U5
14N25Package_DIP:DIP-6_W7.62mmU6
1AMS1117-5.0Package_TO_SOT_SMD:SOT-223-3_TabPin2U7
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U1

Similar boards

  • 2 layers95 × 60 mmPulseFlow - PCB, the printed circuit board in 3D

    PulseFlow - PCB

    HuibSmeets/PulseFlow

    Control a fan speed by heart rate

    28 parts1GPL-3.0
  • 2 layers100 × 73.5 mmSmart Socket Final Version, the printed circuit board in 3D

    Smart Socket Final Version

    KevinAR-18/EcoLab-Dashboard

    EcoLab Dashboard is a smart laboratory EcoLab desktop application for real-time monitoring and control of laboratory devices within the UGM network.

    45 parts
  • 2 layers217 × 116 mmBoard nhiet, the printed circuit board in 3D

    Board nhiet

    NguyenThanhHuy-debug/PCB-Liquid-Dispensing-Cabinet

    PCB-Liquid-Dispensing-Cabinet — a software project built with modern tooling.

    191 parts4
  • 2 layers150 × 100 mmAc dimmer, the printed circuit board in 3D

    Ac dimmer

    arunsaispk12/esp32-ac-dimmer-fan-controller

    Professional ESP32-based AC phase-control dimmer for fan speed control with optical isolation and safety features

    3 parts
  • 4 layers230 × 196.7 mmSteel form Dish washer, the printed circuit board in 3D

    Steel form Dish washer

    R-Mutura/DISHWASHER

    Contains hardware and Software implementation of a dishwasher product

    156 parts
  • 2 layersBackEnd 4S v3, the printed circuit board in 3D

    BackEnd 4S v3

    sabiinsearch/IoT

    Projects related to Internet of Things (IoT)

    54 parts1
  • 2 layersTriac driver, the printed circuit board in 3D

    Triac driver

    erikbeerepoot/bramble

    Bramble: Precision Agriculture Mesh

    46 parts

Questions

How big is the Smart Home Controller PCB?

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

What parts does the Smart Home Controller use?

11 parts, built around the ESP32-WROOM-32, BT136-600E, MOC3021 and AMS1117-5.0. 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 Home Controller KiCad files?

From the Ajith-Anand-R/Smart-Home-Controller repository on GitHub, at the commit this page was made from: the board is hardware/pcb/SmartHomeController.kicad_pcb and its schematic hardware/pcb/SmartHomeController.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smart Home Controller design in my own project?

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