Back to Hub | Module 15: Automated Flood Shutter & Barrier Relay
🚨 Flood Barrier Shutter Physics STATUS: CLEAR (SAFE)
Building Access Bay Shutter
INTERIOR BAY
SHUTTER: OPEN (PASSABLE)
Automated Defense Actuators
STROBE
RELAY
⚙️
MOTOR RELAY: OFF (0V)
📢 SIREN: SILENT
Water Depth:
15.0 cm
ADC Voltage:
0.495 V
Relay (GP16):
LOW (0)

🎛️ Flood Threat Controls

15 cm
🐍 MicroPython Code Inspector
import machine, time water_adc = machine.ADC(machine.Pin(26)) shutter_relay = machine.Pin(16, machine.Pin.OUT) strobe_light = machine.Pin(17, machine.Pin.OUT) alarm_siren = machine.Pin(18, machine.Pin.OUT) TRIGGER_HT = 40.0; CLEAR_HT = 20.0 shutters_closed = False while True: water_cm = (water_adc.read_u16()/65535)*100 if water_cm >= TRIGGER_HT and not shutters_closed: shutter_relay.value(1) # Close Shutter strobe_light.value(1); alarm_siren.value(1) shutters_closed = True elif water_cm < CLEAR_HT and shutters_closed: shutter_relay.value(0) # Open Shutter strobe_light.value(0); alarm_siren.value(0) shutters_closed = False

🔌 Circuit Schematic Notes

  • Water Level / Ultrasonic Probe: Connected to RP2040 GP26 (ADC0).
  • Heavy-Duty Motor Relay: Powered via GP16 to actuate 24V/220V motorized door coils.
  • Normally Closed vs Normally Open: Shutter motors use NO contacts so power failures default to safety states.
  • Strobe & Siren: Triggered via GP17 & GP18 to provide optical and audible site evacuation warnings.
💡 Quick Concept Check 1 Question
Why does the flood shutter control loop use two distinct thresholds (e.g. 40cm to close, 20cm to re-open) instead of a single threshold value?