
Smart db
c-lydia/SmartDB
A distribution board system designed for automatic electrical fault monitoring using Digital Signal Processing (FFT analysis), Isolation Forest, and YOLO thermal imaging detection with a Mobile App, alerting system, and…

A distribution board system designed for automatic electrical fault monitoring using Digital Signal Processing (FFT analysis), Isolation Forest, and YOLO thermal imaging detection with a Mobile App, alerting system, and automatic cutoff.
Smart db is an open-source printed circuit board by c-lydia, from the c-lydia/SmartDB repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board with 49 parts on 47 nets, routed with 273 tracks and 0 vias.
It is built around the ADS1115IDGS, AMS1117 and IRLZ44N. Its parts include 13 connectors, 9 resistors, 8 capacitors, 4 ICs and 3 switches. It belongs with the ESP32 boards of this library.
SmartDB is a household electrical fault detection and protection system spanning ESP32 firmware, KiCad hardware, a device-ingestion gateway, API examples, and engineering reference material.
| Project | Hosted website | GitHub | Role |
|---|---|---|---|
| SmartDB | Documentation | c-lydia/SmartDB | Hardware, firmware, backend/API and engineering documentation |
| SmartDB documentation | Current architecture · PCB downloads · API/team handoff | Documentation sources | Public documentation site |
| ByteLab | ByteLab Web | c-lydia/ByteLab | Related firmware development workspace; desktop and browser editions |
| SmartDB user dashboard | Not published yet | Repository not available yet | Owned by the frontend team; links will be added when available |
ByteLab is a development companion, not SmartDB's user dashboard. The optional local SmartDB developer console is for API testing and is not publicly deployed.
| Path | Contents |
|---|---|
backend/ | Python CoAP/CBOR ingestion gateway and tests |
cloud/ | Implemented Firebase HTTP API, emulator launcher and frontend integration guide |
dashboard/ | Optional developer console; user dashboard belongs to the frontend team |
esp_idf/smartdb_fusion/ | PlatformIO ESP-IDF v2 system firmware and separate ESP32-CAM firmware; build/flash guide |
smart_db/ | Earlier KiCad design and historical manufacturing outputs |
smart_db_v2/ | Selected hardware revision; review findings and ESP32-S3 module decision |
postman/ | User-facing HTTP API requests, OpenAPI contract, and collection guide |
docs/ | System architecture and engineering references |
Run sh system.sh from this folder (Node.js 22 LTS and Java 21+ required). It starts
Firebase emulators and the optional developer console, prints a local administrator login,
and preserves local data on clean shutdown. The API is at http://127.0.0.1:5000/api/v1.
See the team API handoff for integration, Postman, device provisioning,
configuration commands and deployment. The frontend team owns the user dashboard.
The web documentation source includes the setup guide, hardware notes,
API guide and architecture. Rebuild it with ./docs/build.sh and open
docs/_build/html/index.html; see website maintenance.
Open esp_idf/smartdb_fusion as the VS Code project folder, then choose
Terminal → Run Task → SmartDB: Setup. Alternatively, launch the menu from that folder:
./setup.shChoose 1 to enter Wi-Fi settings, 2 to set up the ESP32-CAM, then 3 to set up the SmartDB main board. The menu selects ports, offers the initial firmware flash, saves settings and checks Wi-Fi. Use 4 for protection limits. Later connection changes are saved over USB without rebuilding. The camera and main board each need their own firmware; PlatformIO combines their source files automatically.
Connect each board directly to the computer for setup. The main board's J6 camera socket supplies power only and cannot program the camera. See the firmware guide for connections, configuration, recovery and calibration. The full architecture separates implemented bench behavior from production requirements; the backend guide covers the separate CoAP ingestion gateway.
SmartDB v2 is being corrected for an ESP32-S3-WROOM-1-N16R8 module supplied and assembled by JLCPCB. The existing ESP32-WROOM-32 development board is separate test hardware, not the selected PCB module. The module replacement is applied in the KiCad schematic and PCB, with corrected reset/boot wiring and an updated pin map. The current revision targets a low-voltage bench load, with corrected 5 V logic power, USB, CT input and a separate normally-open relay contact connector. The permanent v2 project now contains the 95 × 78 mm compact redesign with an AP63203 buck supply, four copper layers, and the SmartDB logo and connector labels. All PCB connections are routed, with wider signal and power traces and continuous inner ground planes. ERC, DRC, connectivity and schematic parity checks report zero issues. See the v2 review for current validation results, previews and the archived previous board. It is not a mains protection board.
The v2 bench firmware now covers SCT-013 isolated low-voltage AC monitoring, MLX90640
thermal sensing, local relay protection with physical re-arm, persistent configuration/events,
registered RGB–thermal fusion and optional HTTPS diagnostic telemetry using the Postman
contract. Build smartdb_s3 for the main board and esp32cam for the separate camera.
See the firmware guide for configuration, flashing,
calibration and implementation limits. Source/build verification is complete; physical bench
validation remains pending. The PCB logic supply is DC; the CT measurement is AC-only.
This is an engineering-stage repository, not a production-certified safety device. The backend's secure transport integration and several firmware/hardware validation activities remain explicit pre-production work. Do not use it as the sole protective mechanism for a live electrical installation.
Maintained application code uses two-space indentation for JavaScript, CSS, and shell,
four spaces for Python and C, and a 100-column target. Prettier handles the web/API code,
Ruff formats and checks Python, clang-format handles the current firmware, and shfmt
formats shell scripts. Editor defaults are in .editorconfig.
C code uses an open, Python-like layout: one statement per line, spaces around operators, braced control-flow blocks, and blank lines between functions and logical steps.
Install the development tools with npm ci and, inside a Python virtual environment,
python -m pip install -r requirements-dev.txt. Install clang-format and shfmt separately;
the formatting baseline uses clang-format 23.1.0 and shfmt 3.13.1.
npm run format # Apply formatting
npm run format:check # Check formatting and Python imports/errors without rewriting files
npm run build # Build the developer console
npm test # Run the cloud API tests using local Firebase emulators
python -m pytest backend/tests
sh esp_idf/smartdb_fusion/tools/check.shThe formatting commands cover backend, cloud, dashboard, documentation support
scripts/styles, launchers, and first-party code in esp_idf/smartdb_fusion. They exclude
generated outputs, local firmware configuration, upstream sensor drivers, legacy firmware
examples, hardware design files, archives, and Postman exports.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J2, J4, J5, J10, J11, J12, J13 |
| 4 | 10u 25V | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C1, C4, C6, C8 |
| 3 | 100 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal | R7, R8, R9 |
| 3 | 100n 25V | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | C3, C5, C7 |
| 3 | 10k | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal | R2, R3, R4 |
| 3 | Screw_Terminal_01x02 | TerminalBlock_RND:TerminalBlock_RND_205-00276_1x02_P5.00mm_Vertical | J1, J7, J9 |
| 2 | 250V 1A | Button_Switch_THT:SW_PUSH_1P1T_6x3.5mm_H5.0_APEM_MJTP1250 | SW1, SW2 |
| 2 | Conn_01x01_Pin | Connector_PinHeader_2.54mm:PinHeader_1x01_P2.54mm_Vertical | J6, J8 |
| 1 | 100 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical | R6 |
| 1 | 10n 25V | Capacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mm | C2 |
| 1 | 1N4007 | Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal | D1 |
| 1 | 200mA/400mA | Fuse:Fuse_Bourns_MF-RHT050 | F2 |
| 1 | 220 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical | R5 |
| 1 | 33 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1 |
| 1 | 500mA/1A | Fuse:Fuse_Bourns_MF-RHT050 | F1 |
| 1 | 5V 0.1A | TerminalBlock_RND:TerminalBlock_RND_205-00276_1x02_P5.00mm_Vertical | M1 |
| 1 | ADS1115IDGS | Package_SO:TSSOP-10_3x3mm_P0.5mm | U1 |
| 1 | AMS1117 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U4 |
| 1 | Conn_01x04_Pin | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J3 |
| 1 | ESP32-DEVKIT-V1 | devkit v1:MODULE_ESP32_DEVKIT_V1 | U2 |
| 1 | Fujitsu_FTR-LYAA005x | Relay_THT:Relay_SPST-NO_Fujitsu_FTR-LYAA005x_FormA_Vertical | K1 |
| 1 | IRLZ44N | Package_TO_SOT_THT:TO-220-3_Vertical | Q1 |
| 1 | LED_KRGB | LED_THT:LED_D5.0mm-4_RGB | D2 |
| 1 | LOGO | LOGO | G*** |
| 1 | PC817 | Package_DIP:DIP-4_W7.62mm | U3 |
| 1 | Transformer_1P_1S | TerminalBlock_RND:TerminalBlock_RND_205-00278_1x04_P5.00mm_Vertical | T1 |
The 45 most common of 49 parts.

