OT-0003: Rain sensor wired to PIN 34 not PIN 19¶
Status¶
Accepted — 2026-04-02
Context¶
The rain sensor on caneast-c1-ot1-esp1 (ESP32) was initially wired to GPIO PIN 19. During testing, PIN 19 produced erratic readings — the analog input floated between values even with the sensor disconnected, triggering false rain alerts via SentinelBot.
Decision¶
Rain sensor analog input wired to GPIO PIN 34 on the ESP32.
Rationale¶
- PIN 19 is a GPIO with both input and output capability — when configured as input, it is susceptible to floating voltage from internal pull-up/pull-down circuitry and adjacent pin crosstalk
- PIN 34 is an input-only GPIO on the ESP32 — it has no internal pull-up or pull-down resistors, making it ideal for analog sensor reads where external circuitry defines the voltage
- PIN 34 is part of the ADC1 channel group (ADC1_CH6), which does not conflict with WiFi (ADC2 channels are unavailable when WiFi is active on ESP32)
- After rewiring to PIN 34, readings stabilized and false alerts stopped
Consequences¶
- All future ESP32 analog sensor inputs should prefer ADC1 input-only pins (32, 33, 34, 35, 36, 39)
- PIN 19 is available for digital output use (LEDs, relays)
- Firmware updated:
RAIN_SENSOR_PINconstant changed from 19 to 34 - Wiring diagram in archon-apps updated