Solenoid valve control using Arduino

Solenoid Valve

A solenoid valve is an electromechanical valve used to control the flow of fluids. It has a simple Open and Close mechanism of a valve which is operated by a solenoid.

Solenoid valves are used in various appliances and devices such as washing machine, automatic irrigation system, filling machine, etc.

Working of a Solenoid valve

In connection wise and operation wise, a solenoid valve is similar to a relay. Both devices are operated by an electromagnetic force applied to a movable contact.

A basic solenoid valve consists of a solenoid, plunger, spring and valve body. The valve can be either Normally Open or Normally Closed.

In a normally closed valve, the valve will be in a closed position if no charge is applied to the coil. Similarly, a normally open valve remains open until an electric supply is applied to the solenoid.

When an electric current is passed through the solenoid it generates a magnetic field that pulls the plunger or core which is made of a ferromagnetic material. And when the coil is de-energized, the spring push back the plunger and holds the normal position in the absence of magnetic force.

Arduino solenoid valve control circuit

The Arduino liquid flow control device can be used for different projects to control liquids and gases.

arduino solenoid valve controlling

DC Solenoid valves are available with 6V, 12V, 24V, 120V, 240V operating voltages. Here circuit has a 12V DC solenoid and is powered by an external supply. The transistor switches the Solenoid supply with respect to the Output of the Arduino.

The Diode 1N4007 in the circuit is used as a flyback or flywheel diode which is similar to used in relays, coils or inductive loads. The catch diode eliminates sudden voltage spike occurs across the coil during a switch off.

Arduino Code
// Code to Open and close an NC valve in 5 seconds gap.
int valvepin = 2;
void setup() {
 pinMode(valvepin, OUTPUT);
void loop() {
 //Opens the valve for 5 seconds
 digitalWrite(valvepin, HIGH);
 //Close the valve for 5 seconds
 digitalWrite(valvepin, LOW);
1 Star2 Stars3 Stars4 Stars5 Stars Rate Us!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *