Skip to the content
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.

Size
100 × 73.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
45
Nets
34
Pads
131
Tracks, vias
185, 212
Pours
8
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
22 Dec 2025
Updated
31 Aug 2026

Overview

Smart Socket Final Version is an open-source printed circuit board by KevinAR-18, from the KevinAR-18/EcoLab-Dashboard repository on GitHub. It is a 2-layer board of 100 × 73.5 mm with 45 parts on 34 nets, routed with 185 tracks and 212 vias.

It is built around the ESP32-C3, BT136-600E and HLK-PM01, with the DS1302+, MOC3021 and SS8050 among its other parts. Its parts include 11 resistors, 2 switches and 1 diode. It belongs with the ESP32 and RISC-V boards of this library.

Main components

6

README

README.md

EcoLab Dashboard - Smart Laboratory Management System

EcoLab Dashboard - DTEDI Electronics Laboratory Internship 2025 x Final Project
Author: Stephanus Kevin Andika Rata
Internship Hardware (Smart AC & Lamp): Ilham Purnomo


Project Overview

EcoLab Dashboard is a Smart Laboratory Management System desktop application built with PySide6 (Qt) and Firebase Authentication to monitor and control laboratory devices in real time.

The system currently supports:

  • EcoLab Power Monitoring (Growatt)
  • Smart Socket
  • Smart Lamp
  • Smart AC Control
  • Weather Station Monitoring
  • Laboratory sensor and device status monitoring

Main Features

  • Firebase Authentication: email/password, Google Sign-In, and Guest Mode
  • Role-based Access Control: guest, user, and admin
  • Session Management: remember-me support
  • Admin Panel: laboratory user account management
  • Smart Socket Control: relay, timer, schedule, and energy monitoring
  • Smart Socket Safety Protection: load warning, overload popup, and automatic cutoff
  • Smart Socket Power-Off Protection: admin-configured blocked/password mode with Firebase sync
  • Smart Socket Recording: store monitoring data in application memory
  • Smart Socket Export: export per-socket data to CSV
  • Smart Socket Graph: per-socket monitoring charts inside the control popup
  • EcoLab Power Monitoring: Growatt inverter monitoring on page 1
  • Weather Station Monitoring: laboratory weather data monitoring
  • Smart Lamp Control
  • Smart AC Control
  • Windows 11 Dark Mode Handling: light theme enforcement for key widgets

Technology Stack

Frontend

  • PySide6 (Qt6)
  • Python 3.10+
  • PySide6.QtCharts for Smart Socket charts

Backend / Services

  • Firebase Authentication
  • Pyrebase4
  • MQTT (paho-mqtt) for IoT device communication
  • Growatt data integration for inverter monitoring
  • Weather data integration for Weather Station monitoring
  • Google Cloud / OAuth config for Google login

Hardware

  • Growatt Inverter for EcoLab Power Monitoring
  • ESP32-C3 for Smart Socket
  • Wemos D1 Mini for Smart Lamp and Smart AC
  • PZEM-004T v3.0 for Smart Socket energy monitoring
  • DS1302 RTC for Smart Socket timer and schedule
  • PCB Smart AC & Smart Lamp designed by Ilham Purnomo (KiCad)

Installation

Prerequisites

bash
Python 3.10 or higher

Install dependencies

bash
pip install -r requirements.txt

Runtime configuration

The application needs four external setup areas:

  1. Firebase web configuration in .env
  2. Google OAuth client credential in credentials/client_secret.json
  3. MQTT TLS certificate in credentials/ca.crt or credentials/ca2.crt
  4. Growatt account credential in .env

See credentials/README.md for the detailed credential guide.

Firebase setup

  1. Create or open the EcoLab project in Firebase Console.
  2. Enable Authentication for Email/Password.
  3. Enable Google Sign-In in Firebase Authentication if you want Google login.
  4. Copy the Firebase web app values into the root .env file.
  5. Generate a service account key and place it in credentials/firebase_service_account.json.

Example Firebase web config values:

json
{
  "apiKey": "YOUR_API_KEY",
  "authDomain": "YOUR_PROJECT.firebaseapp.com",
  "databaseURL": "https://YOUR_PROJECT.firebaseio.com",
  "projectId": "YOUR_PROJECT_ID",
  "storageBucket": "YOUR_PROJECT.appspot.com",
  "messagingSenderId": "YOUR_SENDER_ID",
  "appId": "YOUR_APP_ID"
}

Required .env keys:

env
ECOLAB_FIREBASE_API_KEY=
ECOLAB_FIREBASE_AUTH_DOMAIN=
ECOLAB_FIREBASE_DATABASE_URL=
ECOLAB_FIREBASE_PROJECT_ID=
ECOLAB_FIREBASE_STORAGE_BUCKET=
ECOLAB_FIREBASE_MESSAGING_SENDER_ID=
ECOLAB_FIREBASE_APP_ID=
ECOLAB_FIREBASE_SERVICE_ACCOUNT=

Notes:

  • Leave ECOLAB_FIREBASE_SERVICE_ACCOUNT empty if you use credentials/firebase_service_account.json.
  • Fill ECOLAB_FIREBASE_SERVICE_ACCOUNT only if the service account file is stored somewhere else.

Google OAuth setup

Google Sign-In does not use only Firebase settings. It also needs a Google OAuth client JSON file.

Prepare:

  • credentials/client_secret.json

Steps:

  1. Open Google Cloud Console.
  2. Select the same Google Cloud project linked to EcoLab.
  3. Go to APIs & Services -> Credentials.
  4. Create or open the OAuth client used by the app.
  5. Download the client JSON.
  6. Rename it to client_secret.json.
  7. Place it inside the credentials/ folder.

If Google Sign-In fails, the first thing to verify is whether credentials/client_secret.json matches the active Google Cloud project.

MQTT TLS setup

MQTT communication for the IoT devices uses TLS and requires a CA certificate file.

Prepare:

  • credentials/ca.crt as the default CA certificate
  • credentials/ca2.crt as an optional backup CA certificate for some simulator or broker setups

Required .env keys:

env
ECOLAB_MQTT_BROKER=
ECOLAB_MQTT_PORT=8883
ECOLAB_MQTT_USERNAME=
ECOLAB_MQTT_PASSWORD=
ECOLAB_MQTT_CA_CERT=credentials/ca.crt
ECOLAB_MQTT_USE_TLS=true

What to prepare for MQTT TLS:

  1. MQTT broker hostname or IP
  2. MQTT username and password
  3. TLS-enabled MQTT port, usually 8883
  4. CA certificate file, usually credentials/ca.crt
  5. Fallback CA certificate if your simulator or broker setup uses ca2.crt

Notes:

  • main.py defaults to credentials/ca.crt when ECOLAB_MQTT_CA_CERT is not overridden.
  • Some simulator files in hardware_TA/ still point to ca2.crt, so keep both certificate files available unless you are standardizing them.
  • Do not embed certificate contents directly into the firmware.

Growatt setup

Dashboard startup currently initializes the Growatt panel during MainWindow creation, so these .env keys are required when opening the dashboard:

env
ECOLAB_GROWATT_USERNAME=
ECOLAB_GROWATT_PASSWORD=

Notes:

  • Use the same Growatt account that has access to the target storage/inverter plant.
  • If the account has no accessible plant or storage device, the Growatt panel will fail during startup.

Minimum files checklist

Before running the app, make sure these files exist:

text
.env
credentials/client_secret.json
credentials/firebase_service_account.json
credentials/ca.crt

Optional but recommended:

text
credentials/ca2.crt

Minimum required .env groups for a full dashboard launch:

  • Firebase web config keys
  • MQTT connection keys
  • Growatt account keys

Usage

Run the application

bash
python launcher.py

Authentication options

  1. Email Login
    Sign in with email and password.
  2. Google Sign-In
    Sign in with a Google account.
  3. Guest Mode
    Read-only access without device control.

User roles

RoleAccess
GuestMonitoring only, without device control
UserDevice control and main dashboard access
AdminAll user features plus the admin panel

Smart Socket Updates

