Introduction

These solenoid valves can be used to control the flow of liquid. They are equipped with three control wires: red, yellow and blue. connect the blue wire to positive pole to open the valve, or connect the red wire to positive pole to close the valve. The yellow wire is the shared ground line. Use the solenoid valve with the relay to open or close the valve at a predetermined time. This product is an automated and manual solenoid valve. When the valve is powered off, it will stop working and keep the current state, and then we can open or close the valve manually.

These solenoid water valves integrate valve and DC motor in one piece, inside of which has metal reduction gearbox with large torque, low noise and easy to install. We also use sealing design for the motor to make the entire structure more reliable. The valve features stable performance, high sensitivity and anti-electromagnetic interference. It can withstand 1.0Mpa static pressure. It can be widely used in smart home, automatic agriculture, fisheries and other projects that require the precise controlling of water flow.

Specification

Tutorial

This tutorial will show you how to drive the solenoid valve to open or close through a relay under the control of UNO mainboard.

Requirements

Connection Diagram

There is an open/close indicator on the solenoid valve: it displays | when the valve is closed, and — when the valve is open.

The circle at the right-lower corner of the solenoid valve is an Off/On switch, pull it out gently and then we can close or open the valve manually.

Connection Diagram.png

Sample Code

Install the Arduino IDE software.

Open the compiling environment of the Arduino IDE, and upload the following codes:

Digital Relay Module  (Arduino & Raspberry Pi compatible)

***************************************************/
/***************************************************
//Arduino Sample Code //www.DFRobot.com 
//Last modified on 24th January 2019 by WWZ 
//This code has been updated to work with the sample code provided in the Wiki 
****************************************************/ 
/***********Notice and Trouble shooting***************
1.Beware of electric shock and burn out the circuit board.
2.The input voltage of this module is 2.8~5.5V.              
****************************************************/                      //All the above instructions are based on Digital Relay Module

const int RelayPin = 3;                   

void setup() {
   Serial.begin(9600);   
  pinMode(RelayPin, OUTPUT);
} 
void loop() {
  if(Serial.read()=='o'){

     digitalWrite(RelayPin, HIGH);   //Turn on  
     Serial.println("open");
     delay(100);
  }
   if(Serial.read()=='f'){

     digitalWrite(RelayPin, LOW);   //Turn off   
     Serial.println("close");
     delay(100);
  }
}

Expected Results

Input "o" in the Arduino IDE serial monitor input field, then an "open" will be displayed on its display interface, and the solenoid valve is open; Input "f", it will diaplay "close" and the valve will be closed.

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum

More Documents

DFshopping_car1.png Get Solenoid Valve-DN15/DN20 from DFRobot Store or DFRobot Distributor.

Turn to the Top