https://github.com/eoommaa/water-sump-pump
Water Sump Pump Countdown Timer designed for SLAC
https://github.com/eoommaa/water-sump-pump
button-control countdown-timer i2c-lcd kicad kicad-schematics kicad-symbols lcd-display lcd-library micropython pi-pico raspberry-pi-pico relay relay-control rp2040 slac stanford-slac sump-pump
Last synced: 26 days ago
JSON representation
Water Sump Pump Countdown Timer designed for SLAC
- Host: GitHub
- URL: https://github.com/eoommaa/water-sump-pump
- Owner: eoommaa
- License: mit
- Created: 2025-07-02T23:01:07.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-16T04:23:51.000Z (11 months ago)
- Last Synced: 2025-07-30T03:28:59.030Z (11 months ago)
- Topics: button-control, countdown-timer, i2c-lcd, kicad, kicad-schematics, kicad-symbols, lcd-display, lcd-library, micropython, pi-pico, raspberry-pi-pico, relay, relay-control, rp2040, slac, stanford-slac, sump-pump
- Language: Python
- Homepage:
- Size: 2.72 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Water Sump Pump Countdown Timer
A countdown timer for managing a water sump pump using a Raspberry Pi Pico programmed in MicroPython, designed for SLAC National Accelerator Laboratory during Summer 2024.
- **Features:** Automates sump pump intervals and relay activation with a 60-minute countdown timer, 3-button control (`START`/`STOP`/`RESET`), and thermal safety from 80°F fan activation to prevent overheating
- Each button (`START`/`STOP`/`RESET`) is mapped to an LED and activates a specific state when the user presses on it
- 60-minute countdown timer displayed in `MM:SS` format with the temperature on the LCD (`Countdown: 60:00` & `Temp: 80 F`)
- **LCD Library from [`RPI-PICO-I2C-LCD`](https://github.com/T-622/RPI-PICO-I2C-LCD/tree/main) by [`T-622`](https://github.com/T-622):** [`lcd_api`](/src/lcd/lcd_api.py) & [`pico_i2c_lcd`](/src/lcd/pico_i2c_lcd.py)
- **Components:** [Full BOM](docs/BOM.md) with relay and sump pump specs
# Schematics[^1][^2]
## SLAC Water Sump Pump Countdown Timer Schematic

## RP2040 Water Sump Pump Countdown Timer Schematic

# Relay Behavior
Relay controls the 120 VAC outlet like a feedback loop.
- **[`SLAC Water Sump Pump Countdown Timer` Schematic](#slac-water-sump-pump-countdown-timer-schematic):** Pin 3 from `K1` relay has an input of 120 VAC L input (10 A) and Pin 4 is an input to the same 120 VAC output
- **`START`:** Relay NC[^3] → Sump pump activates
- **`STOP` & `RESET`:** Relay NO[^3] → Sump pump deactivates
# `START`/`STOP`/`RESET` Button Controls
## `START`/`STOP`/`RESET` Button State Diagram
```
┌──────────────────────────┐
│ ▼
┌────┐ ┌─────┴───┐ ┌────────┐ ┌─────────┐
│Idle├──►│START Btn├──►│STOP Btn├──►│RESET Btn│
└────┘ └─────────┘ └────┬───┘ └────┬────┘
▲ ▼ │
└──────────────────────────┘
```
## `START` Button
- **Function:** Default state where the system starts 60-minute countdown timer
- **LED:** Blinking green
## `STOP` Button
- **Function:** Pauses the countdown timer
- **LED:** Solid red
- **LCD:** Displays messages repeatedly
> Countdown stopped!
> Press START or RESET
- [`countdown_stop = True`](https://github.com/eoommaa/Water-Sump-Pump/blob/d4ba52d33f075a21b61ff5ee6c35b372b952a699/src/water_sump_pump.py#L166-L175) pauses the countdown timer
### `START` & [`RESET`](#reset-button) Button on `STOP`
- **`START`:** Countdown timer continues from the time it was paused on
- **LED:** Red off and blinking green
## `RESET` Button
- **Function:** Emergency reset (Countdown timer restarts at `60:00` after the user presses `START` button)
- **LED & Buzzer** Blinking blue & buzzer beeps repeatedly
- **LCD:** Displays messages repeatedly
> Countdown reset!
> Press START to start over
- [`system_locked = True`](https://github.com/eoommaa/Water-Sump-Pump/blob/d4ba52d33f075a21b61ff5ee6c35b372b952a699/src/water_sump_pump.py#L178-L186) allows the user one button to press on to restart the countdown timer
- User can press on `STOP` or `RESET` button, but the program ignores the two button presses when in `RESET` mode
## Countdown Idle and Completion LCD Messages
- **Countdown Idle:** `Press START!`
- **Countdown Completion:** `Press START to start agn`
# Notes
- **[`SLAC Water Sump Pump Countdown Timer` Schematic](#slac-water-sump-pump-countdown-timer-schematic):** A `K1` relay is connected to the L298N motor driver, which is the component connected in the final hardware
- **[`RP2040 Water Sump Pump Countdown Timer` Schematic](#rp2040-water-sump-pump-countdown-timer-schematic):** A 5V DC motor is used since the relay acts like a switch along with an IC2 1602 LCD connected to the RP2040
- Ex: Motor on when countdown timer is running and vice versa when it is off
- **Power Indicator:** Green LED stays on during both idle and after completion states to indicate that the Pi Pico is powered
# Credit
- **LCD Library:** Adapted from [`RPI-PICO-I2C-LCD`](https://github.com/T-622/RPI-PICO-I2C-LCD/tree/main) by [`T-622`](https://github.com/T-622)
[^1]: [`SLAC Water Sump Pump Countdown Timer` Schematic](https://github.com/eoommaa/Water-Sump-Pump/blob/main/kicad/schematics/SLAC%20Water%20Sump%20Pump.pdf) and [`.kicad_sch`](https://github.com/eoommaa/Water-Sump-Pump/blob/main/kicad/SLAC%20Water%20Sump%20Pump.kicad_sch)
[^2]: [`RP2040 Water Sump Pump Countdown Timer` Schematic](https://github.com/eoommaa/Water-Sump-Pump/blob/main/kicad/schematics/RP2040%20Water%20Sump%20Pump.pdf) and [`.kicad_sch`](https://github.com/eoommaa/Water-Sump-Pump/blob/main/kicad/RP2040%20Water%20Sump%20Pump.kicad_sch)
[^3]: Normally open (NO) & normally closed (NC)