Skip to the content
2 layers65.5 × 67.8 mmKiCAD PCB, the printed circuit board in 3D

IoT-based automation system for monitoring wetland reactors. Features an ESP32 Master-Slave (ESP-NOW) architecture, embedded HMI, and local SD card data logging.

Size
65.5 × 67.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
11
Nets
32
Pads
65
Tracks, vias
160, 10
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
13 Jul 2025
Updated
27 Oct 2025

Overview

KiCAD PCB is an open-source printed circuit board by Danntav, from the Danntav/wetlands-automation repository on GitHub. It is a 2-layer board of 65.5 × 67.8 mm with 11 parts on 32 nets, routed with 160 tracks and 10 vias.

Its parts include 3 resistors, 3 diodes and 1 connector. It belongs with the home automation and IoT boards of this library.

README

README.md

Wetlands Automation System

An IoT-based automation system for monitoring and controlling wetland reactors in environmental research applications.

Overview

This system implements a complete automation solution for wetland reactor monitoring using a distributed sensor network. The architecture consists of a master ESP32 unit with embedded HMI (LCD display and joystick) that coordinates data collection from up to 9 slave units via ESP-NOW wireless protocol. The master unit manages local control, real-time visualization, alarm monitoring, and fault-tolerant data logging to SD card.

System Architecture

The system uses a master-slave architecture where the master ESP32 coordinates periodic data collection from distributed slave units. Communication is handled via ESP-NOW protocol for low-power wireless operation. The master unit features an interactive HMI for field operation, stores timestamped data with fault redundancy using an RTC module, and implements comprehensive alarm management for sensor anomalies and communication timeouts.

Hardware Components

Master Unit:

  • ESP32 microcontroller
  • ST7735 LCD display (SPI interface)
  • Analog joystick for menu navigation
  • DS1307 RTC module (I2C)
  • SD card module for data logging
  • 3x RGB LED indicators for system status
  • Custom PCB designed in KiCAD
  • 3D-printed enclosure (SolidWorks)

Slave Units:

  • ESP32 microcontroller
  • Voltage and temperature sensors
  • Wireless communication via ESP-NOW

Software Implementation

The firmware is written in C/C++ using the Arduino framework. Key features include:

  • ESP-NOW Communication: Implements request-response protocol with ACK for reliable data transfer between master and slaves
  • Real-time Clock: DS1307 RTC provides accurate timestamps for all data points
  • Data Collection Cycle: Configurable 30-minute intervals for automated sensor polling
  • Buffered Writing: Collects data from all slaves before writing to SD card to minimize file operations
  • Alarm System: Monitors voltage thresholds, temperature ranges, sensor failures, and communication timeouts
  • Interactive HMI: Multi-screen menu system for viewing live data, historical logs, system status, and alarms
  • Fault Tolerance: Redundant write verification and error recovery mechanisms

Libraries Used

  • ESP-NOW & WiFi version & version 1.2.7, Wireless communication stack
  • RTClib version 2.1.4, DS1307 real-time clock interface
  • SD version 1.3.0, SD card file system management
  • Adafruit_GFX & Adafruit_ST7735 version 1.12.1 & version 1.11.0, Display graphics and ST7735 driver
  • Wire I2C communication for RTC

Key Features

  • Automatic data collection at configurable intervals (default: 30 minutes)
  • Support for up to 9 distributed slave nodes
  • Real-time monitoring with timestamped data
  • Comprehensive alarm system with visual and logged notifications
  • Field-accessible HMI with joystick navigation
  • CSV data format for easy post-processing
  • System health monitoring with LED status indicators
  • Communication timeout detection and alerts

Getting Started

Hardware Setup

  1. Assemble the master PCB with ESP32, display, RTC, SD module, and joystick
  2. Install components in the 3D-printed enclosure
  3. Program each slave unit with unique MAC address
  4. Deploy slave units at monitoring locations
  5. Power on the system and verify all slaves are detected

Software Installation

bash
git clone https://github.com/Danntav/wetlands-automation.git
cd wetlands-automation

Install required libraries in Arduino IDE, configure ESP32 board settings, and update slave MAC addresses in the master firmware before uploading.

Project Structure

text
wetlands-automation/
├── firmware/
│   ├── master/
│   │   ├── master.ino
│   │   ├── MenuManager.h
│   │   ├── LedAnimations.h
│   │   └── DataStructures.h
│   └── slave/
├── hardware/
│   ├── pcb/              # KiCAD PCB files
│   └── enclosure/        # SolidWorks 3D models
└── docs/

HMI Operation

