Skip to the content
2 layers67 × 92 mmWindmeter modbus interface, the printed circuit board in 3D

Windmeter modbus interface

pe1mew/windmeters-modbus-interface2

Universal interface for cup-anemo- and wind-directon- sensor to modbus

Size
67 × 92 mm
Copper layers
2
Thickness
1.6 mm
Parts
30
Nets
26
Pads
104
Tracks, vias
258, 113
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
22 Jun 2026
Updated
8 Aug 2026

Overview

Windmeter modbus interface is an open-source printed circuit board by pe1mew, from the pe1mew/windmeters-modbus-interface repository on GitHub. It is a 2-layer board of 67 × 92 mm with 30 parts on 26 nets, routed with 258 tracks and 113 vias.

It is built around the CH32V003J4M6, MAX3485ED and DB207. Its parts include 7 resistors, 6 connectors, 5 capacitors, 2 ICs and 2 diodes. It belongs with the interfaces and adapters and sensors and measurement boards and the RISC-V boards of this library.

Main components

3

README

README.md

Windmeters Modbus Interface

A CH32V003-based interface board that bridges classic analog wind sensors — a cup anemometer (reed-relay pulses) and a wind-vane potentiometer (0–360°) — onto Modbus RTU over RS-485, powered by 24 V passive PoE and designed for daisy-chained field buses.

One PCB serves both sensor types; the firmware build selects the variant. Each variant responds at its own Modbus address, selected by a solder jumper:

VariantJumper openJumper bridged
Wind speed (wind_speed)3035
Wind direction (wind_direction)3136
Both, one slave (wind_combined)3237

The wind_combined build serves both sensors through a single Modbus address; its register map carries speed and direction at their own register addresses, with the direction raw-ADC diagnostic at 30013 (30005 holds the speed pulse count).

Project status (2026-07)

AreaState
Requirementsdesign/TDS.md v0.9 — 69 active requirements (incl. FR-S39 persistence, FR-S40 runtime calibration) + §4 as-built hardware from the KiCad PCB, hardened by multi-agent audits + verification passes
DriversPulse counting, ADC/circular-mean, Modbus RTU — all HIL-verified on silicon (design/driverDevelopment.md)
Product firmwareIntegration stages A–F complete; TDS-functionally complete on all three variants (speed, direction, combined), acceptance suite green (design/integrationPlan.md)
Hardware/HILKiCad schematic/PCB in design; §9.1 MAX3485-rig HIL complete on all three variants; real-PCB rows (§9.2) pending
ReleaseFirmware version 1 not yet tagged (software/firmware/RELEASES.md)

Hardware

  • MCU: WCH CH32V003J4M6 (RISC-V, SOP-8, 16 KB flash / 2 KB RAM) — the 8-pin package drives the whole design: single-wire UART discipline, remap tricks, and a zero-interrupt firmware architecture (design/softwareArchitecture.md).
  • RS-485: MAX3485; DI+RO tied to PD6, DE+R̄Ē tied to PC2 with a 10 k pull-down (keeps the bus safe during reset/flashing); 120 Ω terminator behind a solder jumper; A/B fail-safe bias; SM712 TVS.
  • Power: 24 V passive PoE on the spare pairs (4/5 = +, 7/8 = −) → DB207 bridge (polarity protection only) → HLK-K7803 buck → 3.3 V.
  • Connectors: 2× RJ45 for the daisy-chained bus, two RJ14 sensor jacks (anemometer + wind direction), 3-pin header for the WCH-LinkE programmer (SWIO on PD1).

Modbus register map (summary)

12 input registers (FC04) and 6 holding registers (FC03/06/16); registers of an absent sensor read 0, and the combined build adds a 13th input register (30013, direction raw ADC). Highlights: instantaneous and averaged values, status bits, identification (build + firmware version), uptime, CRC/served counters, gust, seconds-since-last-pulse. 6 holding registers: direction offset, measurement window, averaging window, low-speed cut-off, and the anemometer calibration (factor C + pulses-per-rotation, FR-S40 — so one image serves any anemometer, set over Modbus). All persisted in flash across reset/power-loss (FR-S39); the §2.8 defaults apply only on first boot / erased store. The authoritative map with ranges, defaults, and requirement IDs is design/TDS.md §2.7/§2.8.

Repository layout

PathContents
design/The design-document chain (index in design/README.md): scratchBook → TDS → softwareArchitecture (+ UML diagrams in design/diagrams/) → driverDevelopment → integrationPlan
hardware/KiCad/Schematic + PCB (KiCad); symbol libraries as git submodules
hardware/Documentation/Component datasheets (HLK-K78xx, DB20x, Kradex enclosure, …)
software/firmware/Product firmware (PlatformIO + ch32v003fun), three build envs (speed / direction / combined) + _test variants
software/drivers/Standalone driver projects with HIL test shells (the verified libraries the product references in place)
software/hil/Scripted hardware-in-the-loop harness: Saleae Logic 2 (MCP) + ADALM2000 (libm2k) + acceptance/ pytest suite; consolidated testReport.md
DoxyfileDoxygen config — builds a single site (design docs + API reference) with this README as the landing page
documentation/Chip pinout and project reference images

Clone with submodules:

sh
git clone --recurse-submodules https://github.com/pe1mew/windmeters-modbus-interface.git

Building and flashing

Requires PlatformIO and a WCH-LinkE on SWIO.

sh
cd software/firmware
pio run -e wind_speed              # or wind_direction, or wind_combined
pio run -e wind_speed -t upload    # flash via WCH-LinkE

