

On off module x1
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
6ESP-12E
SMD,24x16mm-20℃~+70℃ -90dBm 16dBm 170mA 2.4GHz 3V~3.6V 56mA 802.11b/g/n ESP8266 Chip On-board PCB Antenna Over-the-air (OTA) update UART、SPI、I2C SMD,24x16mm WiFi Modules ROHSAi-ThinkerWiFi ModulesHLK-PM12
插件,34.8x20.5mm0.1W 120V~350V 120mVp-p 12V 15mm 20mm 34mm 350mA 3W 3kV 73% 85VAC~265VAC AC/DC-DC Short Circuit Protection、Over Current Protection ±0.2% 插件,34.8x20.5mm AC-DC Power Modules ROHSHI-LINKAC-DC Power ModulesAMS1117-3.3
SOT-223-40℃~+125℃ 0.003%Vout 1 1.1V@(800mA) 15V 1A 3.3V 5mA 72dB@(120Hz) Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) RegulatorsH11AA1
DIP-6-55℃~+100℃ 1.2V 20% 30V 400mV@10mA,0.5mA 5.3kV 60mA AC,DC Integrated anti-parallel LED Phototransistor DIP-6 Transistor, Photovoltaic Output Optoisolators ROHSVishay IntertechnologyTransistor, Photovoltaic Output Optoisolators2N7002H
SOT-23-55℃~+150℃ 1 N-channel 2.1pF 2.8pF 210mA 26pF 352pC@4.5V 3V 3Ω@5V 510mW 60V N-Channel SOT-23 MOSFETs ROHSDiodes IncorporatedMOSFETsS1A
SMA(DO-214AC)1 Independent 1.1V@1A 1A 30A 50V 5uA@50V SMA(DO-214AC) Diodes - General Purpose ROHSDiodes IncorporatedDiodes - General Purpose
README
README.mdHome 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

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
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.mdTechnology 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:
sudo apt update
sudo apt upgrade -y- Install and configure GIT:
sudo apt install git -y- Clone the repository:
git clone https://github.com/AlanCarvalhoEE/hap.git- Enter project folder:
cd hap- Edit your credentials:
cp server/scripts/credentials_example.py server/scripts/credentials.py
nano server/scripts/credentials.py- Run setup.sh:
cd setup
chmod +x setup.sh
./setup.sh-
The script will install all the needed packages, dependencies and services.
-
Configure Mosquitto:
sudo nano /etc/mosquitto/mosquitto.conf- Include to the end of the file:
listener 1883
allow_anonymous true- Restart Mosquitto:
sudo systemctl restart mosquitto- Connect to your ZeroTier network (must be previously created on web browser):
sudo zerotier-cli join <network_id>-
After joining, the device must be allowed on the ZeroTier network dashboard.
-
Reboot the Raspberry Pi:
sudo reboot nowCurrent 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| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | 10k | Alan_Resistor:RES_SMD_0603 | R1, R2, R3, R6, R12 |
| 2 | 10uF | Alan_Capacitor:CAP_SMD_TANTALUM_CASE-A | C3, C4 |
| 2 | 33k | Alan_Resistor:RES_SMD_1206 | R10, R11 |
| 2 | LOGO | LOGO | G***, G*** |
| 1 | 0,25A | Alan_Fuse:FUSEHOLDER_THT_5x20_CLIP | F1 |
| 1 | 0.1uF | Alan_Capacitor:CAP_SMD_CERAMIC_0603 | C5 |
| 1 | 0.1uF | Alan_Capacitor:CAP_THT_CERAMIC_X2_18x6x15 | C1 |
| 1 | 100nF | Alan_Capacitor:CAP_SMD_CERAMIC_0603 | C7 |
| 1 | 100uF | Alan_Capacitor:CAP_SMD_ELEC_6.3x7.7 | C2 |
| 1 | 10k | Alan_Sensor:LDR_5_V | R8 |
| 1 | 12V 5A | Alan_Relay:RELAY_SPDT_FINDER_36.11 | K1 |
| 1 | 2N7002H | Alan_Transistor:SOT-23 | Q1 |
| 1 | 2k2 | Alan_Resistor:RES_SMD_0603 | R4 |
| 1 | 33k | Alan_Resistor:RES_SMD_0603 | R7 |
| 1 | 390R | Alan_Resistor:RES_SMD_0603 | R5 |
| 1 | 470k | Alan_Resistor:RES_SMD_1206 | R9 |
| 1 | 47nF | Alan_Capacitor:CAP_THT_CERAMIC_X2_13x5x11_P10 | C6 |
| 1 | 600R | Alan_Inductor:BEAD_SMD_1206 | L1 |
| 1 | AMS1117-3.3 | Alan_IC:SOT-223-3_TAB2 | U1 |
| 1 | CONN_TERMINAL-BLOCK_5P_P5.08 | Alan_Connector:CONN_TERMINAL-BLOCK_5P_P5.08 | J1 |
| 1 | Conn_01x03_Socket | Alan_Connector:CONN_PIN-HEADER_1x03_V | J3 |
| 1 | Conn_01x06_Socket | Alan_Connector:CONN_SOCKET-HEADER_1x06_V | J2 |
| 1 | ESP-12E | Alan_Module:MOD_ESP-12E | U2 |
| 1 | H11AA1 | Alan_IC:SMDIP-6_7.62 | U4 |
| 1 | HLK-PM12 | Alan_Module:HILINK_HLK-PMxx | PS1 |
| 1 | LED | Alan_LED:LED_SMD_0603 | D1 |
| 1 | LOGO | Alan_Label:LABEL_ELECTRIC_SHOCK_RISK_10x10 | G*** |
| 1 | PC817 | Alan_IC:SMDIP-4_7.62 | U3 |
| 1 | S1A | Alan_Diode:DIODE_SMD_SMA | D2 |
The 36 most common of 40 parts.
Similar boards
- 2 layers87 × 68 mm

- 2 layers100 × 100 mm

- 4 layers63.5 × 20.3 mm

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 mm

- 2 layers100 × 100 mm

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 mm

- 2 layers100 × 100 mm

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 mm

BsidesPR
So11Deo6loria/bsidesPRSun
Please note that if the badge is running consistently, the battery life will be limited.
81 parts5
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.