Which arduino model to control voltage reversal module

Hi!

I'm a noob, with basic understanding of electronics. I am going to build a drip irrigation system for my tree nursery. This requires the ability to control several motorized valves, opening only one at a time. The motorized valve I am planning on using, requires reversal of current. I've found cheap circuit online that does exactly this:


The circuit is such, that if button K1 is pressed, it shorts the low voltage of an optocoupler to ground, and output voltage of the module is in regular direction. Pressing K2 shorts low voltage of another optocoupler to ground and output current to motor is reversed.

My first question is, how can I get an arduino to do the key presses for me?

Second question is, considering I may have 20 motorized valves to control: what type of arduinos and what hierarchy could I use? :thinking:

Sorry for the maybe ignorant question :rofl: and thanks for any help! :blush:

Do you have a link to the board that would give more information? What is the voltage across K1 and K2? If it is a 5V logic level it could be driven by a digital I/O pin. What do SW1 and SW2 do?

If you want to control 20 motors you will need 40 I/O pins if you drive them direct. For that something like a Mega board has enough I/Os. If you use port expanders or multiplexing you would need fewer pins on the processor, but the rest of the circuit will be more complex.

You may want to look at the motor controllers from Pololu. Some versions control up to 3 motors and use I2C which would use fewer pins.

1 Like

Just use an I/O pin to connect the terminal to ground (as does the switch).

Make sure that

  1. the current to ground does not exceed the recommended maximum for your microcontroller (20 mA for the Arduino Uno, 7 mA for many others).

  2. the voltage applied to the input does not exceed the microcontroller operating voltage, usually either 5V or 3.3V.

1 Like

Then I'd suggest an H-bridge (typical DC motor controller) module for each valve. If you don't want a Mega with enough pins to control so many modules, a single decoder/demultiplexer can be used to select one of the valves, e.g. 74154 as 4->16 decoder, and a single GPIO pin to control the direction of the selected valve.

1 Like

The wrong voltage on the COM or switch pins could destroy the Arduino.
I wouldn't buy that board without having seen it's circuit diagram.
Unless you have the experience to produce that diagram yourself.
Leo..

1 Like

What is the valve motor's voltage and current ratings? Post a link to the valve's datasheet or it's brand name and EXACT part number.

From this image on a $2.42 Alibaba part:


and the other images on the very same item, they all had different part numbers and circuits

In the ad's movie where the switches appear to be powered by the board, it drives a motor back and forth between limit switches:

Because the part numbers, board layouts and jumpers on the very same ad are all different, I don't think you could trust any circuit you could find. Or that you'd get parts that matched a particular circuit/picture.

Do you actually have a board where you can read part numbers? In one of the pics, the small chips looked like "817" optocouplers, but since the switches appear to be board powered, maybe the circuit is bypassing any optocoulers and supplying the key/button contact terminals from it's on-board regulator?

$2.42 is pretty cheap, but you pays your money and you takes your chance.

2 Likes

would you require remote monitoring of the site? if so you will require some wired or wireless connectivity?
does the site have WiFi?

1 Like

Hello henxan

Welcome to the world's best Arduino forum ever.

Why do you want to use this additional hardware?

An Arduino can also take over this task completely.

An Arduino NANO has 30 I/O pins that can be used for this task.

Have a nice day and enjoy coding in C++.

1 Like

If you are just driving the motors in one direction or the other , the simplest solution is to simply use a 2pole relay to reverse the supply to the motor .
If your motors are being powered in groups ( ie open/closed at the same time ), then that can be done with a single output for each group

There are examples on line as how to do this .

Example

1 Like

Wow, what an incredible response!

I wrote the post just before going to bed, so as not be kept awake thinking about the project. :rofl: Thanks for the input BTW!

It's a bit chaotic trying to reply to each commenter, since there are so many. Instead I'll just try to answer the following:

  • General description of project philosophy, as this influences the design
  • Motorized valve specifications
  • Module/board specification

Description of project and design philosophy
My general design philosophy is designing as simple as possible. I was thinking of buying cheap parts, i.e. via Aliexpress, and have a stock of reserve/back up components in storage. If a motorized valve breaks, or if a circuit stops working, I should be able to change it out effortlessly.

There are two reasons for dividing up in more zones with individuel valve control:

  1. Plots and areas within plots will be divided up depending on water requirement, i.e. smaller pots require less water, some seedlings require less moist soil, some seedlings have foliage that both blocks out rain and perspirates more thus requiring more water.
  2. While drip nozzles don't steal a lot of water and pressure, if you have 40-50 points on one line, you will have a large pressure drop and lower pressure towards the end. Thus there is a limit to how many watering points I can have on each line.

I have around 500 seedlings at the moment, so I will probably require at least 20 valves.

