Skip to the content
2 layers38.8 × 67 mmMeteo station, the printed circuit board in 3D

A complete, end-to-end IoT weather station built from scratch: custom PCB, FreeRTOS firmware on an ESP32, a containerised backend on an NVIDIA Jetson Orin Nano, a multi-head LSTM forecasting pipeline, a Grafana…

Size
38.8 × 67 mm
Copper layers
2
Thickness
1.6 mm
Parts
15
Nets
49
Pads
89
Tracks, vias
107, 19
Pours
2
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
1 Jan 2026
Updated
5 Jun 2026

Overview

Meteo station is an open-source printed circuit board by ionutz04, from the ionutz04/REST-API_Meteo_Station repository on GitHub. It is a 2-layer board of 38.8 × 67 mm with 15 parts on 49 nets, routed with 107 tracks and 19 vias.

Its parts include 6 resistors, 5 connectors, 3 capacitors and 1 IC. It belongs with the ESP32 boards of this library.

README

README.md

iGround — Autonomous IoT Meteorological Station

A complete, end-to-end IoT weather station built from scratch: custom PCB, FreeRTOS firmware on an ESP32, a containerised backend on an NVIDIA Jetson Orin Nano, a multi-head LSTM forecasting pipeline, a Grafana dashboard, and a Flutter mobile app. The system has been running continuously and autonomously since 14 April 2026.


Gallery

Lab prototype → balcony testing → final field deployment

Lab assemblyFirst outdoor testField deployment
Lab assemblyBalcony testField deployment
SparkFun weather meter mounted on test stand, breadboard wiring visible, first firmware tests in the labEarly outdoor validation on a university balcony — breadboard ESP32 still exposed, weather meter fully assembledFinal deployment: custom PCB v2 in enclosure, Stevenson screen housing the BME280, full sensor suite on the balcony rail since 14 April 2026

PCB design

Front (3D render)Back (3D render)Schematic
PCB frontPCB backSchematic
Custom two-layer KiCad PCB v2Back copper layer, ground planeFull circuit schematic

All hardware photos: Ploiești, Romania, 2026.


Table of Contents


Overview

iGround measures temperature, humidity, barometric pressure, wind speed, wind direction, rainfall, and PM2.5 particulate matter in real time. Every 5 minutes the ESP32 edge node sends a JWT-authenticated HTTPS POST to a Flask backend running on the Jetson Orin Nano. Every 5 hours, a forecasting container retrains a multi-head LSTM and a Ridge regression model from scratch on all accumulated data and writes 5-hour ahead predictions back to Redis TimeSeries. A Grafana dashboard and a Flutter mobile app consume the data and forecasts in real time. alt text Key numbers at a glance:

MetricValue
Uptime since deployment30+ days continuous (since 14 Apr 2026)
Forecast cycles completed~144 autonomous (no manual intervention)
Temperature forecast MAE0.29 °C (within BME280 ±0.5 °C spec)
Humidity forecast MAE0.92 %RH (within BME280 ±3 %RH spec)
Pressure forecast MAE0.018 hPa (Ridge regression)
Sensor polling interval5 minutes
Forecast retraining interval5 hours

Architecture

text
┌──────────────────────────────────────────────────────────────────┐
│  Edge Node                                                       │
│  ESP32-WROOM-32 · Custom PCB v2                                  │
│  BME280 · GP2Y · SparkFun Weather Meter                          │
│  FreeRTOS · ESP-IDF · mbedTLS HMAC-SHA256 JWT                    │
└────────────────────────┬─────────────────────────────────────────┘
                         │ HTTPS POST /sensor  (JWT, every 5 min)
                         ▼
┌──────────────────────────────────────────────────────────────────┐
│  Gateway — NVIDIA Jetson Orin Nano (JetPack 6.x)                 │
│                                                                  │
│  ┌─────────────┐  ┌──────────┐  ┌────────┐  ┌────────────────┐   │
│  │ Flask + AAA │  │  MySQL   │  │ Redis  │  │  Forecasting   │   │
│  │ Gunicorn    │─►│ audit log│  │ Time   │  │  Container     │   │
│  │ Nginx/TLS   │  └──────────┘  │ Series │◄─│  LSTM + Ridge  │   │
│  └─────────────┘                └───┬────┘  │  (every 5h)    │   │
│                                     │       └────────────────┘   │
│  (all services managed by Docker Compose)                        │
└─────────────────────────────────────┬────────────────────────────┘
                                      │
                    ┌─────────────────┴──────────────────┐
                    │                                    │
                    ▼                                    ▼
          ┌──────────────────┐               ┌─────────────────────┐

Data flow summary

  1. ESP32 reads sensors, signs a JWT with the shared HMAC-SHA256 secret, and POSTs to /sensor.
  2. Flask verifies the JWT signature and validates the chip-ID against a producer whitelist (AAA model).
  3. Validated readings are written to Redis TimeSeries keys sensor:{chip_id}:{metric} and compacted hourly to sensor:{chip_id}:{metric}:hourly.
  4. Every 5 hours the forecasting container starts, reads all data from Redis, retrains the LSTM and Ridge models, writes 10 forecast rows per metric to forecast:{metric} keys, and exits.
  5. Grafana reads all keys via the Redis TimeSeries datasource plugin and serves data to both the browser dashboard and the Flutter app through its REST API (/api/ds/query). alt text

Hardware

Custom PCB (v2)

Designed in KiCad, manufactured as a two-layer board. The second revision corrected all first-iteration footprint errors and added IP65-compatible enclosure mounting points.

Bill of Materials (key components):

ComponentPartNotes
MicrocontrollerESP32-WROOM-32Dual-core, Wi-Fi, hardware AES/SHA
T/H/P sensorBosch BME280I²C 0x76, replaces SHT21 + MS5611
Dust sensorSharp GP2Y1010AU0FOptical, 320 µs LED pulse
Weather meterSparkFun SEN-15901Anemometer, vane, rain gauge
LDO regulatorAMS1117-3.35 V → 3.3 V, ~96 mA typical
Protection diode1N4148Reverse-polarity protection

Power budget: ~96 mA typical, ~271 mA peak (during TLS handshake).

Development phases

The station went through three physical iterations before the final deployment:

PhaseDescription
BreadboardInitial sensor wiring, Arduino framework, SHT21 + MS5611
PerfboardFirst semi-permanent layout, sensor replacement with BME280
Custom PCB v2KiCad two-layer board, fixed footprints, enclosure mounting

Firmware (ESP32)

Written in C using the native ESP-IDF toolchain (migrated from Arduino for SMP FreeRTOS and hardware crypto access).

FreeRTOS task layout

TaskStackDescription
rest_worker_task16 384 BJWT generation (mbedTLS HMAC-SHA256) + HTTPS POST
bme280_task4 096 BI²C forced-mode read, compensation math
wind_speed_task2 048 BISR-driven anemometer pulse counter
wind_vane_task2 048 BADC + 16-direction lookup table
rain_task2 048 BISR-driven tipping bucket counter (0.2794 mm/tip)
gp2y_task2 048 B320 µs LED pulse, ADC sample at 280 µs

Note on stack size: rest_worker_task uses 16 KB because mbedTLS TLS handshake, HMAC-SHA256, and JSON serialisation all run in the same task context. The value was determined with uxTaskGetStackHighWaterMark().

Security

  • JWT signed with HMAC-SHA256 using the mbedTLS hardware accelerator.
  • TLS 1.2 over HTTPS for all communication.
  • Chip-ID embedded in every JWT payload for server-side device whitelisting.

Known hardware quirks fixed

  • ADC non-linearity: mitigated with esp_adc_cal_characterize() + esp_adc_cal_raw_to_voltage(). Error reduced from ±150 mV to ±30 mV.
  • BME280 I²C clock stretching: i2c_set_timeout() set to 40 ms to avoid false ESP_ERR_TIMEOUT during the 2 ms measurement window.

Backend

All services run on the Jetson Orin Nano via Docker Compose.

Services

ServiceImageRole
flaskcustomREST API, JWT verification, AAA
gunicorncustomWSGI server for Flask
nginxnginx:alpineTLS termination, reverse proxy
mysqlmysql:8Audit log, user/device registry
redisredis/redis-stackTimeSeries data store
grafanagrafana/grafanaDashboard + API middleware
forecastcustom (TF2/CUDA)Runs every 5 h, then exits

Redis key schema

text
sensor:{chip_id}:{metric}           # raw 5-min readings
sensor:{chip_id}:{metric}:hourly    # auto-compacted hourly aggregates
forecast:{metric}                   # 10-step 5-h ahead predictions

AAA security model

Every incoming request goes through Authentication (JWT signature check), Authorisation (chip-ID whitelist match), and Accounting (MySQL audit log entry). Unauthenticated or unknown devices are rejected at the Flask layer before any data reaches Redis.


Machine Learning & Forecasting

The forecasting container runs on the Jetson's 1024-core Ampere GPU (CUDA 12.6, driver 540.4.0, JetPack 6.x). Because the Jetson uses unified LPDDR5 memory, tensors built from Redis data are immediately accessible to the GPU with no explicit copy.

Model architecture

VariableModelRationale
TemperatureMulti-head LSTM (shared trunk)Strong diurnal pattern, T-H coupling
HumidityMulti-head LSTM (shared trunk)Clausius-Clapeyron coupling with T
PressureRidge regressionR²=0.238 vs temperature — largely independent, autocorrelation dominates
Rain probabilitySigmoid of ΔP tendencyFalling pressure → precipitation risk

The T-H coupling is the key architectural insight: temperature and humidity share an LSTM trunk with separate output heads, allowing the model to exploit the inverse Clausius-Clapeyron relationship directly.

