How to control a 12V ball valve with Arduino and MOSFETs?

Hello, this is my first post on the Arduino forum. I am working on a project that involves controlling a 12V 6W ball valve with Arduino. The valve has three wires: ground, open, and close.

ec_ard_valve_wires

I want to use MOSFETs or Transistors instead of relays to switch the power to the valve, but I am not sure how to wire them correctly.

The valve I am using is this one: [12V DC 6W Electric Ball Valve]. It has a motor that rotates the ball 90 degrees to open and close the valve. It also has two limit switches that indicate the position of the valve.

The MOSFETs I am using are these ones: [IRF3205 and IRF1405].

I also have a 12V DC power supply that I use to power both the Arduino and the valve. I have a DC power jack that I connect to the VIN and GND pins of the Arduino. I also have a common ground wire that I connect to the ground wire of the valve and the GND pin of the power supply.

This is the schematic that I have made

the code that I have written to test the valve is just a basic one for now that cycles the pins 12 and 11 from high to low after a delay.

When I upload the code and run it, the valve does not work properly. I have tried using different types of transistors from my kit, such as BC327, 2N2222, 2N3907, and others. But I either get a very low output around 4V instead of 12V, or the transistor won't shut down even though I have a pull-down resistor. I have checked the connections and the power supply, and they seem to be fine. I have also tried swapping the open and close wires, but it did not help.

I do not have to use MOSFETs, I can also use other types of transistors if they are suitable for this project. I have a transistor kit with various values, such as BC327, 2N2222, 2N3907, and others. You can see the photo of my kit below. The Arduino is powered by the same power supply that is usually used for powering the motor.

Can anyone please help me figure out what I am doing wrong and how to fix it? I would really appreciate any advice or suggestions. Thank you very much in advance. :blush:

Your diagram ONLY shows three wires. Not nearly enough wires to operate a motor and also have two limit switches that indicate the position.

I Simplified it by using only 2 pins from the valve initially. If the circuit functions for the opening, I'll replicate it for the closing pin. The valve's built-in limits handle the fully open and closed positions, so there's no need to modify my circuit for those positions.

Limit switches are already built in.

Tom... :grinning: :+1: :coffee: :australia:

Hi, @rabie3150
Welcome to the forum.

Can you please post a link to specs/data of the valve?
The diag you show, uses mains AC, AC is the usual method to control these valves, so 12V AC current may be needed.

12V, 6W means the motor will load up to;
Power = Voltage x Current
...
Current = Power / Voltage = 6 /12 = 1/2 Amp or 500mA.
The initial starting current will be higher.

But first we need to know if the valve is AC or DC.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Hi @TomGeorge,

Thank you for your response. I wanted to clarify that the valve I’m using operates on 12V DC, not AC. I appreciate your help and look forward to any further suggestions you might have.

Best, rabie

How much current does the valve motor require? Do the limit switches stop the motor at end of travel or only give an indication?

Your diagram will not provide more that about 4 volts to the valve.
The voltages are:

  1. Vout of Pin 11 can be no more than 4.5 volts (likely less).
  2. The voltage drop of a transistor from base to emitter is about 0.5V (or more).

Therefore the emitter voltage can be no higher than 4.5 - .5 or approx 4 volts.

One of the kind posters make the attached diagram of various outputs ( I don't recall the originator). Any option with a 12V power and the motor (aka valve) connected to ground.

Now, does you valve have internal limit switches? If not you will have to consider how to stop the drive when the valve reaches the end position.

In addition, one output should disable the other making it logically impossible to have both on at the same time. Arduino programs do funny things sometimes, you want the circuit to not allow both on at the same time.

1 Like

Since you have NPN transistors, you could use 2X the fourth (upper right)
circuit in @JohnRob's schematic with P-channel MOSFETs in the 2 to 5 Amp range.

Then there is no feedback, so your Arduino never can know if the valve is open or closed until after it actually does an open or close command, Then is just hopes the valve was either already at the right position, or the motor moved the valve to the right position.

So what are the polarities needed to drive the valve open and closed?

Please post a link to pump/motor specs/data.

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:

A relay module seems an easy solution.
12volt (+) to CO, brown to NC, blue to NO, green to 12volt(-)

Two high-side transistor switches is another option, but more complicated.
Leo..

The valve takes about 20 seconds to fully open or close so i just need to kepp the pin HIGH for 22 seconds that sould do the job

@rabie3150
If interested, I have a simple solution that uses just 1 IC
Also cheap!

1 Like

Hi, @rabie3150
Is this your valve?

Tom... :grinning: :+1: :coffee: :australia:

1 Like

Still looking for a solution?

Could you assist me in identifying the issue and how to rectify it? I would be very grateful for any guidance or suggestions. Thank you in advance.

I attempted to alter one of the above circuits because it was successful in opening the valve. However, this circuit won't function if I want to do the same for the closing pin. As I understand it, this circuit acts as a circuit breaker and disconnects/opens the ground pin, while the other pin (the open pin on the valve (blue)) remains energized/live. The problem arises when I replicate this for the closing pin, as both the close pin and open pin would be energized.

Therefore, I tried to modify it to disconnect the positive pins instead of the ground pin. Here is what I've done so far, but it doesn't seem to work. Could you please help me?

Dear @jim-p,

Thank you for your offer. I’m definitely interested in your simple and cost-effective solution using just one IC. I’m always open to suggestions and eager to learn. Could you please share more details about it?

Best regards, rabie

I see the topic has already been solved

You need two of these circuits.

If the diagram in post #3 is your valve:

  1. Green goes to the negative of: both circuits and the power supply.
  2. The "open" wire goes to the motor connection of the first circuit shown in the examples
  3. The "closed" wire goes tot he motor connection of your second version of your circuit.

Enable circuit (driver) #1 and the valve opens
Enable circuit (driver) #2 and the valve closes

DO NOT enable both at the same time otherwise the valve or the circuits or all three will be damaged, perhaps beyond repair.