The current Smart Socket feature set includes:

  • Per-socket relay ON/OFF control
  • Per-socket timer
  • Start/stop schedules with daily and onetime modes
  • Monitoring for Voltage, Current, Power, Energy, Frequency, PF
  • Control popup with Control, Data, Graph, Warning, and Setting tabs
  • Per-socket monitoring data recording
  • Configurable recording interval from the popup
  • Follow Schedule option to automatically start recording when a schedule becomes active
  • Autosave CSV when schedule-based recording ends
  • Load warning levels for elevated, high, and critical current
  • Light warning popup for elevated load with cooldown control
  • Critical overload protection with user response popup, grace period, and automatic relay cutoff
  • Automatic schedule clearing before forced OFF when overload protection is triggered during an active schedule
  • Admin-only Smart Socket Setting tab inside the popup to configure power-off protection per socket
  • Power-off protection modes: Blocked and Password required
  • Protection configuration stored in Firebase Realtime Database so it can be shared across multiple PCs
  • Per-socket CSV export
  • Per-socket charts with selectable metrics
  • Table and chart refresh only while recording is active

Implementation notes:

  • The Python Smart Socket simulator has been aligned with the latest firmware concept.
  • Firmware files from smartsocket2.ino to smartsocket5.ino were derived from smartsocket.ino with adjusted MQTT topics.

Project Structure

The current project structure after refactoring is:

text
Aplikasi EcoLab -  New/
|-- launcher.py
|-- loginmain.py
|-- main.py
|-- create_admin.py
|-- README.md
|-- requirements.txt
|-- build.bat
|-- .env.example
|-- auth/
|   |-- auth_service.py
|   `-- session_manager.py
|-- config/
|   |-- firebase_settings.py
|   |-- login_settings.py
|   `-- path_utils.py
|-- dialogs/
|   |-- admin_window.py
|   `-- smartsocket_popup.py
|-- services/
|   |-- smartsocket_recorder.py
|   |-- smartsocket_protection_store.py
|   `-- smartsocket_settings_manager.py
|-- app/

Architecture Overview

Entry Flow

  • launcher.py is the main application entry point.
  • It loads any saved session through auth/session_manager.py.
  • If a valid session exists, it opens the main dashboard.
  • Otherwise, it opens loginmain.py.

Authentication Layer

  • auth/auth_service.py handles Firebase authentication and user records.
  • auth/session_manager.py stores the local session file used by remember-me behavior.
  • create_admin.py is a helper script for manually creating the first admin account.

Main Application Layer

  • main.py contains the main dashboard window and top-level application orchestration.
  • loginmain.py handles login, sign-up, forgot password, guest mode, and the admin/dashboard selection flow.
  • dialogs/admin_window.py contains the admin panel.
  • dialogs/smartsocket_popup.py contains the detailed Smart Socket control and monitoring popup.
  • services/smartsocket_protection_store.py stores Smart Socket power-off protection data in Firebase Realtime Database.

Setup Helpers

The app/setup/ modules are thin UI wiring helpers:

  • lamp_setup.py creates and connects custom lamp buttons
  • switch_setup.py creates and connects Smart Socket switch buttons
  • ac_setup.py creates and connects the custom AC button
  • arrow_setup.py creates and stores flow arrows
  • smartsocket_setup.py connects Smart Socket backend signals to the main window

Backend Layer

The backend/ folder contains service and integration modules:

  • mqtt_client.py manages the shared MQTT connection
  • mqtt_dht22_backend.py stores and filters DHT22 sensor messages
  • mcu_status_backend.py tracks MCU online/offline state
  • smartsocket_backend.py handles MQTT topics for all Smart Socket devices
  • lampbutton_backend.py and acbutton_backend.py send control commands
  • growatt_backend.py fetches inverter data
  • growatt_worker.py runs Growatt fetches outside the UI thread
  • weathercloud_backend.py fetches weather station data

UI and Widget Layer

  • ui/ contains helper code and generated Python modules from Qt Designer .ui files
  • widgets/ contains handwritten custom widgets used by the dashboard
  • resources_rc.py contains the compiled Qt resource bindings

Hardware TA

The hardware_TA/ folder contains firmware and simulators used for development and device integration testing.

Arduino / firmware

  1. smartsocket.ino - Smart Socket 1 firmware based on MQTT
  2. smartsocket2.ino - Smart Socket 2 firmware based on MQTT
  3. smartsocket3.ino - Smart Socket 3 firmware based on MQTT
  4. smartsocket4.ino - Smart Socket 4 firmware based on MQTT
  5. smartsocket5.ino - Smart Socket 5 firmware based on MQTT
  6. smartlampcontrol.ino - Smart Lamp firmware
  7. smartaccontrol.ino - Smart AC Control firmware

