Controlling / Reading a 5-Wire motorized ball valve

To control the ball valve I need a DPDT relay, no big deal I have that covered.

I do need to figure out how to read the wires that are meant to turn on an LED depending on what position the valve is in. so from the schematic that came with the ball valve each wire brings GND to the LED. I havent been able to find a good way of reading each pin i connect the wires to so that i can print a line that says "Valve Open" or "Valve Closed" or send myself a msg with the same info.

I have been reading and trying stuff out so I dont have any working code at the moment. I have just ordered a DPDT relay to use instead of my SPST relays i purchase prior. To test each valve position i manually power each control wire to move the valve. Thanks in advance!

...would be helpful to know.

And how do you stop the motor?
A H-bridge were the modern approach for controlling a DC motor.

I apologize, here is the schematic that came with the ball valve.

I guess that you have to monitor the lights for when the desired position is reached. Or do you want analog behaviour of the valve, guided by other sensors?

The problem with a more specific answer is in the detail not supplied.
i.e. the indicators could be an LED on their own, or an LED with built in resistor etc.
The black wire is possibly an open collector arrangement given your quote .......

I figured I could read whatever pins i attached the wires to that are supposed to pull the LED anode leg to GND. This shouldn't be that hard right...

Sounds correct. The green and red wires are probably a transistor so to feed it into an Arduino DIO pin you would need a pullup. I would also put a 10k resistor in series right before the DIO pin so if it's not a transistor output the Arduino will be protected.

Instead of a DPDT relay you could use an H bridge driver configuration. like these.

What is the benefit of the H-bridge over the DPDT relay driven by the Arduino?

Could you show a quick schematic of how your saying to hook the wires up to the Arduino.

The H bridge is solid state, no moving parts, no contacts to become pitted, no noise.

Functionally = no difference.

Could you show a quick schematic of how your saying to hook the wires up to the Arduino.

What wires and what Arduino?

This portion of your reply. I'm using the Arduino Mega 2560.

Nitpicking: the cathode goes to GND.

No worries, I appreciate the correction.

Here is another better schematic that I found for the ball valve. Is the H-Bridge still a better option then the relays?

Instead of an LED lighting up to let me know what position its in, I would prefer a msg or some other notification.

Hi, @Jon.Cherba
Welcome to the forum.

Can you please post a link to data/specs of the ballvalve assembly?

It looks like your assembly is simply a reversible motor with inbuilt limit switches to stop the motor at each extremity of its travel.
The open close limit switches are probably part of the motor control limits.
Without the specs, I would say that they are just switches, with a common connection, using them as common gnd is the logical way to use them connected to the Arduino controller with pullup resistors.

What model Arduino controller are you using?

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

You only can poll the switches until one is closing indicating that this limit was reached.

Motorized Ball Valve Info

Arduino Mega 2560 is the Arduino I'm using.

finally got some H-Bridge boards in and they work great. Now I just need to figure out the millis function to work correctly for me.