Skip to the content
PCBKitNew board
2 layers46 × 77 mmOn off module x1, the printed circuit board in 3D

On off module x1

AlanCarvalhoEE/hap1

Home Automation Platform with custom hardware and firmware (ESP8266), a Raspberry Pi–based server, and an Android client. Features modular IoT devices, TCP/IP and MQTT messaging, and a scalable system architecture.

Size
46 × 77 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
43
Pads
114
Tracks, vias
199, 124
Pours
3
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
19 Sep 2023
Updated
27 May 2026

Overview

On off module x1 is an open-source printed circuit board by AlanCarvalhoEE, from the AlanCarvalhoEE/hap repository on GitHub. It is a 2-layer board of 46 × 77 mm with 40 parts on 43 nets, routed with 199 tracks and 124 vias.

It is built around the ESP-12E, HLK-PM12 and AMS1117-3.3, with the H11AA1, 2N7002H and S1A among its other parts. Its parts include 12 resistors, 7 capacitors, 4 ICs, 3 connectors and 2 diodes. It belongs with the home automation and IoT boards and the ESP8266 boards of this library.

Main components

6

README

README.md

Home Automation Platform (HAP)

A modular, self-hosted home automation platform focused on reliability, local control, and secure remote access.

The system is designed around a Raspberry Pi server that centralizes application logic and device state, ESP8266-based IoT modules for field control, and a mobile application as the primary user interface. Communication between components is event-driven and optimized for embedded and low-latency environments.


System Architecture

System Architecture

The platform follows a layered architecture:

  • User Interface Layer: Mobile and web-based interfaces for monitoring and control.
  • Application Layer: Centralized logic running on a Raspberry Pi server.
  • Device Layer: Custom ESP8266-based hardware modules controlling actuators and sensors.

Remote access is secured using a VPN, allowing the system to remain fully functional without relying on external cloud services.


Components Overview

Mobile App / Web Interface

  • Provides real-time monitoring and control of devices
  • Sends user commands to the server
  • Displays device states and sensor data

Server (Raspberry Pi)

  • Central application logic
  • Device state management
  • Local database storage
  • MQTT-based device communication
  • REST API for configuration and user interfaces

IoT Devices (ESP8266)

  • Custom-designed hardware modules
  • Event-driven communication using MQTT
  • Designed as lightweight, replaceable nodes
  • Examples:
    • On/Off relay modules
    • Sensor modules
    • Air conditioner control modules

Repository Structure

text
hap/
├── docs/       # Documentation, diagrams, images
├── firmware/   # ESP8266 firmware for IoT modules
├── hardware/   # PCB designs, schematics, manufacturing files
├── mobile/     # Android application
├── server/     # Core server logic and services
└── README.md

Technology Stack

Embedded & Hardware

  • ESP8266
  • C / Arduino framework
  • Custom PCB design

Server

  • Raspberry Pi
  • Python
  • MQTT
  • SQLite
  • TCP/IP networking

Mobile

  • Android (Java)
  • Local and remote control support

Communication & Security

  • MQTT for device communication
  • REST API for configuration and UI interaction
  • VPN-based secure remote access
  • Local-first architecture (no cloud dependency)

Communication Model

  • Devices publish state changes and sensor data via MQTT
  • The server processes events and applies application logic
  • Commands are sent back to devices via MQTT topics
  • The mobile app interacts with the server through secure API calls

System Setup Steps

  • Install a lightweight Raspberry Pi OS:

    • Raspberry Pi OS Lite (recommended)
    • Enable SSH during installation
    • Configure a static local IP address
  • Update the system:

text
sudo apt update
sudo apt upgrade -y
  • Install and configure GIT:
text
sudo apt install git -y
  • Clone the repository:
text
git clone https://github.com/AlanCarvalhoEE/hap.git
  • Enter project folder:
text
cd hap
  • Edit your credentials:
text
cp server/scripts/credentials_example.py server/scripts/credentials.py
nano server/scripts/credentials.py
  • Run setup.sh:
text
cd setup
chmod +x setup.sh
./setup.sh
  • The script will install all the needed packages, dependencies and services.

  • Configure Mosquitto:

text
sudo nano /etc/mosquitto/mosquitto.conf
  • Include to the end of the file:
text
listener 1883
allow_anonymous true
  • Restart Mosquitto:
text
sudo systemctl restart mosquitto
  • Connect to your ZeroTier network (must be previously created on web browser):
text
sudo zerotier-cli join <network_id>
  • After joining, the device must be allowed on the ZeroTier network dashboard.

  • Reboot the Raspberry Pi:

text
sudo reboot now

Current Status

  • Core server architecture implemented
  • Custom IoT ON-OFF module developed and tested
  • Core Android application implemented
  • Secure remote access functional

Roadmap

Planned improvements:

  • New custom IoT modules development
  • Formal MQTT topic and message schema documentation
  • Device auto-discovery and provisioning
  • Improved fault tolerance and reconnection logic
  • Automated testing for server-side logic
  • Expanded mobile app features and UI refinement

