Skip to content
A

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

  1. Confirm the exact part number and breakout-board revision.
  2. Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
  3. Check controller pin assignments and bus address or interface mode against the example code.
  4. Power up with external loads disconnected, then test signals before full integration.
  5. 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 pinArduino Uno pinNote
Transistor/MOSFET gate (via resistor) or Relay IND8Never wire the valve coil directly to a digital pin.
Driver GND / valve supply GNDGNDShared ground between Arduino and valve supply.
Valve + / external 5V supply—Valve coils commonly draw 300-500mA.

Swipe sideways to see every column →

C++
  • 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

Related Guides & Projects