c-lydia/SmartDB
A distribution board system designed for automatic electrical fault monitoring using Digital Signal Processing (FFT analysis), Isolation Forest, and YOLO thermal imaging detection with a Mobile App, alerting system, and…

c-lydia/SmartDB
A distribution board system designed for automatic electrical fault monitoring using Digital Signal Processing (FFT analysis), Isolation Forest, and YOLO thermal imaging detection with a Mobile App, alerting system, and…

jawedhakimi/Hiking_trailer
Custom 4-layer PCB, 82.65 × 47.63 mm, 4 × M2.5 mounting holes (75 × 40 mm).

klaus-liebler/labathome
Der kleine Bruder von lab@home. Ermöglicht das Experimentieren mit PT1...PTn-Gliedern, die intern als RC-Kombination (entkoppelt über Operationsverstärker) ausgeführt sind.

oxy-2/deltavr
deltavr is a project I've poured my heart into where I've built an open source slam tracked tiny open source headset with customs pcbs, and with every part except a few all 3d printable, also massive credit to my…


johnugbor/RoboSolar
SKiDL-generated draft v0.1. NOT FOR FABRICATION — see blockers below.



NB6RULES/fabacademy-backup
▶️ Watch the presentation video — also embedded live on the Final Project page
49 parts, built around the ADS1115IDGS, AMS1117 and IRLZ44N. 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.
From the c-lydia/SmartDB repository on GitHub, at the commit this page was made from: the board is smart_db/smart_db.kicad_pcb and its schematic smart_db/.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the Apache-2.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).