Need some ideas for using a plethora of solenoids

I am slowly building a hydroponics garden controller project that will one day control a fairly large scale operation. With that said, I’ve found that it’s best to plumb everything so to have a system of hoses that feeds to each site, but also receives waste and directs that to the waste line. If you can imagine a room with 20 plant reservoirs, well my method is to plumb everything in such a way that it’s all connected together in series. Water/nutrients are directed to the desired output by means of turning a shutoff valve. I am wanting to build a controller that will use solenoid valves to control what is open, when, duration etc. The way I see it, each site will controlled by 4 solenoid valves. There will be roughly 48 sites so that’s a total of 196 solenoids that will be needing choreographing.

My project now consists of an EtherMega that has an RTC and a climate sensor built in. Based on time or climate, relays (8 chan SainSmart) are opened or closed which in turn represent AC devices. Here’s some pics of my project to date, and everything works great ATM. At some point I do want to get my project online, hence EtherMega, but finding an easy to follow example is proving rather difficult so I want to move on into other intended additions to this project while simultaneously still researching the networking of things. With that said, I have broken this project into manageable phases and will work on each new phase when I complete a previous one. I also wish to point out that I am very new to Arduino and coding. It is my project that has brought me here, and what I have been mostly using to learn with. I know some would have me devote years to mastering the example sketches and circuits before even attempting to begin building my project, but I have found that to be counter productive.

What I hope to accomplish in this thread is to generate some approach ideas of possible ways to accomplish use of so many solenoids. I’m guessing some kind of array may need to be used to identify all the valves, but am still wet behind the ears and need the feedback. If anyone can, suggestions to some decent quality solenoid valves would be great as well. Ultimately, the Arduino should be able to target a specific site and send water to that site, or have the water that is already in that site’s reservoir pumped into the waste line without pumping those spent nutrients to another site. I am now thinking I will need yet more valves as the sites can be subdivided by which row each happens to be in (headrows in a field). This should make specific identification easier IMO.

At any rate, thank you in advance for any/all feedback. My sketch is also attached



TIMEorCLIMATEswitching.ino (8.74 KB)

Are you growing "tomatoes"?

You will have no choice but to learn programming as no one will have a program for your project.

Weedpharma

I completely understand that I need to "know" everything that's going into my project. I just find the wax on wax off method of learning to be counter productive to the way I want to live my life. My project has taught me what I need to know to build it. That which I will add to it, I have yet to learn, but I will. All of what I want to get into this project, I have at least generally researched, but upon that reading, I realized that what I want was pretty complex and would require a lot of coding knowledge and also circuit building knowledge. That's when I knew it needed to be split into phases.

I grow cannabis, but I promise this project will be shared with every gardener for free. I get my rocks off learning something, and teaching it to the next man in half the time if possible. My philosophy in life is to be the best I can for my community, that each can enjoy life that much more. This what I mean when I say that's not how I wanna live my life. I learn this because this project needs me to, but ideally, it would have already been built by someone else that lives by the same principles as I.

I'm just fishing for ideas to help my project along.

DDC can mean direct digital control, or distributed digital control.

you said 20 reservoirs. and 196 valves.

have you sketched out the layout of water and valves and tables and such ? would it be conducive to have a distributed network so that each reservoir has one NANO or UNO and then the 10 solenoids ?

it would seem a lot easier to have one panel with all the needed bits, control one reservoir, and then make 10 or 20 more panels just like it.

you could control the whole think from your master box,.

it would mean a program that would be just rubber stamped to each additional box.

another benefit is that each box would get one cable and control the relays. the hoses would be local as would any of the wiring.

lastly, what's up with the dual receptacles ? are you using line voltage solenoids ? the dual receptacles layout is a huge waste of space, and you probably can get .24vac solenoids. think underground sprinkler

instead of plugs, you could have a screw terminal bar or even plug in connectors.

your project screams distributed.

if you have one control box, 196 solenoids, that means you will need a LOT of wire running to each reservoir. if you have local control, controlled by a master unit, of just make each local one completely independent. the wiring and piping will be much less and will be much simpler.

