Solenoid
Controlling Solenoid Valve 5V with Arduino Uno
What is the Solenoid Valve 5V?
Solenoid Valve 5V practical reference
A small normally-closed solenoid valve used in automated plant watering, beverage-dispensing, and liquid-dosing projects.
Key specifications
- Operating voltage: 5 V DC (12V variants are also common — check your specific valve's rating before powering it)
- Current draw: ~400-650 mA while energized
- Valve type: Normally-closed (NC), 2-way — opens only while powered, closes automatically when power is removed
- Max working pressure: ~0.02-0.8 MPa typical for small hobby valves, model-dependent
Pinout and connection notes
The coil is an inductive load — always include a flyback diode across it, in parallel with the transistor/MOSFET switching it, or the switching transistor will fail from the voltage spike on turn-off.
- +: Coil positive lead — through a transistor/MOSFET, never straight from a GPIO pin
- -: Coil negative lead
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up Solenoid Valve 5V with Arduino Uno
Library
None — built-in digitalWrite by —
No library needed; driven via a transistor/MOSFET or relay, not directly from a pin.
Wiring
| Component pin | Arduino Uno pin | Note |
|---|---|---|
| Transistor/MOSFET gate (via resistor) or Relay IN | D8 | Never wire the valve coil directly to a digital pin. |
| Driver GND / valve supply GND | GND | Shared ground between Arduino and valve supply. |
| Valve + / external 5V supply | — | Valve coils commonly draw 300-500mA. |
Swipe sideways to see every column →
- This is a normally-closed valve on most common modules — it opens only while energized and closes again when power is removed; double-check your specific model if you need the opposite behavior.
- Drive the coil through a transistor/MOSFET or relay rated for its current draw, with a flyback diode across the coil — the same rule as any solenoid or motor.
- Mount the valve with the flow direction arrow (usually printed on the body) matching your actual water flow — installing it backwards can cause leaks or prevent it from sealing.
Related Components
Active Buzzer
Self-oscillating buzzer that beeps with just a single HIGH signal — no PWM required.
BLDC ESC
High-speed brushless motor and electronic speed controller combo.
Continuous Servo
Modified servo that spins continuously like a geared motor.
Solenoid Lock 12V
Fail-secure solenoid lock for DIY access-control projects.
Related Guides & Projects
Arduino Uno R4 Minima Pinout: Every GPIO, ADC, DAC, and Op-Amp Pin Explained
A complete Arduino Uno R4 Minima pinout reference — digital I/O, ADC, DAC, op-amp, CAN, dual UART, and exactly what it leaves out compared to the WiFi variant.
Mastering PWM on Arduino: Dimming LEDs and Controlling Motors
Understand what PWM actually is on Arduino, dim an LED smoothly, and safely control a DC motor's speed with a driver chip -- plus the mistakes (like wiring a motor straight to a pin) that damage boards.
4-Digit 7-Segment Counter with TM1637 & Arduino
Drive a TM1637-based 4-digit 7-segment display with Arduino Uno to show a real-time up/down counter, elapsed timer, and scrolling text. Covers library setup, brightness control, and custom segment mapping.
Arduino Uno R4 Minima vs WiFi: Which One Should You Choose?
Same processor, same memory, different price. Here's what the WiFi variant's extra hardware actually gets you, and when the Minima is the smarter buy.