Skip to the content
2 layersWeather, 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…

Copper layers
2
Thickness
1.6 mm
Parts
44
Nets
63
Pads
198
Tracks, vias
377, 35
Pours
1
Routed
Yes
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 with 44 parts on 63 nets, routed with 377 tracks and 35 vias.

It is built around the CD4007UBE and SP0503BAHTG. Its parts include 15 resistors, 11 capacitors, 8 connectors, 4 ICs and 1 diode. It belongs with the STM32 boards of this library.

Main components

2

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

44
QtyValueFootprintReferences
5100nCapacitor_SMD:C_0603_1608MetricC4, C6, C8, C9, C10
45.1kResistor_SMD:R_0603_1608MetricR12, R13, R14, R15
3100kResistor_SMD:R_0603_1608MetricR4, R5, R6
310kResistor_SMD:R_0603_1608MetricR1, R2, R3
21uCapacitor_SMD:C_0603_1608MetricC3, C7
220pCapacitor_SMD:C_0603_1608MetricC1, C2
222Resistor_SMD:R_0603_1608MetricR9, R10
11.5kResistor_SMD:R_0603_1608MetricR8
110nCapacitor_SMD:C_0603_1608MetricC5
11KResistor_SMD:R_0603_1608MetricR11
13.3V_RegulatorPackage_TO_SOT_SMD:SOT-23-5_HandSolderingU4
13V3TestPoint:TestPoint_Keystone_5000-5004_MiniatureTP2
14.7uCapacitor_SMD:C_0603_1608MetricC11
14K7Resistor_SMD:R_0603_1608MetricR7
15V_RegulatorPackage_TO_SOT_SMD:TO-252-2U3
1CD4007UBETerminalBlock_Dinkle:N14U2
1Conn_02x03_Odd_EvenConnector_PinSocket_2.54mm:PinSocket_2x03_P2.54mm_VerticalJ1
1Conn_ARM_JTAG_SWD_10Connector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ2
1CrystalCrystal:Crystal_HC49-U_VerticalY1
1GNDTestPoint:TestPoint_Keystone_5000-5004_MiniatureTP1
1HeaterConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ8
1LEDConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ7
1MotorConnector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ3
1SP0503BAHTPackage_TO_SOT_SMD:SOT-143D1
1STM32F103C8TxPackage_QFP:LQFP-48_7x7mm_P0.5mmU1
1SW_PushButton_Switch_SMD:SW_SPST_B3S-1000SW1
1SolderJumper_2_OpenJumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mmJP1
1Temperature SensorConnector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ4
1USB_C_Receptacle_USB2.0Connector_USB:USB_C_Receptacle_Amphenol_12401610E4-2A_CircularHolesJ6
1VinConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ5

More from dbhan08/Weather-Resistant-Camera

1
  • 2 layers12 × 18.6 mmWeather, 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…

    11 parts

Similar boards

  • 2 layers151 × 68.5 mmPCBProject, the printed circuit board in 3D

    PCBProject

    aditya02095/PCB-Design

    Here are the gerber files for the digital frequency meter created using KiCAD

    49 parts
  • 2 layers126.4 × 157 mmEiit, the printed circuit board in 3D

    Eiit

    guptapurnima/Digital-Electronics-Design-Digital-Frequency-Meter-

    Designed Schmitt Trigger and CMOS logic circuits using CD4007 and CD4026 ICs. Created complete schematics, PCB footprints, and 3D models in KiCAD. Validated signal integrity across the designed circuits.

    49 parts
  • 4 layers99 × 53.3 mmPSLab, the printed circuit board in 3D

    PSLab

    fossasia/pslab-hardware

    PSLab Hardware Design and Schematics https://pslab.io

    199 parts1.7kApache-2.0
  • 4 layers85 × 56 mmPslab mini, the printed circuit board in 3D

    Pslab mini

    fossasia/pslab-mini-hardware

    PSLab Mini Hardware https://pslab.io

    182 parts1.2kApache-2.0
  • 4 layers55 × 14.7 mmMinCab, the printed circuit board in 3D

    MinCab

    merocle/mincab

    small carrier board for Raspberry Pi CM4

    41 parts180CC-BY-SA-4.0
  • 2 layers145 × 165 mmBreakpanel, the printed circuit board in 3D

    Breakpanel

    monero-project/kastelo

    The Sekura Monero Hardware Wallet

    690 parts115
  • 4 layers60 × 40 mmInkTalk, the printed circuit board in 3D

    InkTalk

    FeralFirmware/TailTalk

    A modern async user space AppleTalk stack with Rust + Tokio

    66 parts103GPL-3.0
  • 6 layers203 × 151.8 mmPDNode Baseboard, the printed circuit board in 3D

    PDNode Baseboard

    DvidMakesThings/HW_PDNode-600-Pro

    The PDNode-600 is a professional-grade, 600W USB Power Delivery Unit designed specifically for compact 10-inch rack systems, targeting embedded developers, homelab enthusiasts, test benches, and smart infrastructure.

    236 parts86AGPL-3.0

Questions

What parts does the Weather use?

44 parts, built around the CD4007UBE and SP0503BAHTG. 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.8/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.