Skip to the content
PCBKitNew board
2 layers23.5 × 5 mmMetsta, the printed circuit board in 3D

Low-power ESP32 environmental telemetry node. Includes custom KiCad hardware schematics, ESP-NOW protocol broadcasting, custom I2C drivers, and deep sleep power management.

Size
23.5 × 5 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
57
Pads
158
Tracks, vias
204, 24
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
29 Jul 2026
Updated
29 Jul 2026

Overview

Metsta is an open-source printed circuit board by losneoo, from the losneoo/esp32-wsn-telemetry-node repository on GitHub. It is a 2-layer board of 23.5 × 5 mm with 25 parts on 57 nets, routed with 204 tracks and 24 vias.

It is built around the CH340C, ESP32-WROOM-32E and BME280, with the SGP30 and AP2112K-3.3 among its other parts. Its parts include 10 resistors, 5 ICs, 4 capacitors, 2 diodes and 2 transistors. It belongs with the ESP32 boards of this library.

Main components

5

README

README.md

Low-Power ESP32 Environmental Telemetry Node

This repository documents the complete hardware and firmware implementation of an ultra-low-power, custom-designed ESP32 environmental sensor node. I designed this system from scratch from KiCad PCB layout to FreeRTOS C firmware as a comprehensive proof-of-concept for deployable, battery-operated IoT telemetry using the connectionless ESP-NOW protocol.

The system continuously monitors temperature, humidity, barometric pressure, estimated CO2 (eCO2), and battery voltage, broadcasting the data to a central gateway before returning to a deep sleep state.

ESP-IDF License Hardware KiCad

Table of Contents

Overview

I designed this wireless station to operate autonomously on battery power for extended periods. It relies on a carefully orchestrated 5-minute wake/sleep cycle. The firmware is written in C using the Espressif IoT Development Framework (ESP-IDF v5+) and FreeRTOS.

The core design philosophy is modularity and power efficiency. The hardware separates the power domain, digital domain, and sensor domain, while the firmware abstracts sensor communication, radio transmission, and sleep management into isolated components.

The complete telemetry payload is structured as follows:

c
typedef struct __attribute__((packed)) {
    uint8_t  node_id;       // Derived from MAC address
    uint32_t message_id;    // RTC incremented message counter
    float    temperature;   // °C
    float    humidity;      // %RH
    float    pressure;      // hPa
    uint16_t eco2_ppm;      // eCO2 in parts-per-million
    uint16_t battery_mv;    // Calibrated battery voltage (mV)
    uint8_t  status_flags;  // Bitmask for Sensor/Battery errors
} sensor_payload_t;

Hardware Architecture

The custom PCB was designed in KiCad. The design files (schematic, layout, and component libraries) are available in the Hardware/ directory.

Power Subsystem & Battery Monitoring

The board is powered by a lithium-ion battery, regulated to 3.3V by a high-efficiency AP2112K Low Dropout (LDO) regulator. This LDO was chosen for its low quiescent current, which is critical for maximizing battery life during deep sleep.

Battery voltage monitoring is implemented using a simple resistive voltage divider connected to an ADC channel. To ensure accurate readings across the discharge curve, the firmware (battery_adc.c) utilizes the ESP32 internal calibration routines to convert raw ADC readings to precise millivolts.

Environmental Sensing (I2C)

The node features two primary environmental sensors sharing a single 100kHz I2C bus:

  • BME280 (Bosch Sensortec): Provides highly accurate temperature, relative humidity, and barometric pressure measurements.
  • SGP30 (Sensirion): A metal-oxide (MOX) gas sensor that provides estimated CO2 (eCO2) readings.

The I2C bus utilizes hardware 4.7kΩ pull-up resistors to ensure crisp signal edges, allowing the firmware to disable internal weak pull-ups for improved reliability.

USB and Programming Interface

A modern USB-C receptacle is included for direct flashing and serial debugging. The USB data lines (DP, DN) are routed to a CH340C USB-to-UART bridge, which interfaces with the ESP32 hardware UART0. The auto-reset circuit (utilizing DTR/RTS signals and two NPN transistors) allows seamless firmware uploads via idf.py flash without manual button presses.

Firmware Implementation

The firmware is structured into several modular source components:

ModuleRole
main.cCore application logic, sleep management, and payload assembly.
central_node.cGateway application logic for receiving ESP-NOW packets.
battery_adc.cADC initialization, calibration, and voltage calculation.
bme280.cBME280 initialization, raw data reading, and compensation math.
sgp30.cSGP30 initialization, IAQ reading, and CRC8 validation.

State Machine & Deep Sleep

The primary execution flow in app_main() is strictly linear to minimize active time:

  1. Wake up from Deep Sleep.
  2. Initialize NVS and I2C bus.
  3. Initialize sensors and ADC.
  4. Read BME280 (Temperature, Humidity, Pressure).
  5. Read SGP30 (eCO2).
  6. Read Battery Voltage.
  7. Assemble sensor_payload_t and set status flags.
  8. Initialize Wi-Fi and ESP-NOW radio.
  9. Transmit payload to the gateway MAC address.
  10. Deinitialize peripherals to prevent current leakage.
  11. Enter Deep Sleep for 300 seconds (5 minutes).

ESP-NOW Telemetry

To achieve micro-ampere average power consumption, standard Wi-Fi (connecting to an AP, acquiring DHCP, establishing TCP/MQTT connections) is too slow and power-hungry.

I chose ESP-NOW, a connectionless protocol that allows the node to wake up, broadcast its 18-byte payload in milliseconds, and immediately go back to sleep. The node transmits to a broadcast MAC address (FF:FF:FF:FF:FF:FF), which is received by the central gateway device running central_node.c.

Sensor Drivers & Compensation

I wrote custom, lightweight drivers for both sensors rather than relying on heavy third-party libraries:

  • The bme280.c driver includes the full Bosch integer compensation algorithms, reconstructing the calibration matrix from the sensor's NVM to calculate exact physical values.
  • The sgp30.c driver implements strict CRC8 verification on every byte received from the sensor to prevent corrupted IAQ readings.

Engineering Challenges & Resolutions

During development, several hardware and firmware interactions required careful resolution:

  1. SGP30 MOX Warm-up Delay: The Sensirion SGP30 requires a hot-plate element to reach operating temperature. Immediately after issuing initialization commands, the sensor returns baseline values until warmed up. I structured the firmware sampling loop to ensure valid reading capture before signaling readiness for deep sleep.
  2. Isolated Ground Planes (PCB Layout): During routing, thick power traces inadvertently severed the top-layer copper ground pour, resulting in orphaned ground islands and DRC thermal errors. I resolved this by placing stitching vias to bridge top-layer copper islands directly to the continuous bottom-layer ground plane.
  3. ESP-NOW Channel Locking: For reliable transmission, ESP-NOW requires the sender and receiver to operate on the same Wi-Fi channel. The firmware explicitly configures the primary channel to ensure packets are not silently dropped by the gateway.

Parts

25
QtyValueFootprintReferences
410kResistor_SMD:R_0805_2012MetricR5, R6, R7, R8
20.1ufCapacitor_SMD:C_0805_2012MetricC3, C4
2100kResistor_SMD:R_0805_2012MetricR9, R10
210ufCapacitor_SMD:C_0805_2012MetricC1, C2
24k7Resistor_SMD:R_0805_2012MetricR3, R4
25k1Resistor_SMD:R_0805_2012MetricR1, R2
2D_SchottkyDiode_SMD:D_SOD-123D1, D2
2NPNPackage_TO_SOT_SMD:SOT-23Q1, Q2
1AP2112K-3.3Package_TO_SOT_SMD:SOT-23-5U1
1BME280Package_LGA:Bosch_LGA-8_2.5x2.5mm_P0.65mm_ClockwisePinNumberingU3
1CH340CPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU2
1Conn_01x02_PinConnector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_VerticalJ2
1ESP32-WROOM-32ERF_Module:ESP32-WROOM-32DU5
1SGP30sgp30:SGP30U4
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4110J1

Questions

How big is the Metsta PCB?

It measures 23.5 × 5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Metsta use?

25 parts, built around the CH340C, ESP32-WROOM-32E, BME280 and SGP30. 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 Metsta KiCad files?

From the losneoo/esp32-wsn-telemetry-node repository on GitHub, at the commit this page was made from: the board is Hardware/metsta.kicad_pcb and its schematic Hardware/metsta.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Metsta design in my own project?

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

Similar boards

  • 2 layers76.8 × 100 mmProject CV, the printed circuit board in 3D

    Project CV

    KazimGL/ESP32-PowerIoT-DevBoard

    ESP32 battery-powered IoT dev board with Li-ion charging, protection, and sensor support — designed in KiCad

    62 parts
  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers134.6 × 127 mmSensors Course Project, the printed circuit board in 3D

    Sensors Course Project

    dustpot/indoor-air-monitor

    A battery-powered ESP32 monitor for the non-particulate qualities of indoor air: temperature, humidity, pressure, eCO₂, and TVOC.

    28 parts
  • 2 layers73 × 77.5 mmUca dkaiot2-kicad, the printed circuit board in 3D

    Uca dkaiot2-kicad

    LEAT-EDGE/ambient-pcb-dkaiot

    The design also provides empty footprints for several other sensors which are not populated in the Ambient variant: - Light sensor (LITEON LTR-303ALS-01) - MEMS microphone (Knowles SPH0645LM4H) - Indoor air quality…

    184 partsCERN-OHL-P-2.0
  • 2 layers40 × 98 mmAirquality, the printed circuit board in 3D

    Airquality

    LukasLendvorsky/airquallity-esphome

    WIFI airquality sensor with ESP32

    59 parts3GPL-3.0
  • 2 layers72 × 121 mmTeebeutel, the printed circuit board in 3D

    Teebeutel

    entropia/Teebeutel-Hardware

    Teebeutel (eng. Teabag) is an electronic, Entropia themed con-badge for the GPN20, featuring an ESP32 microprocessor running micropython.

    201 parts1
  • 2 layers75 × 65 mmEsp32-env sensor, the printed circuit board in 3D

    Esp32-env sensor

    aluisioalves123/esp32-env-sensor

    Placa de sensor ambiental com ESP32-WROOM-32E projetada do zero no KiCad 9: USB-C com CH340C e auto-program, BME280 e BH1750FVI em I2C, regulacao AMS1117-3.3.

    33 partsMIT
  • 2 layers61.3 × 63.3 mmMonitoring Gunung, the printed circuit board in 3D

    Monitoring Gunung

    rafdi03/PCB_Desain

    Schematic PCB Project

    50 parts