Resource ceilings (14 336 B flash / 1 792 B RAM, NFR-RES01) are enforced as hard build gates. *_test environments add bench-only hooks — never release those binaries. The firmware version byte lives in src/version.h; the release process is documented in RELEASES.md.

Testing

  • Host tests (no hardware): the circular-mean math is exhaustively verified in Python — python software/drivers/common/circmean/test_circmean.py.

  • Acceptance suite (bench: Saleae Logic 2 with its MCP server, ADALM2000, WCH-LinkE, TTL Modbus rig):

    sh
    cd software/hil/acceptance
    ..\.venv-m2k\Scripts\python.exe -m pytest . --build speed

    One command per flashed variant; covers the register map, protocol vectors, measurement services, averaging engine, version chain, and build gates. See software/hil/README.md for instrument setup, wiring, and the bench-quirk catalogue.

  • HIL test report — software/hil/testReport.md consolidates every hardware-in-the-loop test (driver-phase, integration- stage, and MAX3485 transceiver rig) with its setup, expected result, and pass/fail verdict in one place.

Documentation

  • Design record — design/README.md indexes the document chain (requirements → architecture → drivers → integration) and the UML diagrams.

  • API + design site — the firmware headers/sources carry full Doxygen, and Doxyfile folds the design docs in as pages with this README as the landing page. Build the browsable HTML with:

    sh
    doxygen Doxyfile        # output in documentation/doxygen/html/index.html
  • Test evidence — software/hil/testReport.md is the consolidated hardware-in-the-loop test report.

Related repositories

License

Software is provided under a Source-Available Non-Commercial License; documentation and images under CC BY-NC-ND 4.0. See LICENSE and license.md. Third-party datasheets and KiCad library submodules remain under their owners' terms.

Author

Remko Welling (PE1MEW)

Parts

30
QtyValueFootprintReferences
4~Jumper:SolderJumper-3_P1.3mm_Bridged12_Pad1.0x1.5mm_NumberLabelsJP2, JP3, JP4, JP5
3100nCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1, C2, C5
310kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR4, R5, R7
220kResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR2, R3
2RJ14Connector_RJ:RJ14_Connfly_DS1133-S4_HorizontalJ4, J5
1100Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR6
1100uCapacitor_THT:CP_Radial_D8.0mm_P5.00mmC3
1120Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1
14u7Capacitor_THT:CP_Radial_D5.0mm_P2.50mmC4
1Address selectJumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mmJP6
1BZX84CxxPackage_TO_SOT_SMD:SOT-23D2
1CH32V003J4M6Package_SO:JEITA_SOIC-8_3.9x4.9mm_P1.27mmU1
1DB207my-KiCad-library:DB207-DIP-4B1
1LOGO_LogoRFSee_28x5-6mmmy-KiCad-library:LOGO_LogoRFSee_28x5-6mmG***
1MAX3485Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1MODBUS-P1my-KiCad-library:CONN_215877-1J1
1MODBUS-P2my-KiCad-library:CONN_215877-1J3
1ProgrammingConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2
1SM712_SOT23Package_TO_SOT_SMD:SOT-23D1
1enable term.Jumper:SolderJumper-2_P1.3mm_Open_Pad1.0x1.5mmJP1
1~my-KiCad-library:HLK-K7803-500R3P1

Similar boards

  • 2 layers80 × 80 mmWire encoder modbus interface, the printed circuit board in 3D

    Wire encoder modbus interface

    pe1mew/wire-encoder-modbus-interface

    A modbus interface for a resistor wire encoder and a WCH CH32V003J4M6

    36 parts
  • 2 layers213 × 65.1 mmSizif512, the printed circuit board in 3D

    Sizif512

    UzixLS/zx-sizif-512

    ZX Spectrum CPLD-based clone for rubber case

    214 parts195MIT
  • 2 layers100 × 83.4 mmMessystem, the printed circuit board in 3D

    Messystem

    do2mad/messsystem-1mhz

    Ein kleines Messgerät für den Reparaturplatz: Es überwacht sechs Gleichspannungen (0–30 V) und eine Wechselspannung (9 V) gleichzeitig und zeigt sie auf einem 20×4-LCD an.

    79 partsMIT
  • 2 layers50 × 50 mmINNER PCB, the printed circuit board in 3D

    INNER PCB

    KaiPereira/Alchemical-Cosmological-Badges

    These are alchemical-cosmological PCB hackathon badges I designed in a day for the Fallout hackathon in Shenzhen, China.

    73 parts12
  • 2 layers50.5 × 18 mmContinuity, the printed circuit board in 3D

    Continuity

    tvecera/ch32-projects

    A collection of example projects and experiments for CH32-series microcontrollers from WCH (Nanjing Qinheng Microelectronics).

    20 parts2MIT
  • 2 layers14.2 × 26 mmUsb auto reboot, the printed circuit board in 3D

    Usb auto reboot

    74th/usb-rebooter

    We would appreciate it if you would not sell them. 販売はしないでいただけるとありがたいです。

    11 parts1MIT

Questions

How big is the Windmeter modbus interface PCB?

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

What parts does the Windmeter modbus interface use?

30 parts, built around the CH32V003J4M6, MAX3485ED and DB207. 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 Windmeter modbus interface KiCad files?

From the pe1mew/windmeters-modbus-interface repository on GitHub, at the commit this page was made from: the board is hardware/KiCad/windmeter-modbus-interface.kicad_pcb and its schematic hardware/KiCad/windmeter-modbus-interface.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Windmeter modbus interface design in my own project?

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