Python simulators

  1. smartsocket_simulator.py - Smart Socket 1 simulator
  2. smartsocket2_simulator.py - Smart Socket 2 simulator
  3. smartsocket3_simulator.py - Smart Socket 3 simulator
  4. smartsocket4_simulator.py - Smart Socket 4 simulator
  5. smartsocket5_simulator.py - Smart Socket 5 simulator
  6. mcua_simulator.py - MCU-A simulator
  7. mcub_simulator.py - MCU-B simulator

Example: run a simulator

bash
cd hardware_TA
python smartsocket_simulator.py

PCB Designs (KiCad)

  • Smart AC & Smart Lamp — PCB designed by Ilham Purnomo during the 2025 internship.
PCBDesignerLocationDescription
PCB Smart ACIlham Purnomohardware_TA/PCB Designs/Rangkaian Control AC/PCB AC/AC control relay, transformer, and XL6009 DC-DC converter
PCB Smart LampIlham Purnomohardware_TA/PCB Designs/Rangkaian Control Lampu/PCB_LAMPU/Lamp control relay, transformer, and XL6009 DC-DC converter

Custom KiCad libraries are located under Libraries for Arduino IDE/ in each project folder.


Feature Details

Session management

  • Save login sessions
  • Remember-me support
  • Auto-login when the session is still valid
  • Application logout

Admin panel

  • View user list
  • Approve accounts
  • Update user/admin roles
  • Block/unblock accounts
  • Update passwords for non-Google users
  • Delete accounts

Smart Socket

  • Device status monitoring
  • Relay control
  • Countdown timer
  • Automatic scheduling
  • Real-time energy monitoring
  • Multi-level current warning system
  • Automatic overload cutoff for critical current conditions
  • Admin-only power-off protection settings inside the Smart Socket popup
  • Power-off protection synced through Firebase so the same socket rules can be read from different PCs
  • Data recording, CSV export, and charts
  • Final Project — fully developed by Stephanus Kevin Andika Rata (Hardware & Software)

Smart Lamp

  • Laboratory lamp control
  • MQTT-based switching
  • Supports multiple lamp channels in the control room page
  • Developed together with Ilham Purnomo
  • Hardware PCB design: Ilham Purnomo

Smart AC

  • IR-based AC control
  • Cooling and fan modes
  • Temperature settings
  • Developed together with Ilham Purnomo
  • Hardware PCB design: Ilham Purnomo

EcoLab Power Monitoring

  • Displays Growatt inverter data on page 1
  • EcoLab power summary and live monitoring
  • Serves as the main laboratory energy monitoring page

Weather Station Monitoring

  • Displays laboratory weather station data
  • Environmental sensor monitoring on the dashboard
  • Integrated into the monitoring page for surrounding condition tracking

Authentication Flow

text
launcher.py -> check session
  |- valid session -> open dashboard
  |- no session -> open login window
       |- email/password -> Firebase -> save session -> dashboard
       |- Google sign-in -> OAuth -> save session -> dashboard
       |- guest mode -> temp session -> dashboard (limited)

Notes

  • Use launcher.py as the main application entry point.
  • The local session file is created automatically after a successful login.
  • Firebase credential files are not included in the repository.
  • Several key widgets are forced into a light theme to avoid text color issues on Windows 11 dark mode.
  • Smart Socket MQTT firmware no longer stores the CA certificate contents directly inside the .ino files.

Contact

Stephanus Kevin Andika Rata
Software Development & System Integration
DTEDI Electronics Laboratory Internship 2025
Final Project - EcoLab Smart Laboratory
DTEDI Electronics Laboratory
Universitas Gadjah Mada

Email: kevinandika18@gmail.com

Ilham Purnomo
Hardware PCB Design (Smart AC & Smart Lamp)
DTEDI Electronics Laboratory Internship 2025
DTEDI Electronics Laboratory
Universitas Gadjah Mada


License & Copyright

Copyright (c) 2026 Stephanus Kevin Andika Rata
PCB Design (Smart AC & Lamp): Ilham Purnomo

