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:SSformat with the temperature on the LCD (Countdown: 60:00&Temp: 80 F) - LCD Library from
RPI-PICO-I2C-LCDbyT-622:lcd_api&pico_i2c_lcd
- Each button (
- Components: Full BOM with relay and sump pump specs
Relay controls the 120 VAC outlet like a feedback loop.
SLAC Water Sump Pump Countdown TimerSchematic: Pin 3 fromK1relay has an input of 120 VAC L input (10 A) and Pin 4 is an input to the same 120 VAC outputSTART: Relay NC3 → Sump pump activatesSTOP&RESET: Relay NO3 → Sump pump deactivates
┌──────────────────────────┐
│ ▼
┌────┐ ┌─────┴───┐ ┌────────┐ ┌─────────┐
│Idle├──►│START Btn├──►│STOP Btn├──►│RESET Btn│
└────┘ └─────────┘ └────┬───┘ └────┬────┘
▲ ▼ │
└──────────────────────────┘
- Function: Default state where the system starts 60-minute countdown timer
- LED: Blinking green
-
Function: Pauses the countdown timer
-
LED: Solid red
-
LCD: Displays messages repeatedly
Countdown stopped!
Press START or RESET
-
countdown_stop = Truepauses the countdown timer
START & RESET Button on STOP
START: Countdown timer continues from the time it was paused on- LED: Red off and blinking green
-
Function: Emergency reset (Countdown timer restarts at
60:00after the user pressesSTARTbutton) -
LED & Buzzer Blinking blue & buzzer beeps repeatedly
-
LCD: Displays messages repeatedly
Countdown reset!
Press START to start over
-
system_locked = Trueallows the user one button to press on to restart the countdown timer- User can press on
STOPorRESETbutton, but the program ignores the two button presses when inRESETmode
- User can press on
- Countdown Idle:
Press START! - Countdown Completion:
Press START to start agn
SLAC Water Sump Pump Countdown TimerSchematic: AK1relay is connected to the L298N motor driver, which is the component connected in the final hardwareRP2040 Water Sump Pump Countdown TimerSchematic: 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
- LCD Library: Adapted from
RPI-PICO-I2C-LCDbyT-622