Skip to the content
2 layers12 × 18.6 mmWeather, the printed circuit board in 3D

An STM32-based enclosure that keeps a camera lens usable in rain and frost. A vision model on the host PC (or, with the TFLite Micro path, on the MCU) detects water on the lens and triggers a servo wiper; an on-die…

Size
12 × 18.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
11
Nets
63
Pads
112
Tracks, vias
0, 0
Pours
2
Routed
Not yet
KiCad
KiCad 8.0 (file 20240108)
Created
11 Aug 2025
Updated
29 Sep 2026

Overview

Weather is an open-source printed circuit board by dbhan08, from the dbhan08/Weather-Resistant-Camera repository on GitHub. It is a 2-layer board of 12 × 18.6 mm with 11 parts on 63 nets.

It is built around the MBR0520. Its parts include 6 connectors, 3 ICs, 1 capacitor and 1 diode. It belongs with the STM32 boards of this library.

Main components

1

README

README.md

Weather-Resistant Camera

An STM32-based enclosure that keeps a camera lens usable in rain and frost. A vision model on the host PC (or, with the TFLite Micro path, on the MCU) detects water on the lens and triggers a servo wiper; an on-die thermistor turns a heating pad on below a threshold. UIUC ECE 445 senior design, Spring 2025.

Run it

bash
# firmware: open Final.ioc in STM32CubeIDE, build main.c, flash the Nucleo-F4
# vision (original OpenCV heuristic):
python final_code.py               # webcam -> HSV mask -> % coverage -> "START" over serial
# vision (CNN, see CNN/README.md):
python -m lens_soiling.infer runs/procedural/soilnet.pt --camera 1 --port COM3

How it works

  • Firmware (main.c). TIM2 PWM drives the servo; Set_Servo_Angle maps 0–180° to a 210–1050 tick pulse. ADC1 reads the internal temperature sensor with the factory TS_CAL1/2 calibration, and drives a MOSFET on PA5 to switch the heater. USART2 at 115200 baud accepts 5-byte commands (START, STOPP) from the PC; START sweeps the wiper 60→115→60°.
  • Vision, heuristic (final_code.py). HSV threshold on low saturation and high value, morphological close, contours, enclosing circles, then percent of masked pixels. Over 5 % sends START.
  • Vision, CNN (CNN/). Tile-level classifier: a ported pretrained raindrop CNN distilled into a ~20 k-parameter int8 model for TFLite Micro, plus a tested PyTorch fallback trained on synthetic drops and frost.
  • Hardware. KiCad PCB (PCB Design*/), 5 V and 3.3 V regulators, MOSFET heater switch, logic-level shifter, servo header. Demo ran on the Nucleo dev board after the second PCB's MCU was damaged during hand soldering.

Layout

text
main.c, Final.ioc          STM32 firmware and CubeMX project
final_code.py              OpenCV heuristic + serial trigger (PC)
python_to_stm_comm.py      serial protocol smoke test
CNN/                       CNN detection: pretrained port + from-scratch pipeline
Servo Motor code/, Temperature sensor code/   subsystem test firmware
PCB Design*/               KiCad
Lab Notebooks/             per-member design logs

Stack

C (STM32 HAL), Python, OpenCV, PyTorch, TensorFlow Lite Micro, KiCad.

Parts

11
QtyValueFootprintReferences
11 uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC1
13.3V_RegulatorPackage_TO_SOT_SMD:SOT-23-5_HandSolderingU2
15V_RegulatorPackage_TO_SOT_SMD:TO-252-2U3
1Computer ReceiverBuzzer_Beeper:CONN_USB-AP-S-RA-SMT_ADMJ3
1Conn_ARM_JTAG_SWD_10Connector_PinHeader_1.27mm:PinHeader_2x05_P1.27mm_VerticalJ1
1HeaterConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ6
1MBR0520Diode_SMD:D_SOD-123D1
1MotorConnector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ4
1STM32F401RBTxPackage_QFP:LQFP-64_10x10mm_P0.5mmU1
1Temperature SensorConnector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ5
1VinConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ2

More from dbhan08/Weather-Resistant-Camera

1
  • 2 layersWeather, the printed circuit board in 3D

    Weather

    dbhan08/Weather-Resistant-Camera

    An STM32-based enclosure that keeps a camera lens usable in rain and frost. A vision model on the host PC (or, with the TFLite Micro path, on the MCU) detects water on the lens and triggers a servo wiper; an on-die…

    44 parts

Similar boards

  • 2 layers160 × 90 mmPower Integrations interface, the printed circuit board in 3D

    Power Integrations interface

    paltatech/VESC-controller

    Made open source with KiCAD, an open source EDA tool.

    1,126 parts356
  • 2 layers155.5 × 130 mmEinkpicframe, the printed circuit board in 3D

    Einkpicframe

    Spritetm/picframe_colepd

    A WiFi picture frame allowing for remote photo uploads, using an ESP32-C3 and a 5.6" color E-ink display

    60 parts97
  • 2 layers18 × 14.4 mmBauble pcb, the printed circuit board in 3D

    Bauble pcb

    Spritetm/esp32c3-doom-bauble

    Christmas tree bauble with an ESP32C3 running Doom

    19 parts89
  • 4 layers129 × 104.6 mmPC-1100X, the printed circuit board in 3D

    PC-1100X

    zscircuits/zs1100a

    All files hardware and software related to the zs1100a

    528 parts76
  • 4 layers198 × 161 mmGPDI ULX3S panel, the printed circuit board in 3D

    GPDI ULX3S panel

    goran-mahovlic/ulx3s-extensions

    PMOD boards for ULX3S

    1,070 parts49
  • 2 layers230 × 116 mmCvocd banana, the printed circuit board in 3D

    Cvocd banana

    hotchk155/cvocd.a

    176 parts38
  • 2 layers50 × 37.3 mmICE40Module, the printed circuit board in 3D

    ICE40Module

    riktw/HUB75E_ICE40

    SpinalHDL code to drive a 64*64 pixel HUB75E module with an ICE40

    57 parts33GPL-3.0
  • 4 layers90 × 80 mmLaser Driver v3, the printed circuit board in 3D

    Laser Driver v3

    Laser4DIY/Laser-Driver-v2

    MCU-based multipurpose Laser Diode driver

    102 parts23

Questions

How big is the Weather PCB?

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

What parts does the Weather use?

11 parts, built around the MBR0520. 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 Weather KiCad files?

From the dbhan08/Weather-Resistant-Camera repository on GitHub, at the commit this page was made from: the board is PCB Design/PCB Design v1.4/Weather.kicad_pcb and its schematic PCB Design v1.0/WRCPCBI1.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Weather design in my own project?

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