Skip to the content
PCBKitNew board
2 layers44.9 × 44.9 mmWindSensorATMEGA328 PCB, the printed circuit board in 3D

WindSensorATMEGA328 PCB

curiouselectric/WindSensor2

A DIY interface circuit for anemometers and wind vanes

Size
44.9 × 44.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
42
Nets
37
Pads
145
Tracks, vias
470, 34
Pours
2
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
16 Jul 2021
Updated
5 Nov 2026

Overview

WindSensorATMEGA328 PCB is an open-source printed circuit board by curiouselectric, from the curiouselectric/WindSensor repository on GitHub. It is a 2-layer board of 44.9 × 44.9 mm with 42 parts on 37 nets, routed with 470 tracks and 34 vias.

It is built around the ATMEGA328P-AU. Its parts include 12 resistors, 11 capacitors, 9 connectors, 4 diodes and 3 ICs. It belongs with the interfaces and adapters boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

WindSensor Overview

A DIY Wind sensor interface board.

This connects to various anemometers and wind vanes and provides a serial interface for averaged data from the pulses.

The problem with measuring wind anemometers and wind vane is that they constantly need to be checked. You need to know at all times when pulses have come in and which direction the wind vane is facing. This requires a bit of microcontroller time and processing. This unit is designed to solve that. Wire up your vane and anemometer. Power the unit up. Then it will save the averaged data for you. You can then get hold of the data through serial requests and process as you need.

Overview

I wrote this to interface to an ESP32 data logger, which sleeps most of the time. It wakes up, talks to the wind sensor, gets the data it needs, then goes back to sleep, knowing the wind sensor is always monitoring.

It was designed as a relatively simple interface to remove the need for monitoring pulses and averaging them.

Wind Speed Measurements

The anemometer can either be a pulse output, NPN output or hall-effect output. The unit reads digital pulses, with circuitry on the unit converting the hall effect output to pulses. (Note: This unit cannot read 0-5V or analog output sensors).

The unit stores average wind speeds for 1 second, 10 second, 1 min, 10 min and 1 hour values. It also records the maximum and minimum wind speed.

The unit converts the pulses into a real wind speed using a y=mx+c linear conversion, where y is the wind speed and c is the number of pulses. m and c are stored in EEPROM and have default values of m=1 and c=0. These are floats and can be changed as required through the serial interface. Any updated values are stored in EEPROM. If the pulses are zero then the output is also zero (no matter what the y=mc+c function is). This stops a reading of 'c' when the pulse data is zero.

Wind Vane Measurements

The wind vane input is analog.

This can read either resistive wiper vanes or stepped resistive vanes.

The stepped rsistive vanes have magnet reed switches which switch in and out different resistances. The resistance then tells us the direction. A pull up reistor is required in these situations.

The wind vane input can be 'trained'. So put the unit into vane training mode via the serial interface. This will run through N, NE, E, SE, S, SW, W, NW and you can hold the unit in the correct direction position and press the switch to store that data to memory. Once trained then the unit creates a buffer zone around each of the values and within the zone then the unit will record the correct direction.

Wind direction is slightly difficult to measure, as you cannot directly average the analog value (because of the potential rollover point from 360 degrees to 0 degrees point where the analog pin value rolls around from 1024 back to 0 - this means an average of a unit pointing just off north (i.e. one reading of 0 and one reading of 360) will give an average of (360+0)/2 = 180, which is south and totally wrong!). The code here creates 'bands', along with a 'rollover' band so that (for example) 900 to 1024 and 0 to 36 will be linked to North, so that the roll over point is handled as best as possible.

This unit will record the number of seconds the vane has been pointing in a certain direction. This means a 'wind rose' can relatively easily be created. This is stored and updated until it is directly reset. The unit will also return the instantaneous direction, if that is needed.

There are two mode of operation, depending upon your use case (please see the firmware for more detailled information about the available serial commands):

Response Mode

In this mode then the unit responds to serial requests made. You ask the sensor for data and this is returned. It never sends anything unless asked.

Response

Broadcast Mode

In this mode then the unit regularly sends data via the serial connunication. It will send the averaged data for (0) 1 second, (1) 10 second, (2) 1 min, (3) 10 min and (4) 1 hour averaged data. If this is set to (5) then the unit does not send any data. The send mdoe is stored in EEPROM, so it will start sending data again even if power is lost.

Broadcast

Boradcast mode works well if the logger is always listening and you only have one sensor in range. If more than one sensor is in range then the data will clash and potentially cause issues, in which case use Response mode.

The two modes work together - you can have the unit sending regular data and also responding to requests.

It runs on an ATMega328 running at 8MHz (external crystal) with selectable baud serial (up to 57600). It comes pre-programmed, but code can be uploaded via the Arduino IDE, using the MiniCore board add-on. See firmware for more details.

Hardware

The PCB was designed in KiCAD and is available here. A small PCB has been designed. There is one reset switch, one user input switch and one LED output.

Both inputs for the wind vane and anemometer are buffered with an op-amp and also have 5.1V zener protection. The anemometer input compares the input with a low voltage level to create a pulse from a hall-effect (which output a sine-wave like signal). This also works as a pull-down pulse sensor, which works with NPN and switch output anemometers.

Anemometers Tested:

