virtual switch for water closing mechanism

Hello,

I'm new here so go easy on me and sorry for my english.
I'm trying to make a virtual switch for an idea. I have a MFZ0101M-GB (a little solenoid valve which is used for touch sinks to close water) and an Arduino Uno. If i grab the two wires of the valve and put them in the 5v and ground, it clicks and it's closed. if i switch them, it opens. Now i want to make that with an arduino, but when i put them in the I/O pins, it doesnt work. Normally the I/O pins should have 5v right?

One pin needs to be a ground pin, and the other a 5v pin.
And i need to be able to switch them virtually, so NOT with a button.

Here's my code. The delays are temporary, im planning to do something with motors and heat sensors but that's not important for this.

int OpenClose = 7;
int CloseOpen = 8;

void setup() {
  pinMode(OpenClose, OUTPUT);
  pinMode(CloseOpen, INPUT);
}

void loop() {
  digitalWrite(OpenClose, HIGH);
  delay(500);
  digitalWrite(OpenClose, LOW);
  pinMode(OpenClose, INPUT);
  pinMode(CloseOpen, OUTPUT);
  digitalWrite(CloseOpen, HIGH);
  delay(500);
  digitalWrite(CloseOpen, LOW);
  pinMode(OpenClose, OUTPUT);
  pinMode(CloseOpen, INPUT);
}

An Uno I/O pin can output +5 volts into an open circuit. However, if the load uses considerable current, say more than 40 mA, then the voltage may be considerably less. Measure the voltage both without and with the valve.

If the valve needs more than 40 mA then you will need to use a transistor to switch to assist your Arduino. The transistor may be bipolar or MOSFET. Of course this assumes that you have not damaged the Arduino due to excessive load or the inductive load of the valve's coil. The transistor will need some protection which may be as simple as a fuse and a diode.

Hmm, not speaking Russian - which it appears is the only source and usage of this valve - I can't seem to find any specifications on it! :astonished:

If one polarity opens and the opposite polarity closes you need an H-bridge motor controller, but we still need to know the correct voltage and current.

vaj4088:
An Uno I/O pin can output +5 volts into an open circuit. However, if the load uses considerable current, say more than 40 mA, then the voltage may be considerably less.

At 40 mA the current drops by 2-3V. Goes to show how much it stresses the pin - it's a BAD idea to even consider running any device at it's absolute maximum rating for any length of time. 20 mA is the safe limit.

Quite certainly this solenoid needs a transistor to be driven. As OP mentions reversing wires, implying reversing polarity, make that an H-bridge (aka motor driver - and please leave the L298 in the museum, and get a modern CMOS based one).

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.