have you looked into dosing pumps ? you can trickle nutrients into the pump and the pump will then have the water pushed where you want it ?

rant mode = HIGH; more lives have been saved and lost by firearms than by cannabis, but cannabis is not currently legal in the USA, nor is it protected under the Constitution your endeavor is currently being overlooked by the authorities, but still in violation of Federal Law. .but political winds change. IMHO, cannabis, alcohol and tobacco have no redeeming quality for humanity. Many on here express their political view when it comes to using an Arduino to re-load fire arms. but that is a political point of view. your endeavor however, is currently against Federal Law. I just wanted to point that out. rant mode= LOW;

Thanks for the feedback Dave, and though I do acknowledge that cannabis is currently "frowned upon" by the federal government, I will not pretend that I am holding myself to their admittedly outdated standard. I happen to know some information about the govt as a whole, as well as what this plant means to the human race, but this is definitely not the place to discuss either.

As far as my project, I am coming to grips with the fact that I will likely need more arduinos to manage everything. However, my initial intent was to make this project as cheap as humanly possible for the simple fact that it's not that much of a stretch to assume that someone that grows his own medicine might not be rolling in dough, despite the market potential. So with that said, and upon further research, I am finding that when I get into monitoring PH and EC, this project is going to become very expensive, so if I can trim costs, I will. I used 20 sites as a poorly placed example. In actuality I am planning for 48 bloom sites. Each site will require minimum of 4 solenoid valves. I am also thinking that because all of these sites are in rows, that I can use just a little bit more hose and make a stretch of my plumbing circuit in parallel. This would allow me to more easily pinpoint specific sites. Generally, for water movement, I use cheap AC driven 160 GalPerHour pumps. All that is now needed is the control inside that plumbing circuit that would enable me to say that only 12 gallons will get pumped from Source to site B3, or D2 etc. The Arduino would then open the respective valves while closing other respective valves to accomplish the task. Once this has been grafted into my sketch, I will then look to adding peristaltic pumps (dosing pumps). This is the delivery system for nutrients and supplements and amendments. This is how I aim to gain in precision and I greatly feel that once I am able to tweak the feeding regimen this way, that I will be able to formulate programmable nutrient recipes which would produce a plug and play result.

myggle: Thanks for the feedback Dave, and though I do acknowledge that cannabis is currently "frowned upon" by the federal government,

it is a Federal LAW, it has every bit as much weight as murder or worse, tax evasion.

since the moderators do not mind us helping criminal use of this site, we will keep posting.

myggle:
that someone that grows his own medicine might not be rolling in dough,

medical use would not be more than a couple plants, certainly no need for a vast array of solenoids.

also, no need to have most aspects of ph and such monitored by automation. especially when a very tiny plot of half a dozen plants are involved.

For the sake of this discussion, I informed you that I grow cannabis out of kindness, not obligation. I am not here in an Italian micro controller coding forum seeking botanical, medicinal or current American federal rules advice, I am merely seeking ideas of how I might add the use of 200 solenoids into my already built and functioning project. I don't mean to sound rude or unappreciative but can you remember the last time you went to your lawyer seeking spiritual advice, or a cop seeking race relations advice? I wish to end the topic of cannabis production in this thread and get back to what I originally asked.

What I hope to accomplish in this thread is to generate some approach ideas of possible ways to accomplish use of so many solenoids.

I believe I have been direct.

create a layout of a simple bath controller,

solenoid, fertilizer,m sensors,

make is stand alone,

then see if trying to get one to do more is better than getting a more distributed version to work.

my view is that a simple, stand alone batch controller is viable.

adding in connectivity adds that layer od expansion.

sell some then buy a allen Bradley plc 5 complete rack including processor used of ebay with 13 digital 110v output cards might set you back 200 bucks. borrow a copy of ladder logic and go to town. Maybe add a second rack with out the pc to do some inputs, flow meters and sampling.

or think about the valves and consider there are a lot of valve designs that are not just open or closed.

gpop1: or think about the valves and consider there are a lot of valve designs that are not just open or closed.

throttling valves with minimal hysteresis are expensive !