Anemometer NameLinkTypem Valuec Value
Vector Insrutments NRG #40Chttps://www.nrgsystems.com/products/met-sensors/detail/40c-anemometerHall-effect0.765 for m/s0.35 for m/s
Maplin Anemometer (low cost)https://www.ebay.co.uk/itm/274338314354Reed-switch pulse0.7 for m/s0 for m/s
Curios Electric PR-3000-FS-NPNhttps://www.curiouselectric.co.uk/collections/featured/products/anemometer-for-wind-speed-measurementsNPN Pulse0.0875 for m/s0 for m/s
Pro-D Anemometer/Vane combinationhttps://cdn.shopify.com/s/files/1/0115/9192/files/Pro-D_Anemometer_Specs_v2.docx.pdfMagnetic pulse1.006 for m/s0 for m/s

Wind Vanes Tested:

Wind Vane NameLinkType
Maplin VaneNo LinkSwitched resistive
Pro-D Anemometer/Vane combinationhttps://cdn.shopify.com/s/files/1/0115/9192/files/Pro-D_Anemometer_Specs_v2.docx.pdf20k resistive
Curios Electric ZTS-3000-TR-FSJT-NPNhttps://www.curiouselectric.co.uk/collections/featured/products/wind-vane-for-wind-direction-measurements0-3.3V output

Board ID Number

Each unit can have a unique ID (using a solder pad for 0-7 values), so multiple units can be added to a serial bus, if needed. The defalt is 0.

Firmware

This uses an ATMega328 running at 8MHz with 3.3v or 5V supply.

The firmware used in this project is available in this github repository:

https://github.com/curiouselectric/SensorInterfaceFirmware

Please follow the information within that repository for the serial commands and firmware information.

Overview of Connections

Connections

Parts

42
QtyValueFootprintReferences
7100nREInnovationFootprint:SM_C_0805C1, C3, C4, C5, C7, C8, C11
510kREInnovationFootprint:SM0805R1, R5, R10, R11, R12
44k7REInnovationFootprint:SM0805R2, R3, R6, R7
222pREInnovationFootprint:SM_C_0805C9, C10
23V3_ZenerREInnovationFootprint:SOT23_ZENERD1, D4
2TSV911xxLxREInnovationFootprint:SM_SOT-23-5U1, U2
1100kREInnovationFootprint:SM0805R9
1100uREInnovationFootprint:SM_6.3x7.7C6
122nREInnovationFootprint:SM_C_0805C2
1470REInnovationFootprint:SM0805R4
1470kREInnovationFootprint:SM0805R8
15V1_ZenerREInnovationFootprint:SOT23_ZENERD3
18MHz_XTALREInnovationFootprint:SM-crystal-HC49UPY1
1ATmega328P-AUREInnovationFootprint:TQFP32-08U4
1I2CREInnovationFootprint:SIL-4_Grove_Not_LabelledP10
1IDREInnovationFootprint:SM_6pad_3W_SOLDERP3
1ISPREInnovationFootprint:ISP_3x2P4
1LED0REInnovationFootprint:SM0805_LEDD2
1LOGO2CuriousElectric3:TCEC_Words_13mmP5
1PCBREInnovationFootprint:PCB_45_45_Cut_Out_Solar_Sensor_2P6
1PROGREInnovationFootprint:TH_6x1_FTDIP9
1RSTREInnovationFootprint:SMD_SW_6x3_5SW2
1SERIALREInnovationFootprint:SIL-4_Grove_SCREWP2
1SWAREInnovationFootprint:SMD_SW_6x3_5SW1
1VANEREInnovationFootprint:SIL-3_screw_terminalP8
1WIND_AREInnovationFootprint:SIL-3_screw_terminalP11

Questions

How big is the WindSensorATMEGA328 PCB PCB?

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

What parts does the WindSensorATMEGA328 PCB use?

42 parts, built around the ATMEGA328P-AU. 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 WindSensorATMEGA328 PCB KiCad files?

From the curiouselectric/WindSensor repository on GitHub, at the commit this page was made from: the board is Wind Sensor PCB/WindSensorATMEGA328_PCB.kicad_pcb and its schematic Wind Sensor PCB/Hall_to_Freq.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

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

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

Similar boards

  • 2 layers50.5 × 128.5 mmOpenThereminV45, the printed circuit board in 3D

    OpenThereminV45

    GaudiLabs/OpenThereminV4

    Open Source Theremin Instrument

    107 parts249GPL-3.0
  • 2 layers152 × 88 mmRFBitBangSMT, the printed circuit board in 3D

    RFBitBangSMT

    profdc9/RFBitBanger

    A QRP digital transceiver created from readily available parts for off-the-grid maintenance

    271 parts222
  • 2 layers50.2 × 31.2 mmMCU Datalogger, the printed circuit board in 3D

    MCU Datalogger

    futureshocked/KLP4e_MCU-Datalogger

    This is the repository for the "MCU Datalogger" project.

    31 parts138MIT
  • 2 layers34 × 46 mmNfcemu, the printed circuit board in 3D

    Nfcemu

    solosky/nfc-emu

    NFC模拟器

    58 parts117Apache-2.0
  • 2 layers73 × 94 mmSportiduino base, the printed circuit board in 3D

    Sportiduino base

    sportiduino/sportiduino

    Electronic timing system for orienteering and similar outdoor sports events on Arduino

    119 parts78GPL-3.0
  • 2 layers58.9 × 44.2 mmOpenPSX2AmigaPadAdapter, the printed circuit board in 3D

    OpenPSX2AmigaPadAdapter

    SukkoPera/OpenPSX2AmigaPadAdapter

    Playstation to Commodore Amiga/CD32 Controller Adapter

    43 parts69
  • 2 layers60 × 50 mmVx8 gps prototype v2.0, the printed circuit board in 3D

    Vx8 gps prototype v2.0

    4x1md/vx8_gps

    DIY GPS module for Yaesu VX-8DR/VX-8DE handheld transceiver.

    56 parts66MIT