Training results (held-out test set)

ModelMAERMSE
Temperature (LSTM)0.2906 °C0.4256 °C
Humidity (LSTM)0.9198 %RH1.2605 %RH
Pressure (Ridge)0.0178 hPa0.0245 hPa

Both LSTM results are within the BME280's own sensor accuracy specification.

Retraining lifecycle

text
[scheduler triggers every 5h]
  → forecasting container starts
  → reads all data from Redis TimeSeries
  → retrains LSTM + Ridge from scratch on full dataset
  → writes 10-row forecast to forecast:* keys
  → container exits

Each retraining run takes approximately 7–10 minutes on the Jetson GPU.


Presentation Layer

Grafana Dashboard

Serves as both a monitoring dashboard and a data API middleware for the Flutter app. The Flutter app never connects to Redis directly — all data goes through Grafana's /api/ds/query endpoint using Basic Auth.

Dashboard rows:

  1. Live scalar gauges (T, H, P, wind, rain, PM2.5, battery)
  2. Time-series charts (configurable window: 5 min → 30 days)
  3. Wind and rainfall panels
  4. 5-hour forecast overlay (dashed line over live series)

Flutter Mobile App

Cross-platform (Android + iOS), connects to Grafana's REST API over HTTPS.

Key endpoints used:

EndpointPurpose
GET /api/userAuthentication (Basic Auth)
GET /api/user/orgsRole detection (viewer/editor/admin)
POST /api/ds/querySensor data + forecasts from Redis
GET /api/admin/usersUser management (admin only)

Architecture: three-layer — GrafanaService singleton → StatefulWidget with Timer.periodic(5s) + Future.wait → stateless UI widgets.


Deployment & Results

MetricValue
Deployment start14 April 2026
Continuous uptime30+ days
Forecast cycles~144 (no manual restarts)
Dataset size (May 2026)~7 580 hourly rows and growing
Retraining time7–10 min/cycle on Jetson GPU
Redis write latency< 1 s (pipeline batch)

The pressure model MAE varied slightly across deployment (0.0145–0.0187 hPa), with a temporary increase during a frontal passage on 12–13 May. The model recovered as new data from that weather regime was accumulated — expected behaviour for a continuously retrained model.

Parts

15
QtyValueFootprintReferences
410KResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR2, R3, R5, R6
210pFCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1, C2
1100KResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1
1150Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR4
1C_PolarizedCapacitor_SMD:CP_Elec_3x5.3C3
1ESP32_NODEMCUESP32_NODEMCU:MODULE_ESP32_NODEMCUU1
1GP2Y_PINOUTConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ6
1MS5611_PINOUTConnector_PinHeader_2.54mm:PinHeader_1x07_P2.54mm_VerticalJ4
1RAINFALL_SENSORConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ1
1SHT21_PINOUTConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1WIND_SENSORConnector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ2

Similar boards

  • 2 layers19 × 76 mmSub, the printed circuit board in 3D

    Sub

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    15 parts3kApache-2.0
  • 2 layers26.7 × 62.2 mmDeniseadapter, the printed circuit board in 3D

    Deniseadapter

    hoglet67/RGBtoHDMI

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

    15 parts1kGPL-3.0
  • 2 layers100 × 44 mmVideoslot, the printed circuit board in 3D

    Videoslot

    mntmn/amiga2000-gfxcard

    MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog

    15 parts1k
  • 2 layers91 × 51 mmBusinessCard, the printed circuit board in 3D

    BusinessCard

    hackclub/OnBoard

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

    15 parts915
  • 2 layers24.3 × 57.9 mmFlosspods pro flex, the printed circuit board in 3D

    Flosspods pro flex

    kenp-io/not-for-airpods-repairs

    The content of this repository is licensed under the WTFPL License. Please have a close look at the terms before using this material.

    15 parts609WTFPL
  • 2 layers20.3 × 15.2 mmL0 Load, the printed circuit board in 3D

    L0 Load

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    15 parts546MIT
  • 2 layers68 × 50 mmEleLab v2 PowerFeed, the printed circuit board in 3D

    EleLab v2 PowerFeed

    Chrismettal/EleLab_v2

    Cheap DIY lab system for hobbyists and the tinkering folk

    15 parts531GPL-3.0
  • 2 layers50.8 × 35.6 mmInterface, the printed circuit board in 3D

    Interface

    harbaum/I2C-Tiny-USB

    Cheap and simple I²C to USB interface

    15 parts454

Questions

How big is the Meteo station PCB?

It measures 38.8 × 67 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Meteo station use?

15 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 Meteo station KiCad files?

From the ionutz04/REST-API_Meteo_Station repository on GitHub, at the commit this page was made from: the board is meteo_station/meteo_station.kicad_pcb and its schematic meteo_station/meteo_station.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Meteo station design in my own project?

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