Parts

45
QtyValueFootprintReferences
4MountingHoleMountingHole:MountingHole_3mm_Pad_ViaH3, H4, H5, H6
310kResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR10k, R10k, R10k
3120Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR120, R120, R120
3220Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR220, R220, R220
1100Resistor_THT:R_Axial_DIN0411_L9.9mm_D3.6mm_P12.70mm_HorizontalR100 - 1 or 5 Watt
1100nFCapacitor_THT:C_Rect_L7.2mm_W2.5mm_P5.00mm_FKS2_FKP2_MKS2_MKP2100nF
132.768Crystal:Crystal_C26-LF_D2.1mm_L6.5mm_HorizontalCRYSTAL
1330uFCapacitor_SMD:CP_Elec_8x10.5330uF 16V
133uHInductor_SMD:L_10.4x10.4_H4.822uH
1470Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR470
1470uFCapacitor_SMD:CP_Elec_10x10.5470uF 25V
1AC Socket LoadAC DC Converter:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mmLoad Terminal
1BT136-600Package_TO_SOT_THT:TO-220-3_Horizontal_TabDownBTA24
1Battery_CellBattery:Battery_Panasonic_CR2032-HFN_Horizontal_CircularHolesCR2032 Batttery
1DC SWITCHConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalSwitch DC
1DS1302+Package_SO:SOIC-8_3.9x4.9mm_P1.27mmDS1302
1ESP32-C3ESP32-C3_SUPERMINI_TH:MODULE_ESP32-C3_SUPERMINI_THESP32-C3
1FuseAC DC Converter:Fuse_1808Fuse
1HLK-PM01Converter_ACDC:Converter_ACDC_Hi-Link_HLK-PMxxHLK-PM01
1Input 220VAC DC Converter:TerminalBlock_Ningbo-Kagnex_HB9500_1x02_P9.5mmInput Terminal
1LEDLED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolderD1
1LOGOsilkscreen:spotifyplaylistG***
1LOGOsilkscreen:logougmG***
1LOGOsilkscreen:metalbloomG***
1LOGOsilkscreen:imageG***
1LOGOsilkscreen:logoecolabG***
1LOGOsilkscreen:solarbloomG***
1MOC3021AC DC Converter:MOC3021MOC3021
1PZEM SensorConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalPZEM Sensor
1RGB LEDConnector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_VerticalRGB LED
1SS8050Package_TO_SOT_SMD:SOT-23SS8050
1SWITCH FASA INMountingHole:MountingHole_2.2mm_M2_DIN965_PadSW1
1SWITCH FASA to LOADMountingHole:MountingHole_2.2mm_M2_DIN965_PadSW2

The 42 most common of 45 parts.

More from KevinAR-18/EcoLab-Dashboard

2
  • 2 layers132 × 96.5 mmPCB LAMPU, the printed circuit board in 3D

    PCB LAMPU

    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.

    25 parts
  • 2 layers97 × 67 mmPCB AC, the printed circuit board in 3D

    PCB AC

    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.

    16 parts

Similar boards

  • 2 layers100 × 80 mmSmart Home Controller, the printed circuit board in 3D

    Smart Home Controller

    Ajith-Anand-R/Smart-Home-Controller

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

    11 parts1MIT
  • 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 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
  • 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 layers61.5 × 48.5 mmModulo Dimmer, the printed circuit board in 3D

    Modulo Dimmer

    HenryqueFarias16/HardDimmer

    Automação Dimmerizada com microcontrolador ESP12-E

    28 parts
  • 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

Questions

How big is the Smart Socket Final Version PCB?

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

What parts does the Smart Socket Final Version use?

45 parts, built around the ESP32-C3, BT136-600E, HLK-PM01 and DS1302+. 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 Socket Final Version KiCad files?

From the KevinAR-18/EcoLab-Dashboard repository on GitHub, at the commit this page was made from: the board is hardware_TA/PCB Designs/Rangkaian Smart Socket Final Version/Smart Socket Final Version.kicad_pcb and its schematic hardware_TA/PCB Designs/Rangkaian Control AC/Libraries for Arduino IDE/d1_mini_kicad-master/d1_mini_kicad-master/template/d1_mini_shield.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Smart Socket Final Version design in my own project?

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