License

This project is currently intended for personal and educational use. Licensing details may be defined in the future.

Parts

40
QtyValueFootprintReferences
510kAlan_Resistor:RES_SMD_0603R1, R2, R3, R6, R12
210uFAlan_Capacitor:CAP_SMD_TANTALUM_CASE-AC3, C4
233kAlan_Resistor:RES_SMD_1206R10, R11
2LOGOLOGOG***, G***
10,25AAlan_Fuse:FUSEHOLDER_THT_5x20_CLIPF1
10.1uFAlan_Capacitor:CAP_SMD_CERAMIC_0603C5
10.1uFAlan_Capacitor:CAP_THT_CERAMIC_X2_18x6x15C1
1100nFAlan_Capacitor:CAP_SMD_CERAMIC_0603C7
1100uFAlan_Capacitor:CAP_SMD_ELEC_6.3x7.7C2
110kAlan_Sensor:LDR_5_VR8
112V 5AAlan_Relay:RELAY_SPDT_FINDER_36.11K1
12N7002HAlan_Transistor:SOT-23Q1
12k2Alan_Resistor:RES_SMD_0603R4
133kAlan_Resistor:RES_SMD_0603R7
1390RAlan_Resistor:RES_SMD_0603R5
1470kAlan_Resistor:RES_SMD_1206R9
147nFAlan_Capacitor:CAP_THT_CERAMIC_X2_13x5x11_P10C6
1600RAlan_Inductor:BEAD_SMD_1206L1
1AMS1117-3.3Alan_IC:SOT-223-3_TAB2U1
1CONN_TERMINAL-BLOCK_5P_P5.08Alan_Connector:CONN_TERMINAL-BLOCK_5P_P5.08J1
1Conn_01x03_SocketAlan_Connector:CONN_PIN-HEADER_1x03_VJ3
1Conn_01x06_SocketAlan_Connector:CONN_SOCKET-HEADER_1x06_VJ2
1ESP-12EAlan_Module:MOD_ESP-12EU2
1H11AA1Alan_IC:SMDIP-6_7.62U4
1HLK-PM12Alan_Module:HILINK_HLK-PMxxPS1
1LEDAlan_LED:LED_SMD_0603D1
1LOGOAlan_Label:LABEL_ELECTRIC_SHOCK_RISK_10x10G***
1PC817Alan_IC:SMDIP-4_7.62U3
1S1AAlan_Diode:DIODE_SMD_SMAD2

The 36 most common of 40 parts.

Questions

How big is the On off module x1 PCB?

It measures 46 × 77 mm and has 2 copper layers, 1.6 mm thick.

What parts does the On off module x1 use?

40 parts, built around the ESP-12E, HLK-PM12, AMS1117-3.3 and H11AA1. 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 On off module x1 KiCad files?

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

Can I use the On off module x1 design in my own project?

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

Similar boards

  • 2 layers87 × 68 mmPrototype-2, the printed circuit board in 3D

    Prototype-2

    mylife-home/mylife-home-devices

    MyLife Home devices

    32 partsGPL-3.0
  • 2 layers100 × 100 mmEncoder, the printed circuit board in 3D

    Encoder

    dexterlb/led_controller

    A simple device for controlling LEDs

    177 parts
  • 4 layers63.5 × 20.3 mmEsp32 wroom, the printed circuit board in 3D

    Esp32 wroom

    Arhamee/hardware-portfolio

    Multi-layer PCB designs in KiCad 10 schematic capture to fabrication-ready Gerbers. High-speed routing, BGA escape, power electronics.

    47 partsMIT
  • 2 layers99 × 48.4 mmPCB DBFS 1, the printed circuit board in 3D

    PCB DBFS 1

    Arjunprabhakaran/PCB

    30 parts
  • 2 layers100 × 100 mmPower supply, the printed circuit board in 3D

    Power supply

    gabrielfbdiniz/PFC-Boost-STM32

    Conversor estático de potência CA/CC com Correção Ativa do Fator de Potência (Active PFC) na topologia Boost, projetado para elevar a tensão da rede elétrica retificada (127V / 220V AC) para um barramento CC…

    89 parts
  • 4 layers89 × 41.5 mmLampa, the printed circuit board in 3D

    Lampa

    VersBinarii/radiant

    (WIP) Touch screen controlled dimmer

    55 parts
  • 2 layers100 × 100 mmOutdoor carrier, the printed circuit board in 3D

    Outdoor carrier

    mrknockknockgaming-droid/hvac-monitor

    Fullscope monitors a home's heat pump or air conditioner continuously, the way a technician would with gauges on it, and tells the contractor and the homeowner when something is going wrong, before it becomes a no-cool…

    70 parts
  • 2 layers135.8 × 119.9 mmBsidesPR, the printed circuit board in 3D

    BsidesPR

    So11Deo6loria/bsidesPRSun

    Please note that if the badge is running consistently, the battery life will be limited.

    81 parts5