Skip to the content
2 layers24 × 19 mmMoisture Sensor, the printed circuit board in 3D

Button-activated, battery-powered soil moisture meter with a 0.96" OLED display.

Size
24 × 19 mm
Copper layers
2
Thickness
1.6 mm
Parts
17
Nets
18
Pads
55
Tracks, vias
189, 19
Pours
2
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
26 Oct 2026
Updated
27 Oct 2026

Overview

Moisture Sensor is an open-source printed circuit board by MohamadDasuki, from the MohamadDasuki/Soil_Moisture_Sensor repository on GitHub. It is a 2-layer board of 24 × 19 mm with 17 parts on 18 nets, routed with 189 tracks and 19 vias.

It is built around the CC0603KRX7R9BB104, CL21A106KAYNNNE and CL21A226MAQNNNE, with the AO3401A among its other parts. Its parts include 6 capacitors, 4 connectors, 3 resistors, 2 ICs and 1 transistor. It belongs with the sensors and measurement boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

4

README

README.md

Soil Moisture Sensor

Button-activated, battery-powered soil moisture meter with a 0.96" OLED display.

Press the button -> MCU wakes -> load switch powers the OLED and sensor -> moisture reading is shown for 15 s -> everything powers down (<1 uA standby).

PCB top

Hardware

RefFunctionPart
U1MCUMicrochip ATtiny1614-SSNR (SOIC-14)
J5Battery3xAAA holder, leads soldered to J5 pads (+ = pin 1; direct, 3.0-4.8 V)
Q1Reverse-polarity protectionAOS AO3401A P-FET
U2Peripheral power switchTI TPS22917DBVR load switch
J2DisplayELEGOO 0.96" SSD1306 I2C OLED (0x3C) - 2.54 mm pads, GND-VCC-SCL-SDA
J3SensorDIYmall capacitive soil sensor v1.2 (analog) - 2.54 mm pads, GND-VCC-AOUT
SW1ButtonTwidec PBS-110 7 mm panel-mount momentary, leads soldered to 2 pads
J1ProgrammingUPDI through-hole pads on the board edge (UPDI-GND-VCC)

See BOM.csv for the full parts list and Moisture_Sensor.pdf for the schematic.

PCB (rev C)

  • 24 x 19 mm, 2-layer, 1.6 mm, all SMD on top, GND pour both sides.
  • Top edge: OLED (G V C D) and sensor (G V A) pads. Bottom edge: UPDI (U G V) and button pads.
  • Solder the supplied Dupont/PH cables directly to the pads (or fit 2.54 mm headers).
  • No mounting holes: hold the board with a ledge/snap clips. Moisture_Sensor.step is provided for enclosure design.

Programming

UPDI via a 3.3 V USB-serial adapter with a 4.7k resistor TX->UPDI, RX->UPDI ("SerialUPDI"), or an Adafruit UPDI Friend. Arduino IDE + megaTinyCore, board ATtiny1614, programmer SerialUPDI. Remove batteries when powering from the programmer.

Pin map (ATtiny1614)

SignalPortPin
LOAD_ENPA42
AOUT (sensor, ADC)PA53
BTN (wake)PA64
SDAPB18
SCLPB09
UPDIPA010

Firmware

firmware/MoistureMeter/ contains an Arduino sketch for megaTinyCore. It uses 4.7 KB of flash and 75 B of RAM, and needs no external libraries. The SSD1306 driver in oled.h is buffer-less (text only).

Operation

  • Idle: the MCU is in power-down and the load switch is off (well under 1 µA).
  • Press the button: the OLED and sensor power up and the battery voltage is checked. The display then shows a live moisture % reading, refreshed every second, with a status line (DRY / OK / WET) and a bar graph. After 15 s it powers everything off.
  • Short press while on: restarts the 15 s timer.
  • Hold 3 s while on: starts calibration. Follow the prompts: sensor in air, press; sensor in water up to the line, press. The values are saved to EEPROM.
  • Battery below 3.1 V: shows "BATTERY EMPTY" instead of a reading. Below 3.4 V, the header shows "LOW BAT".
  • Battery voltage: measured by reading the internal 1.1 V reference against VDD, so no divider is needed. The sensor is read ratiometrically (ADC reference = VDD), so battery droop cancels out.

Build and flash

  • Arduino IDE: add the board manager URL http://drazzy.com/package_drazzy.com_index.json and install megaTinyCore.
  • Tools settings: Chip ATtiny1614, Clock 5 MHz internal, BOD Disabled/Disabled, millis timer default (not RTC), Programmer SerialUPDI.
  • Run Burn Bootloader once (this only sets fuses), then Upload Using Programmer.
  • With arduino-cli, use the FQBN megaTinyCore:megaavr:atxy4:chip=1614,clock=5internal,bodmode=disabled.

Calibration defaults are typical v1.2 values (dry ≈ 600/1023, wet ≈ 280/1023). Calibrate once per sensor for accurate readings.

Ordering (JLCPCB)

The fab/ folder holds everything needed to order the board:

FileUpload as
Moisture_Sensor_gerbers_JLCPCB.zipGerber file (2 layers, 24 × 19 mm, 1.6 mm FR-4)
BOM_JLCPCB.csvPCB Assembly → BOM (LCSC part numbers)
CPL_JLCPCB.csvPCB Assembly → CPL (pick and place)
  • Assembly: top side only, SMD parts only. J1, J2, J3, J5 and SW1 are hand-soldered wire pads and aren't placed.
  • Before confirming, check pin 1 of U1, U2 and Q1 in JLCPCB's placement preview. The CPL applies the usual rotation offsets for SOT-23 and SOIC parts.
  • Regenerating:
    • CPL and JLCPCB BOM: run tools/gen_cpl.py with KiCad's Python.
    • Gerbers and drill files: export with kicad-cli pcb export gerbers (subtract soldermask, no X2) and kicad-cli pcb export drill (Excellon, mm, separate PTH/NPTH).

Enclosure

Inside

ExplodedBattery door
FrontLid underside

Outer size 42 × 111 × 18.4 mm. Generated by tools/gen_enclosure.py, which is fully parametric (run it with FreeCAD's freecadcmd.exe). The script also checks for interference against the real PCB STEP model and against dummy models of the OLED, the AAA cells and the button. tools/render_enclosure.py (run with freecad.exe) regenerates the images.

PartFilePrint orientation
Body (tub)enclosure/body.stldisplay face down, as exported
Lidenclosure/lid.stlouter face down, as exported
Battery doorenclosure/door.stlouter face down, as exported

Printing: no supports are needed. The button hole is a teardrop, the display window has a 45° chamfer, the clip lips overhang by 0.5 mm or less, and the door rails are 45° dovetails. Use 0.2 mm layers, 3–4 perimeters, and PETG (recommended for the snap clips). PLA works, but the clips run at about 3 % strain.

Features

  • Display: a window in the front face. The module drops into a pocket with corner ledges, and the lid has 4 posts that clamp the module's corners.
  • PCB: held by 3 flexible snap clips plus 1 rigid hook, on 3 mm standoffs. To insert it, tilt the board and slide its J2/J3 edge (toward the display) under the rigid hook, then press the other edge down until the clips snap.
  • Button: a 7 mm hole in the top end wall. The nut tightens from inside.
  • Sensor cable: a U-notch in the side wall at the lid seam, so the cable is laid in rather than threaded. Weave the cable around the 3 posts for strain relief.
  • Batteries: 3×AAA side by side behind a sliding dovetail door. To open it, lift the flex tab at the finger grooves and slide the door out toward the bottom end.
    • Contacts are generic AAA plates/springs in 0.8 mm slots: a single plate for 10 mm-wide contacts, a double slot for 21 mm-wide bridging contacts.
    • Top fence: single (+, cell 1, left) and double (cells 2/3).
    • Bottom fence: double (cells 1/2) and single (−, cell 3).
    • Solder the + and − wires to the J5 pads (B+ / B− on the back silkscreen).
  • Lid: snap-fit with 4 tabs; no screws. Open it only for programming (the UPDI pads are reachable with the lid off).

Verify before printing (all are parameters at the top of gen_enclosure.py):

  • OLED glass and viewing-area offsets (GLASS_*, VIEW_*).
  • Button body length (the space behind the wall is about 18 mm).
  • Contact plate dimensions.
  • Rebuild after any change.

Notes

  • Sensor: bypass its onboard 662K LDO (the NE555 is otherwise starved at 3.3 V). Its output then scales with supply, so read it ratiometrically (ADC reference = VDD). Calibrate dry/wet values in firmware.
  • OLED runs from VSW through its own LDO (3.3-5 V); no mod needed.
  • Firmware: 10 MHz is fine (>2.7 V); set I2C pins high-Z before switching off VSW; low-battery cutoff ~3.3 V.
  • tools/gen_sch.py regenerates the schematic and tools/gen_pcb.py --route the PCB (KiCad's bundled Python; routing needs Freerouting + Java 25).

Parts

17
QtyValueFootprintReferences
3100nFCapacitor_SMD:C_0603_1608MetricC2, C5, C6
210kResistor_SMD:R_0603_1608MetricR1, R2
10RResistor_SMD:R_0603_1608MetricR3
110uF 25V X5RCapacitor_SMD:C_0805_2012MetricC1
11nFCapacitor_SMD:C_0603_1608MetricC3
122uF 25V X5RCapacitor_SMD:C_0805_2012MetricC4
1AO3401APackage_TO_SOT_SMD:SOT-23Q1
1ATtiny1614-SSNRPackage_SO:SOIC-14_3.9x8.7mm_P1.27mmU1
1BATTERY 3xAAAConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ5
1OLED SSD1306 0.96inConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ2
1READ BUTTONConnector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalSW1
1SOIL SENSOR v1.2Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ3
1TPS22917DBVRPackage_TO_SOT_SMD:SOT-23-6U2
1UPDIConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1

Similar boards

  • 2 layers45 × 100 mmWalkiepcb, the printed circuit board in 3D

    Walkiepcb

    houseofthe051010/ESP32-Walkie-Talkie-V2

    This ESP32 Walkie Talkie is redesigned with a SX1262 radio, a PCB, and a full case redesign.

    93 parts1
  • 2 layers70 × 45 mmBackpack defender, the printed circuit board in 3D

    Backpack defender

    donaldbell/productspeedrun

    Let's see how quickly we can get a product idea off the ground.

    55 parts
  • 4 layers65 × 56 mmSensor HAT, the printed circuit board in 3D

    Sensor HAT

    Eniemooo/Sensor-HAT

    Open-hardware indoor air sensor (CO2, VOC/NOx, T/RH, light, sound): HAT for Raspberry Pi or standalone with Seeed XIAO + ESPHome. KiCad 10.

    112 parts
  • 4 layers100 × 90 mmOpentouch s3, the printed circuit board in 3D

    Opentouch s3

    JoeMighty/opentouch-s3

    A modern remake of the Bare Conductive Touch Board: 12 capacitive touch electrodes, MP3/WAV/MIDI audio, and now WiFi, Bluetooth LE, USB-C, a proper LiPo power path, a fuel gauge, line-in, MIDI out, Qwiic and an RGB LED.

    185 parts
  • 4 layers41.2 × 49.9 mmEdu V2.2, the printed circuit board in 3D

    Edu V2.2

    LivioScherrer/MinTurtle

    75 parts
  • 4 layers88.1 × 59.4 mmChromapi motherboard v1, the printed circuit board in 3D

    Chromapi motherboard v1

    Mowibox/chromapi_motherboard

    Raspberry Pi control HAT dedicated to the quadruped robot Chromapi.

    139 parts2Apache-2.0
  • 4 layers101 × 51.5 mmQuack core, the printed circuit board in 3D

    Quack core

    HeyPCB/quack-core

    Brain board for the Open Duck Mini: Pi Zero 2W carrier, 14-servo STS bus, fused 2S power path in stitched copper zones (15-18 A battery side), USB-C charging with balancing, IMU.

    138 parts1CERN-OHL-S-2.0

Questions

How big is the Moisture Sensor PCB?

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

What parts does the Moisture Sensor use?

17 parts, built around the CC0603KRX7R9BB104, CL21A106KAYNNNE, CL21A226MAQNNNE and AO3401A. 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 Moisture Sensor KiCad files?

From the MohamadDasuki/Soil_Moisture_Sensor repository on GitHub, at the commit this page was made from: the board is Moisture_Sensor.kicad_pcb and its schematic Moisture_Sensor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Moisture Sensor design in my own project?

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