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…
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.
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.
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…
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.
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.