I wanted to do some research before I ordered any valves, but I had my eye on the adafruit 12v solenoid valve. Assuming my water pump can generate the min water pressure of 0.3 psi, I think a simple open/close valve will produce the result I want. I just looked at a batch controller and they start at $200. Also, the PLC option looked very expensive. When comprehending the spans of grow area, and the distance from a controller to the farthest site, it would equate to about 10 meters of wire if everything routed back to a single controller. So perhaps now is the time to plan to use slave arduinos as well.

The plumbing circuit would work by first setting the solenoids to the desired state, then activating the water pump in the source. The water will go everywhere it can while it has power, I just need to plot the route and provide adequate on time.

dave-in-nj: throttling valves with minimal hysteresis are expensive !

sorry it was a bit misleading. I was thinking off 2 or 3 way valves built into a manifold that way one valve can replace multiple valves.

myggle: I wanted to do some research before I ordered any valves, but I had my eye on the adafruit 12v solenoid valve. Assuming my water pump can generate the min water pressure of 0.3 psi, I think a simple open/close valve will produce the result I want. I just looked at a batch controller and they start at $200. Also, the PLC option looked very expensive. When comprehending the spans of grow area, and the distance from a controller to the farthest site, it would equate to about 10 meters of wire if everything routed back to a single controller. So perhaps now is the time to plan to use slave arduinos as well.

The plumbing circuit would work by first setting the solenoids to the desired state, then activating the water pump in the source. The water will go everywhere it can while it has power, I just need to plot the route and provide adequate on time.

used plcs are cheap as they are upgrading the old 5's as they are no longer being supported. That way distance is no longer a problem.

arduino could do it but its going to require mosfets or relays

myggle: I wanted to do some research before I ordered any valves, but I had my eye on the adafruit 12v solenoid valve. Assuming my water pump can generate the min water pressure of 0.3 psi, I think a simple open/close valve will produce the result I want. I just looked at a batch controller and they start at $200. Also, the PLC option looked very expensive. When comprehending the spans of grow area, and the distance from a controller to the farthest site, it would equate to about 10 meters of wire if everything routed back to a single controller. So perhaps now is the time to plan to use slave arduinos as well.

The plumbing circuit would work by first setting the solenoids to the desired state, then activating the water pump in the source. The water will go everywhere it can while it has power, I just need to plot the route and provide adequate on time.

consider a nano at the end of a row. one main water connection. on this put the flow meter and nutrient injector one solenoid, maybe more 2-4 sensors per solenoid ? since you only run one solenoid at a time, the flow can be pure water or nutrients. if you water in sequence, you can stop adding nutrients, then switch valves. wireless can handle 10 meters ? very cheap. if you do not want to have wireless, make it a plug in option. as for valves, there are geared motorized valves available. a bit more is needed to work them. you could I2c them, 2 wires, and lots and lots of valves. you could run a shift register, 4 valves, 4 pins......

Wireless is attractive, but in the grand scheme of things, will it be cumbersome in code and RAM? I like the I2C option because I already am using that library. Would wireless require another library to function? When I get into adding the nutes in, I was aiming in the same direction, ie direct injection into the master feed line, this way nuted water can be sent to all reservoirs in a row, or specific reservoirs in specific rows, or every variance between. I'm still hoping to manage things from the Mega, but only because I fear that splitting chores apart might lead to problems and the solenoids would need to work with all the feed pumps 3 times a day to allow for vertical water movement from res to plant while isolating all sites from one another. So the East/West valves would need to be closed and the North/South valve left open.

(Side topic), has anyone ever read up on RESTful API? I am also investigating possible ways that I can get RTC and sensor readings and also pin states for my relays sent and posted to my PHP website that is hosted on HostGator. The site is built with WordPress, and I found a plugin called WP-REST API, so hopefully the project can link up with my site in this way. If my site can't be used, I will be in the market for a site that I can own that can be used in this way. I want this project to have an LCD of sorts, but also to have remote access, so a website could give me both, just gotta find the right one I suppose. I've looked at all the other API sites like Temboo, ThingSpeak, Xively etc, and though they all have a lot of functionality, but they are very limited in scope which makes them even less customizable for our applications.