The embedded Human-Machine Interface provides:

  • Main Menu: System overview with active slave count and last update times
  • Board Data: Individual slave readings with voltage and temperature
  • Alarms: Real-time alerts for sensor anomalies and communication failures
  • Error Log: Historical system errors with timestamps
  • System Info: RTC status, SD card status, and overall health

Navigation is performed using the analog joystick (up/down/left/right/click).

Data Logging

Data is logged in CSV format with the following structure:

text
Date,Time,BoardID,Voltage,Temperature

The system implements:

  • Buffered writes to minimize SD card wear
  • Automatic file creation with headers
  • Timestamp verification via RTC
  • Error logging for failed operations
  • Visual feedback via LED indicators

Alarm System

The system monitors and alerts for:

  • Voltage readings outside safe range (configurable thresholds)
  • Temperature anomalies beyond expected limits
  • Sensor hardware failures (invalid readings)
  • Communication timeouts (no response from slaves)

Alarms are displayed on the HMI, stored in memory, and indicated via blinking red LED.

Configuration

System parameters can be adjusted in the firmware:

  • COLLECTION_INTERVAL_MS: Data collection frequency (default: 30 minutes)
  • VOLTAGE_MIN/MAX: Voltage alarm thresholds
  • TEMP_MIN/MAX: Temperature alarm thresholds
  • COMM_TIMEOUT_MS: Communication timeout duration
  • TOTAL_SLAVES: Number of connected slave units

Contributing

Contributions, issues, and feature requests are welcome. Feel free to check the issues page or submit pull requests.

License

MIT License - see LICENSE file for details.

Author

Daniel Oliveira Tavares

LinkedIn: daniel-otavares

Email: danieloftavares@gmail.com

GitHub: @Danntav

Future Improvements

  • Cloud connectivity for remote monitoring via MQTT or HTTP
  • Mobile app integration for real-time alerts
  • Additional sensor types (pH, dissolved oxygen, flow rate)
  • Solar power system with battery management
  • Web dashboard for data visualization and historical analysis
  • Machine learning for predictive maintenance
  • LoRa support for extended range communication

Parts

11
QtyValueFootprintReferences
3220OhmResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR1, R2, R3
1Conn_01x04_PinConnector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_VerticalRTC
1Conn_01x08_PinConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ1
1LED1LED_THT:LED_D5.0mmLED1
1LED2LED_THT:LED_D5.0mmLED2
1LED3LED_THT:LED_D5.0mmLED3
1Micro_SD_CardConnector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_VerticalMicroSD
1~esp:MODULE_ESP32_DEVKIT_V1ESP32
1~Connector_PinSocket_2.54mm:PinSocket_1x05_P2.54mm_VerticalJoystick1

Similar boards

  • 2 layers60 × 30 mmController, the printed circuit board in 3D

    Controller

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    11 parts3kApache-2.0
  • 2 layers103 × 30.5 mmTS Front Endcap, the printed circuit board in 3D

    TS Front Endcap

    EEVengers/ThunderScope

    ThunderScope GitHub Repo

    11 parts1.3kMIT
  • 2 layers26 × 30 mmExpansion Card, the printed circuit board in 3D

    Expansion Card

    FrameworkComputer/ExpansionCards

    Reference designs and documentation to create Expansion Cards for the Framework Laptop

    11 parts1.1kCC-BY-4.0
  • 2 layers53.9 × 23.2 mmBuffer, the printed circuit board in 3D

    Buffer

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    11 parts1kGPL-3.0
  • 2 layers10 × 20 mm2 connector Sensor Board, the printed circuit board in 3D

    2 connector Sensor Board

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    11 parts915
  • 2 layersFet module, the printed circuit board in 3D

    Fet module

    ByteWelder/Decktility

    A handheld PC

    11 parts855CC-BY-SA-4.0
  • 2 layers47 × 33 mmSevensegment led display module, the printed circuit board in 3D

    Sevensegment led display module

    tardate/LittleArduinoProjects

    a collection of "Little Electronic & Arduino Projects", most involving electronics or an Arduino in one way or another!

    11 parts803MIT
  • 2 layers42.5 × 36.8 mmDevboard, the printed circuit board in 3D

    Devboard

    basilfx/TRADFRI-Hacking

    Hacking IKEA TRÅDFRI products, such as light bulbs, window blinds and other accessories.

    11 parts743CC-BY-4.0

Questions

How big is the KiCAD PCB PCB?

It measures 65.5 × 67.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the KiCAD PCB use?

11 parts. 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 KiCAD PCB KiCad files?

From the Danntav/wetlands-automation repository on GitHub, at the commit this page was made from: the board is master/KiCAD-PCB/KiCAD-PCB.kicad_pcb and its schematic master/KiCAD-PCB/KiCAD-PCB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the KiCAD PCB design in my own project?

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