Water Controller Project

Hi everyone,

I have officially embarked on my Arduino journey. I recently purchased a Mega2560.

I probably have a slightly ambitious project for my first, but that’s what friends are for :wink:

I am making a controller to control 6-8 peristaltic pumps to deliver nutrients and pH balancers based on quantity of water delivered to the reservoir measured by a flow meter and controlled by a solenoid.
There will be 2-4 sensors; Electrical Conductivity, pH, and if I am able to control atmosphere as well then a humidity and temperature probe as well. There will be a pump in the reservoir to feed a line monitored by another flow meter. This line will have individual solenoids for each pot. There are 20 pots.

So I have a number of questions, one being for wiring. I plan on using the 10A relays and powering everything via ATX power supply except for the main reservoir pump. I’m planning on wiring the peristaltic pumps on a parallel circuit, as well as the solenoids on their own parallel circuit. Is this an ok idea? I can include a diode or 2 if that’s necessary. Power supply should not be an issue based off my calculations.

As for the peristaltic pumps, I would much prefer to run them with stepper motors. Though I don’t even know if it’s possible with the amount of I/O ports? with 4 wires each on 8 pumps, that would be possibly 24 wire connections taking an I/O terminal. This is an area I am very unclear on, as I don’t have any experience with steppers. I know that I have 54 IO available and if I’m correct then I’ll have 24(steppers) + 23(solenoids) + Main pump = 48 used with 6 left for float switches and thermal control.

I appreciate any words of wisdom, advice or criticism. I’m a mechanical dude, not an electrical guy so this project is a lot to take on. Though everything I’ve been learning has been causing me to fantasize about the possibilities.

If there’s an interest in the project, I’ll be sure to detail everything for others to learn.

-Andrew

As stepper motors seem to be a big part of the project, start by reading here. http://www.arduino.cc/en/Reference/Stepper

What do you mean by

"I'm planning on wiring the peristaltic pumps on a parallel circuit, as well as the solenoids on their own parallel circuit."

If connected in parallel, they will all operate at the same time.

Weedpharma

you have a whole lot of 'what if' going on.

eliminate so confusion. create a drawing of your project with all the bits and pieces. label everything.

create a table for what is a digital or on/off input , what is digital output, analog input, analog output, serial input, serial output.

sounds like you have :

8 pumps, all digital outputs. stepper preferred, relay as alternate flow meter, either analog, digital, or serial input solenoid, digital output 4 sensors (un-known) either analog, digital, or serial input reservoir pump - digital output reservoir flow meter - either analog, digital, or serial input 20 solenoids - digital output

clear this up with your sketch and table. label each as you will have to address each one in software that some sort of name.

================ as for steppers, much easier than you think.

first off, a peristaltic pump that will only move one way, only needs one line from the Arduino to run the pump. typically one has a step output and a direction output to run a stepper. but since your pumps will only pump one way, you never need to reverse the motor. ergo, you only need to output on one pin, a step or pulse output to run one motor. the direction is set and not changed.

a preliminary review and you can put the 8 steppers on one pin each you have 4 analog inputs

you can run all 20 solenoids from 4 output pins on an SPI bus

I love seeing water projects on here. I've done quite a few myself.

The mechanical part is the fun part. The headache is electrical and bringing the coding together on such a complex problem. If you are just getting started on a project like this, I would recommend cutting it up into tiny pieces and tackling one thing at a time. Each component of this has its own areas where errors occur. If you put it all together too quickly, you'll have no idea where the problems are, and won't make progress.

Also, by starting with small pieces, you will redesign the end product several times.

You'll want to start by pumping water, then pumping while measuring flow and printing to serial. Verify that the measurements are correct. Always start with one pump. Adding pumps and motors is easy and starting with one is easier to debug.

Here is a transistor array for controlling up to 8 relays: http://www.digikey.com/product-detail/en/ULN2803AN/296-19046-5-ND/863867 These have diodes in them, so you don't need an extra part to block "back voltage" (I forget the correct term).

With so many mechanical components, you are going to want to test whether they are actually running. You do this by measuring current. I've used this for AC pumps http://www.digikey.com/product-detail/en/ACS714LLCTR-20A-T/620-1226-1-ND/1790082 and Sparfun makes a breakout. I believe it can be used for DC. This way, you can trigger an alarm if a pump fails.

Good luck!

dave-in-nj: first off, a peristaltic pump that will only move one way, only needs one line from the Arduino to run the pump. typically one has a step output and a direction output to run a stepper. but since your pumps will only pump one way, you never need to reverse the motor. ergo, you only need to output on one pin, a step or pulse output to run one motor. the direction is set and not changed.

This would be if you were using an external stepper motor driver which I would highly recommend. I have used the EasyDriver in the past and would recommend it. You can hardwire the direction line as Dave noted. That said, I would wire up the sleep line on each controller so you can turn off the holding torque. Otherwise you could easily overheat your pump motors. You may be able to use a single sleep line for all the pumps depending on how you plan to run them.

jroorda makes a good point. idle, a stepper driver will either maintain full current or as I suspect, will time out to a reduced holding current. of course depending on the driver.

before selecting a driver, the pump needs to be selected. motor current then allows a choice of drivers.

Thank you everyone for your advice!

jroorda:
This would be if you were using an external stepper motor driver which I would highly recommend. I have used the EasyDriver in the past and would recommend it. You can hardwire the direction line as Dave noted. That said, I would wire up the sleep line on each controller so you can turn off the holding torque. Otherwise you could easily overheat your pump motors. You may be able to use a single sleep line for all the pumps depending on how you plan to run them.

This is the option I am moving forth with. I ordered myself a pair to play around with to be sure.

pekasus:
I love seeing water projects on here. I’ve done quite a few myself.

The mechanical part is the fun part. The headache is electrical and bringing the coding together on such a complex problem. If you are just getting started on a project like this, I would recommend cutting it up into tiny pieces and tackling one thing at a time. Each component of this has its own areas where errors occur. If you put it all together too quickly, you’ll have no idea where the problems are, and won’t make progress.

Also, by starting with small pieces, you will redesign the end product several times.

You’ll want to start by pumping water, then pumping while measuring flow and printing to serial. Verify that the measurements are correct. Always start with one pump. Adding pumps and motors is easy and starting with one is easier to debug.

Here is a transistor array for controlling up to 8 relays: http://www.digikey.com/product-detail/en/ULN2803AN/296-19046-5-ND/863867 These have diodes in them, so you don’t need an extra part to block “back voltage” (I forget the correct term).

With so many mechanical components, you are going to want to test whether they are actually running. You do this by measuring current. I’ve used this for AC pumps http://www.digikey.com/product-detail/en/ACS714LLCTR-20A-T/620-1226-1-ND/1790082 and Sparfun makes a breakout. I believe it can be used for DC. This way, you can trigger an alarm if a pump fails.

Good luck!

I agree with you fully. Mechanical is always the fun part :wink:

Thanks for the advice! I’ve never known of these current transducers. More research to be done.

dave-in-nj:
a preliminary review and you can put the 8 steppers on one pin each
you have 4 analog inputs

you can run all 20 solenoids from 4 output pins on an SPI bus

I’ll have to look more into this. Good to know though!

dave-in-nj:
you have a whole lot of ‘what if’ going on.

eliminate so confusion.
create a drawing of your project with all the bits and pieces.
label everything.

create a table for what is a digital or on/off input , what is digital output, analog input, analog output, serial input, serial output.

clear this up with your sketch and table.
label each as you will have to address each one in software that some sort of name.

You are completely right. I attached a rough plumbing schematic to clarify. I will further organize as things become relevant. My first post is indicative of my thought process. You could call me a scatter brain. :wink:

weedpharma:
What do you mean by

“I’m planning on wiring the peristaltic pumps on a parallel circuit, as well as the solenoids on their own parallel circuit.”

If connected in parallel, they will all operate at the same time.

Weedpharma

I will have relays between each complete loop in the parallel circuit. I’ve ruled this as fine because my components don’t draw a whole lot of current.

Again thanks for all the responses! I’ll make sure to detail my struggle. ;D

P.S. The schematic is not accurate for the number of nutrient bays or pots to feed. I also left out a solenoid at the end of the watering loop before the reservoir by mistake.

Gardener System.pdf (142 KB)