Also, there was a question as to if I need several lines to be active at a time: No, I plan on activating and watering one zone at a time. This is regarding the water pressure consideration I mentioned earlier.

Motorized valve specifications
I plan on using ** this ** or equivalent motorized valve.

It has this schematic:
s-l400

And these specifications:

Module/board specifications
The card I was looking at, was the SD0802-ZF. It has a jumper which can be moved to select either Self-Locking mode or a Jog mode. As the switches K1 or K2 are pressed, the polaritiy locks in respectively forward or backward direction. Moving the jumper, and K1 or K2 will lead to energized output in forward or backward direction only as long as the buttons are pressed.

You can se the item HERE.

Concluding remarks
I'm open to alternatives and different solution to the module shown. However, I'm sceptical to using wifi or other wireless solutions to control the units directly, so a totally wired solution is preferrable. I was thinking of using 12V for my system, though up to 24V is an alternative.

Again, thanks for input and responses! :blush:

I see, as several commenters like @oldcurmudgeon and @DrDiettrich and more suggest, I should probably go with a reverse polarity H-bridge. This seems to be relatively cheap components from even reputable brands.

3 Likes

So, I decided to order some samples - a motor actuated valve and a couple of different DC reversible motor controllers.

I hooked up one of the motor controllers and cobbled together a circuit.

I used two NPN-NO transistors as switches for grounding either forward signal or reverse signal (start forward and start reverse respectively -- see post #11). I connected the gates w/resistors (don't know if it was necessary) to digital ports 7 and 13, and made a simple loop script to alternate between forward/reverse signal.

So, my proof of concept worked! There might be (or probably are) much more elegant and sophisticated solutions -- but hey, it works!

I'll need 1 digital out for each motorized valve -- i.e. 10 valves = 10 digital outs -- and one common digital out for closing all the valves, as only one valve should be open concurrently. So i.e. 10 motorized valves would require 11 pins/outputs. :blush:...

Hi, @henxan
Looks good, glad you have got a successful POC.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
A schematic is worth a thousand words.

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

1 Like

Hi, thanks!
@TomGeorge

Is this sufficient? :slightly_smiling_face:

I've settled on cheap Aliexpress components - arranging everyting according to easily replaceable units. I've bought 14 pcs of cheap motor drivers. They are branded as HSW M151 Bestep - but there is absolutely impossible to find any info on them. They seem to be a cheap copy of TKS-M8 motor driver.

The mounting holes are even not placed like the original, with one hole even bein skewed to the side! :rofl:

But, hey! They are cheap!

I've decided going for 2x arduino mega 2560 v.3 (One is planned as backup). I've made, and I'm going to order, 10x the following PCB I made - which specifically conforms to my cheap Aliexpress motor drivers.

I'm buying 12 cheap edge connectors which specifically suits the PCB/Card I made, and I'm starting with 6 individual drivers (maybe leaving space for 2 more for the future).

Using the edge connector card I've designed, failing units may be exchanged quicly and easily.

I'm supplying the valves/motor valves with 12V current. I've read some advice about lowering the current for the Arduino to 8V? I've already got a cheap voltage converter laying around, and may buy another one as backup. An AudioWind A-210 ver.1.0.

One thing I'm not sure about, is how to easily exchange the arduino mega if it should fail. I'll have a look online to see if someone have made an edge connector.

Well, that was a status update. Hopefull I'll be able to report some progress later :blush:

Phillips decided to produce TVs in the eighties with edge connectors, for easy module replacement. The thing that failed all the time were the edge connectors.
Leo..

Ok, but what failed? If it was the soldering between the edge connector and the board, it is quite irrelevant in this case, as I'll be using edge connector slots with screw fasteners and eyelets/wire holes for soldering - like this one.

A lot of products use edge connectors, and I believe they are pretty reliable...

Intermittent bad contact between circuit board and connector. Vibration could trigger that. Some fingers that carried current eventually burned out. Must add that the board fingers were tinned, not gold plated. Replaced maybe thousands of those edge connectors as a TV tech, only to have them fail after two years again. Then I just soldered the cards to the connectors. No problems after that.

Have a look at "screw shields". Could be a better option.
Leo..

1 Like

Hi!

Really appreciate the input!

I've already give a bit of thought to the possibility of bad contacts, but this advice have made me go a bit further.

As you may have noticed on the 3D PCB image I posted in my last reply, I had already used two edge connectors on each lead on the DC+ and DC-, and it will see a max of 0.8A I believe. This is what carries 12V. Other connectors going in and out of the board are max 5V.

However, a good connection should be maintained all over, thus I've revised my board even further, doing 2 pins for each input/output on the edge connector. Additionally, I've added a LED, such that I can see power being supplied to the board.

Btw, edge connector pins on the rear of the card will be removed, and have no function.

Edit: Btw - I'll of course be using gold plated connectors on en edge connector PCB :blush: