DIY Foot Pedal Water Tap - Step-by-step instructions
Build a hands-free foot pedal controlled water tap with three operating modes:
Hold pedal down for water flow
Single tap for continuous flow (2-minute auto-shutoff)
Double tap to return to hand control
| Item | Product Code | Supplier | Est. Price (AUD) | Qty | Notes |
|---|---|---|---|---|---|
| Arduino Uno | Various | Core Electronics | $40-50 | 1 | Or Arduino Nano for compact build |
| 12V Plastic Water Solenoid Valve (1/2") | ADA997 | Core Electronics (Adafruit) | $15-20 | 2 | For hot & cold water lines |
| TIP120 Darlington Transistor | - | Jaycar/Core Electronics | $2-3 | 2 | One per solenoid |
| 1N4001 Diode (Flyback protection) | - | Jaycar/Core Electronics | $0.50 | 2 | One per solenoid |
| 2.2kΩ Resistor | - | Jaycar/Core Electronics | $0.20 | 2 | Base resistor for transistors |
| 220Ω Resistor | - | Jaycar/Core Electronics | $0.20 | 1 | For status LED |
| 5mm LED | - | Jaycar/Core Electronics | $0.50 | 1 | Status indicator |
| Foot Pedal Switch (Momentary) | SP0760 | Jaycar | $9-15 | 1 | 250V 10A momentary action |
| 12V 2A Power Supply | - | Jaycar/Core Electronics | $15-25 | 1 | Must be at least 1.5A |
| Breadboard (for testing) | - | Core Electronics | $5-10 | 1 | Half-size adequate |
| Jumper Wires | - | Core Electronics | $5-10 | 1 pack | Male-to-male, male-to-female |
| Prototype PCB Board (optional) | - | Jaycar | $3-5 | 1 | For permanent installation |
| Project Enclosure | - | Jaycar | $10-15 | 1 | Waterproof if near sink |
| Heat Shrink Tubing | - | Jaycar/Bunnings | $5-10 | 1 pack | For insulation |
| Item | Product Code | Supplier | Est. Price (AUD) | Qty | Notes |
|---|---|---|---|---|---|
| Stainless Steel Braided Hose (450mm) | - | Bunnings (Kinetic) | $8-12 | 4 | 1/2" BSP connections |
| PTFE Thread Seal Tape | - | Bunnings (FIX-A-TAP) | $2-4 | 1 | 12mm x 8m |
| Brass Adapters/Fittings (1/2" BSP) | - | Bunnings | $5-10 | 4-6 | As needed for connections |
| Stainless Steel Hose Clamps (17-32mm) | - | Bunnings (Kinetic) | $3-5 | 4 | Backup/testing |
| Water Hammer Arrestor (15mm) | - | Bunnings (Sioux Chief) | $15-25 | 2 | CRITICAL for solenoids |
| Bucket (for testing) | - | Bunnings | $5-10 | 1 | Testing only |
| Garden Hose Adapter Kit | - | Bunnings | $10-15 | 1 | For bucket testing |
+12V Power Supply
|
+--------------------+--------------------+
| | |
[Solenoid 1] [Solenoid 2] [Arduino VIN]
| | |
[Diode] [Diode] |
(1N4001) (1N4001) |
Cathode up Cathode up |
| | |
Collector Collector |
[TIP120 #1] [TIP120 #2] |
| | |
Emitter Emitter |
| | |
GND GND GND
Arduino Pin 9 ---[2.2kΩ]--- Base (TIP120 #1)
Arduino Pin 10 --[2.2kΩ]--- Base (TIP120 #2)
Arduino Pin 2 ----------------- Foot Pedal Switch --- GND
Arduino Pin 13 --[220Ω]--- LED (+) --- GND
/*
* DIY Foot Pedal Water Tap Controller
* Three modes:
* - Hold pedal: Water flows while pressed
* - Single tap: Continuous flow for 2 minutes (auto-shutoff)
* - Double tap: Switch to manual hand control
*/
// Pin definitions
const int FOOT_PEDAL_PIN = 2; // Foot pedal switch (interrupt capable)
const int HOT_VALVE_PIN = 9; // Hot water solenoid valve
const int COLD_VALVE_PIN = 10; // Cold water solenoid valve
const int STATUS_LED_PIN = 13; // Status indicator LED
// Timing constants
const unsigned long DEBOUNCE_DELAY = 50; // Debounce time in ms
const unsigned long DOUBLE_TAP_WINDOW = 400; // Time window for double tap (ms)
const unsigned long TAP_THRESHOLD = 200; // Max press time for "tap" vs "hold" (ms)
const unsigned long CONTINUOUS_TIMEOUT = 120000; // 2 minutes in ms
// State variables
enum Mode { HOLD_MODE, CONTINUOUS_MODE, MANUAL_MODE };
Mode currentMode = HOLD_MODE;
unsigned long buttonPressTime = 0;
unsigned long buttonReleaseTime = 0;
unsigned long lastTapTime = 0;
unsigned long continuousStartTime = 0;
bool buttonState = HIGH;
bool lastButtonState = HIGH;
bool valvesOpen = false;
int tapCount = 0;
void setup() {
// Initialize pins
pinMode(FOOT_PEDAL_PIN, INPUT_PULLUP);
pinMode(HOT_VALVE_PIN, OUTPUT);
pinMode(COLD_VALVE_PIN, OUTPUT);
pinMode(STATUS_LED_PIN, OUTPUT);
// Ensure valves are closed on startup
closeValves();
// Initialize serial for debugging
Serial.begin(9600);
Serial.println("Foot Pedal Water Tap Controller Started");
Serial.println("Mode: HOLD");
}
void loop() {
// Read button with debounce
int reading = digitalRead(FOOT_PEDAL_PIN);
// Button state changed
if (reading != lastButtonState) {
delay(DEBOUNCE_DELAY); // Simple debounce
reading = digitalRead(FOOT_PEDAL_PIN);
if (reading != buttonState) {
buttonState = reading;
// Button pressed (goes LOW due to pull-up)
if (buttonState == LOW) {
buttonPressTime = millis();
}
// Button released
else {
buttonReleaseTime = millis();
handleButtonRelease();
}
}
}
lastButtonState = reading;
// Handle current mode
switch (currentMode) {
case HOLD_MODE:
handleHoldMode();
break;
case CONTINUOUS_MODE:
handleContinuousMode();
break;
case MANUAL_MODE:
handleManualMode();
break;
}
// Update status LED (blink pattern indicates mode)
updateStatusLED();
}
void handleButtonRelease() {
unsigned long pressDuration = buttonReleaseTime - buttonPressTime;
unsigned long timeSinceLastTap = buttonReleaseTime - lastTapTime;
// Detect tap (quick press/release)
if (pressDuration < TAP_THRESHOLD) {
// Check if this is a second tap within the double-tap window
if (timeSinceLastTap < DOUBLE_TAP_WINDOW && tapCount == 1) {
// Double tap detected
handleDoubleTap();
tapCount = 0;
} else {
// Single tap (might become double tap)
tapCount = 1;
lastTapTime = buttonReleaseTime;
// Wait to see if there's a second tap
delay(DOUBLE_TAP_WINDOW);
// If still just one tap, treat as single tap
if (tapCount == 1) {
handleSingleTap();
tapCount = 0;
}
}
} else {
// Long press (hold mode handled in real-time)
tapCount = 0;
}
}
void handleSingleTap() {
Serial.println("Single Tap - Entering CONTINUOUS mode");
currentMode = CONTINUOUS_MODE;
continuousStartTime = millis();
openValves();
}
void handleDoubleTap() {
Serial.println("Double Tap - Entering MANUAL mode");
currentMode = MANUAL_MODE;
closeValves();
// Flash LED twice to indicate manual mode
for (int i = 0; i < 2; i++) {
digitalWrite(STATUS_LED_PIN, HIGH);
delay(100);
digitalWrite(STATUS_LED_PIN, LOW);
delay(100);
}
}
void handleHoldMode() {
// Water flows while button is held down
if (buttonState == LOW) {
if (!valvesOpen) {
openValves();
}
} else {
if (valvesOpen) {
closeValves();
}
}
}
void handleContinuousMode() {
// Check for timeout (2 minutes)
if (millis() - continuousStartTime >= CONTINUOUS_TIMEOUT) {
Serial.println("Continuous timeout - Returning to HOLD mode");
currentMode = HOLD_MODE;
closeValves();
return;
}
// Check if button pressed to stop
if (buttonState == LOW && valvesOpen) {
Serial.println("Button pressed - Stopping continuous flow");
currentMode = HOLD_MODE;
closeValves();
}
}
void handleManualMode() {
// In manual mode, foot pedal returns control to faucet
// Pressing pedal exits manual mode
if (buttonState == LOW) {
Serial.println("Exiting MANUAL mode - Returning to HOLD mode");
currentMode = HOLD_MODE;
}
}
void openValves() {
digitalWrite(HOT_VALVE_PIN, HIGH);
digitalWrite(COLD_VALVE_PIN, HIGH);
valvesOpen = true;
Serial.println("Valves OPEN");
}
void closeValves() {
digitalWrite(HOT_VALVE_PIN, LOW);
digitalWrite(COLD_VALVE_PIN, LOW);
valvesOpen = false;
Serial.println("Valves CLOSED");
}
void updateStatusLED() {
static unsigned long lastBlinkTime = 0;
static bool ledState = false;
unsigned long currentMillis = millis();
switch (currentMode) {
case HOLD_MODE:
// Solid on when valves open, off when closed
digitalWrite(STATUS_LED_PIN, valvesOpen ? HIGH : LOW);
break;
case CONTINUOUS_MODE:
// Fast blink (500ms interval)
if (currentMillis - lastBlinkTime >= 500) {
ledState = !ledState;
digitalWrite(STATUS_LED_PIN, ledState);
lastBlinkTime = currentMillis;
}
break;
case MANUAL_MODE:
// Slow blink (1000ms interval)
if (currentMillis - lastBlinkTime >= 1000) {
ledState = !ledState;
digitalWrite(STATUS_LED_PIN, ledState);
lastBlinkTime = currentMillis;
}
break;
}
}
Connect 1N4001 diode across solenoid terminals:
If you hear a loud bang when the solenoid closes, you MUST install water hammer arrestors before final installation!
If breadboard works well, consider transferring to permanent board:
Before installing in sink:
Use multimeter to verify:
| Test | Expected Result |
|---|---|
| Power supply output | Should read 12V DC |
| Arduino VIN pin | Should read 11-12V when powered |
| Solenoid terminals | Should read 12V when valve commanded open |
| Foot pedal continuity | Should show continuity when pressed |
Turn off main water supply before starting!
Shutoff Valve → Braided Hose → Water Hammer Arrestor → Solenoid Valve → Braided Hose → Faucet
For each water line (hot and cold):
| Problem | Likely Cause | Solution |
|---|---|---|
| Loud bang when closing | Water hammer - needs arrestor | Install water hammer arrestors |
| Water drips when closed | Solenoid not closing fully | Check power, replace solenoid if faulty |
| Low water pressure | Solenoid partially obstructed | Clean solenoid, check for debris |
| Leaks at connections | Not tight enough or missing Teflon tape | Tighten or reapply Teflon tape |
| No water flow | Solenoid installed backwards | Check arrow on solenoid body (flow direction) |
| Problem | Likely Cause | Solution |
|---|---|---|
| Solenoid doesn't click | No power to solenoid | Check TIP120 wiring, verify 12V at solenoid terminals |
| Solenoid clicks but no Arduino response | Code not uploaded or wrong pins | Re-upload code, verify pin numbers |
| Pedal doesn't register | Loose connection | Check foot pedal wiring, test continuity |
| Valves don't close | Transistor shorted | Check for flyback diode, replace TIP120 |
| TIP120 gets very hot | High current, needs heatsink | Add heatsink to TIP120 |
| Erratic behaviour | Electrical interference | Add capacitor (100nF) across solenoid terminals |
| LED doesn't light | Wrong polarity or burnt out | Check LED polarity, test with multimeter |
| Problem | Solution |
|---|---|
| Double tap not registering | Increase DOUBLE_TAP_WINDOW in code (try 500-600ms) |
| Single tap triggers when holding | Decrease TAP_THRESHOLD in code (try 150ms) |
| Continuous mode times out too fast | Increase CONTINUOUS_TIMEOUT (currently 2 min) |
| Modes get stuck | Press and release pedal several times to reset |
| Category | Low End | High End |
|---|---|---|
| Arduino & Components | $60 | $90 |
| Solenoid Valves (×2) | $30 | $40 |
| Transistors, Resistors, LEDs | $5 | $10 |
| Foot Pedal Switch | $10 | $15 |
| Power Supply | $15 | $25 |
| Enclosure & Misc | $10 | $20 |
| Electronics Total | $130 | $200 |
| Category | Low End | High End |
|---|---|---|
| Braided Hoses (×4) | $30 | $50 |
| Water Hammer Arrestors (×2) | $30 | $50 |
| Fittings & Tape | $10 | $20 |
| Plumbing Total | $70 | $120 |
DIY Savings: $80-600+ AUD
No external libraries required - uses standard Arduino functions
Use this space to document any changes you make: