Billie's Hydroponic Controller

I've also made a new videoclip. Turn up the volume though, then you'll hear the pumps turning on and off...

Looks good, but I don't think Steven Spielberg has anything to worry about :slight_smile:


Rob

Funny...Just had a meting with Mr. Spielberg about this...In 2018 the new clip comes out. I can say that the soundtrack will be awesome!! :wink:

Can't wait, he does good stuff.


Rob

Wow Billie this is so cool..

I'm planing to monitor hydroponics over the internet. I bought the arduino mega328 and the ethernet shield.. Where do I start with? Can you give the steps on which area should I work on? Any help is so much appreciated.

Thank you

Hey Sunmark14,

I'd start with gathering all the required hardware to monitor. The big question is 'what' you want to monitor/control.
The hardware i used came from Ebay except for one part. Thats the Phidgets 1130 pH/ORP module. If your from the US, getting one shouldn't be a problem. If you live in Europe, you'll have to look a bit harder :wink:

These are the parts i used...

Arduino Mega 2560
Aquarium Peristaltic Dosing Pump head
pH Electrode Probe
Phigets 1130
4 Channels 5V Relay Module for Arduino
Pressure Solar Water Heater Dedicated 12V Solenoid Valve
DHT11 Temperature & Humidity Sensor Module
20PCS Photoresistor GL5539 LDR Photo Resistors Light-Dependen?t
3.2" TFT LCD Shield + Touch Screen TF SD Reader
2x Gray Duckbill Side Water Level Sensor Liquid Float Switch
SD Card Module Slot Socket Reader For Arduino
14pcs 2X40Pin Double Row 2.54 breakaway Male header
I2C RTC DS1307 AT24C32 Real Time Clock Module
5 PCS Bread Board Prototype proto Board 10*20cm
DC 9V/1A Power Supply For Arduino

After you acquired the parts you need, check out the code i wrote. Almost everything is made up in blocks, so if you don't need the LCD...you can leave out the graphical and touch functions. And the logical part will still work. Tip also remove the call to those functions in the void setup() and void loop().

Have fun and remember...If you improve on this design please post it back here :wink:

Any chance of some more detailed instructions?

How are you changing the temperature, I guess you can only monitor that? How are plants watered?

No, Temperature and Humidity are controlled via a bank of fans. Ten in total, which are turned on via one of the relays.
The total amps for the fans is about 8A. And this includes the spike when the fans are turned on.
The control for the fans isn't picture perfect, but will be rewritten when I have the time for it. The problem with the temp/humid control is that there's no hysteria, so if the temp/humid swings around the setpoint the relays will turn on/off quite fast and then there's a chance that they burn out...

More detailed instructions then already provided will not be made. I think that the provided information should be enough to build one yourself. I've included the schematics for all the sensors, where I bought them and provided the code... The rest, how you actually solder the parts you can find out for yourself...just ask Google and it will provide...
The most difficult thing was writing the pH control algorithm, since I'm not a programmer. And that's provided in the beginning of the post :wink:

I might be persuaded to build one for you, but that's gonna cost you... :stuck_out_tongue:
Hey...isn't figuring out these things not part of the fun in playing with Arduino???

Don't forget...Have fun and if you run into trouble while building one, just ask your question here and I will try to answer you as good as I can... :wink:

BillieBricks:
The problem with the temp/humid control is that there's no hysteria, so if the temp/humid swings around the setpoint the relays will turn on/off quite fast and then there's a chance that they burn out...

BillieBrick

I had this same problem in designing my aquarium/aquaponics monitor except in my case the issue was with my float switches which controlled my pumps via relay. With the water moving it would cause waves in the tank causing my float switch to go up and down turning on and off my relay constantly. The medicine to this problem is in the blink without delay example code http://arduino.cc/en/Tutorial/BlinkWithoutDelay. Basically what I did was made to variables for each pump one that records the last time the float was high and then one that records the current time the float was high and then previous - current > 5 sec turn on pump. I also included an if else that say if float is low reset previous. If you have any question or want some example i can dig it up and help you out just pm me.

superman:
BillieBricks

I had this same problem in designing my aquarium/aquaponics monitor except in my case the issue was with my float switches which controlled my pumps via relay. With the water moving it would cause waves in the tank causing my float switch to go up and down turning on and off my relay constantly. The medicine to this problem is in the blink without delay example code http://arduino.cc/en/Tutorial/BlinkWithoutDelay. Basically what I did was made to variables for each pump one that records the last time the float was high and then one that records the current time the float was high and then previous - current > 5 sec turn on pump. I also included an if else that say if float is low reset previous. If you have any question or want some example i can dig it up and help you out just pm me.

Thx for the input! Yet I think the problem I have is slightly different then your situation. You are using time to prevent the relays from burning out and I'm using temperature and humidity.
For example: Let's only use the temperature for this one... I set the set point for the temperature at 25°C. So when the temperature reaches 26°C the fans will turn on. Resulting in the machine registering the temperature drop to 25°C, but actually it is 25,9°C. The fan's stop working and almost immediately the temperature registers 26°C and everything starts over again.
Now with a hysteria you have a set point (25°C) and a deviation or hysteria (value the setpoint can deviate). So this would result in (assuming the set point is 25°C and the hysteria being 2°C) that the fan's turn on at 26°C and turn of at 24°C (actually 24.9°C), giving the machine a whole 1,1°C to climb before the fan's are turned on again...

Both have their advantages and disadvantages. I could be wrong off-course :wink:
Your idea is nice thinking by the way :wink:

I have a question for you...How many float switches do you use in your setup?
I've got two...one on the bottom and one on top. When the top one is 'LOW' the machine registers this, but doesn't do anything, other then displaying 'Tank Half Full' (we're optimistic like that :wink: ) Only when the bottom one is 'LOW' the solenoid valve is turned open. This remains open until both float switches are 'HIGH' again. Meaning the nutrient tank is full...

Oh and of course I've read the article 'blink without delay' which gave me a headache before I got around it... :fearful: Still have to use the base code to start from, I'm ashamed to say :fearful:

BillieBricks:
Thx for the input! Yet I think the problem I have is slightly different then your situation. You are using time to prevent the relays from burning out and I'm using temperature and humidity.
For example: Let's only use the temperature for this one... I set the set point for the temperature at 25°C. So when the temperature reaches 26°C the fans will turn on. Resulting in the machine registering the temperature drop to 25°C, but actually it is 25,9°C. The fan's stop working and almost immediately the temperature registers 26°C and everything starts over again.
Now with a hysteria you have a set point (25°C) and a deviation or hysteria (value the setpoint can deviate). So this would result in (assuming the set point is 25°C and the hysteria being 2°C) that the fan's turn on at 26°C and turn of at 24°C (actually 24.9°C), giving the machine a whole 1,1°C to climb before the fan's are turned on again...

I didn't think about analyzing the standard deviation and then setting that for my trigger value. I like that idea maybe that would be a better option for the point of processing and consistency. You can still apply the no delay blinking type program to your it would be slightly different you might want to apply the concept in both direction for turning on the fans and turning them off.

My question for you is
How long do your fans usually run? or how long on average does it take you to low your temperature 1 degree?

Why does your program register a temperature of 24.9 as 24? Why not keep that decimal? or if you are going to round round 24.0-24.4 to 24 and 24.5-24.9 to 25?

BillieBricks:
I have a question for you...How many float switches do you use in your setup?
I've got two...one on the bottom and one on top. When the top one is 'LOW' the machine registers this, but doesn't do anything, other then displaying 'Tank Half Full' (we're optimistic like that :wink: ) Only when the bottom one is 'LOW' the solenoid valve is turned open. This remains open until both float switches are 'HIGH' again. Meaning the nutrient tank is full...

My setup it slightly different because I have live fish in my main tank.
I have 3 tanks a 20 gallon which houses my fish (2 float switches a high and a low), a 10 gallon filter tank that filters large debris and converts the nitrites to nitrates through biological filtration (2 float switched high and low), and a 10 gallon refill tank that just holds water (2 float switches a high and a low).

Every 15 minutes during the daytime i run a cycle the water from main tank is pumped to the filter tank and then pump into my grow tubes, and drains to my refill tank that is pumped to the main tank.

That is the simple version of how my system works.

something you might be interested in would be

Advice is develop some kind of fail safe

Nice work on your project Billie! I had to go and order one of those touch screens. I really like how your interface looks!

superman:
I didn't think about analyzing the standard deviation and then setting that for my trigger value. I like that idea maybe that would be a better option for the point of processing and consistency. You can still apply the no delay blinking type program to your it would be slightly different you might want to apply the concept in both direction for turning on the fans and turning them off.

For the fans I'm going to use the principle that i stated. For the float switches I'm going to incorporate your idea. Water has the tendency to move so stabilizing this would be better... :wink:
In my pH algorithm the hysteria is indeed going both sides of the scale. That's because the pH needs to be stable at a certain setpoint and can deviate to both sides of the scale. Temperature and Humidity don't go both sides. If it gets to hot/wet then the fans need to be turned on, otherwise not...

superman:
My question for you is
How long do your fans usually run? or how long on average does it take you to low your temperature 1 degree?

This depends on the weather condition. If it's warm and the sun is shining, the fans will run more then when it's cool outside. That's why I'm using Temp/humid in stead of Time.

superman:
Why does your program register a temperature of 24.9 as 24? Why not keep that decimal? or if you are going to round round 24.0-24.4 to 24 and 24.5-24.9 to 25?

The program doesn't register that. It's the DHT11 probe that only measures in whole numbers in stead of decimals... I ordered the DHT22, which can measure in decimals, but that is for another application I'm currently working on. For the greenhouse/hydroponic set-up the DHT11 will suffice :wink:

superman:
My setup it slightly different because I have live fish in my main tank.
I have 3 tanks a 20 gallon which houses my fish (2 float switches a high and a low), a 10 gallon filter tank that filters large debris and converts the nitrites to nitrates through biological filtration (2 float switched high and low), and a 10 gallon refill tank that just holds water (2 float switches a high and a low).

Every 15 minutes during the daytime i run a cycle the water from main tank is pumped to the filter tank and then pump into my grow tubes, and drains to my refill tank that is pumped to the main tank.

So you use Aquaponics for growing your plants. I've looked into that idea, but didn't go that way because you don't know what levels of nutrient's one's giving the plants. I use HydroBuddy to calculate the 'perfect' amount of nutrients my peppers need to grow. Last season my plants grew to a hight of 3m40 until they reached the roof of my greenhouse :grin:

superman:
something you might be interested in would be
Liquid Level Sensor - 8" - SEN-10221 - SparkFun Electronics

That looks nice, but for that price I can buy myself twelve duckbill float switches on Ebay. So since I'm on a budget this is a no-go :wink:

superman:
Advice is develop some kind of fail safe

You have any ideas on that one? I also think that the failsave is more important for you since you have live fish. Plants are more forgiving if they don't receive the right treatment.

cyclegadget:
Nice work on your project Billie! I had to go and order one of those touch screens. I really like how your interface looks!

Good for you :smiley: There are a number of very nice people out there who wrote a library so writing the code for the screen isn't that hard to do. I've used the UTFT library from Henningkarlsen.com which worked perfect!!!

Byebye and don't forget to have fun while playing with your Arduino :wink:

BillieBricks:
You have any ideas on that one? I also think that the failsave is more important for you since you have live fish. Plants are more forgiving if they don't receive the right treatment.

i personally have not had the issue but with our float switches being directly in contact with water and chemicals you will likely have to deal with nutrient build up and myself having hard water issues and algea.
Others report that the switches get stuck so i guess clean them often. In my situation i cant have very much overfilling without having issues a possible idea is to take two pieces of wire seperated by small distance program them like a switch and mount them on the side of my tank if water overflows it should short and then turn off all pumps or whatever action.

I previously had some large tomato plants growing hydroponically but i didnt understand the manual pollination process do i had tons of flowers but no tomatoes. amatuer move

This is going way off-topic, but tomatoes need to have a humidity of 75 - 80% for the pollen to develop. Once the pollen are there it should be enough to shake the plant to pollinate :wink:

BillieBricks:
This is going way off-topic, but tomatoes need to have a humidity of 75 - 80% for the pollen to develop. Once the pollen are there it should be enough to shake the plant to pollinate :wink:

Yes it was the first time i really grew anything and i didn't understand the fact that i needed to shake or manually pollinate the plant. I now use an old electric toothbrush turn it on and place it slightly bellow the flower and watch the pollen move.

Let me throw an idea out
On the other hand I believe that the salt water aquarium people use there pH levels to monitor the concentration of their chemicals and to prevent overfilling from occurring. Watch this video starting at 4:50 Digital aquatics Reefkeeper Lite aquarium controller - Automate and protect your reef tank ! - YouTube Now in your setup if you do use an automated water top off to maintain water levels in your solution you will wont to monitor concentration of your solution. If you don't use a top off system you still want to monitor concentration (in case of evaporation) so you do not chemical burn your plants.

Hi Billie,

Just wanted you to know I'm quietly following all of this after asking early questions... Thanks for showing us so much!

superman:
Now in your setup if you do use an automated water top off to maintain water levels in your solution you will wont to monitor concentration of your solution. If you don't use a top off system you still want to monitor concentration (in case of evaporation) so you do not chemical burn your plants.

Great link to you tube you just gave me. I found the principle of fault tolerance in the float switches combined with the pH probe quite interesting...
I did implement an auto top-off function in my device, but this is just to make sure the nutrient tank doesn't become dry and kills the pump... The fact that the pH will become higher than desired is compensated with the pH control function, which adjusts it to the pH set-point... Then I still have a nutrient solution which is out of range, because no nutrients are added. But this causes the plants no harm on a short time basis (I'll still check my tank on a daily basis) and will be adjusted manually for now, until I incorporate EC monitoring and dosing, which is a part of the controller I'm going to build when the time is right (read, when I have the money for it...)...

terryking228:
Hi Billie,

Just wanted you to know I'm quietly following all of this after asking early questions... Thanks for showing us so much!

You are quite welcome! This is a problem I had when I first started with Arduino. Lot's of people who had more experience in programming then me pointing out that I made rookie mistakes and giving me pieces of pseudo-code which didn't make sense to me...Ok, I learned allot by trial and error, but I made a promise to myself that when I made this project available to the public it should be presented in such a way that someone with no programming skills could also build one...
Also came across some people who didn't want to share their code, which is kinda not done since everything is open-source and probably code they got from someone else on this forum...

So if you got questions about this device...Ask and you will receive. :wink:

BillieBricks:
Great link to you tube you just gave me. I found the principle of fault tolerance in the float switches combined with the pH probe quite interesting...
I did implement an auto top-off function in my device, but this is just to make sure the nutrient tank doesn't become dry and kills the pump...

In my case I was also worried about the pump burning out (I don't know how likely this actually is, but better safe than sorry) and so i placed my lower float switch slightly above the water level where the pump sucks air and use that float switch to turn on and off my pump.

One thing that i have been thinking about as a precautionary measure. Is to measure the amount of time it takes to top off my tank from its low position to full position when water is at its maximum pressure. So if it takes 5 minutes to fill tank say

if lower float switch is low
turn on water
reset timer to 0
start timer

else if higher float switch is high or time exceeds 5 minutes
turn off water

Can you post your latest code?
Are you still having problems with the calibration of your pH meter?
Did you have to calibrate your temp/humidity sensor?

Hi! Very interested in your project. But can not download the sketch. please refresh