Arduino Forum

Community => Exhibition / Gallery => Topic started by: BillieBricks on Nov 02, 2012, 11:27 am

Title: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 02, 2012, 11:27 am
Hello everybody,

As promised (http://arduino.cc/forum/index.php/topic,114452.0.html) i would post again on this forum ;)
As mentioned in the previous post i'm making a hydroponics controller, which can monitor and adjust pH, Temperature and Humidity. Write a log to SD card with the data of all the inputs plus the amount of light measured, tagged with the current Date & Time.
My build is nearly done. I'm currently at the stage where I'm testing it small scale...

Here is a video i made to show of the graphic menu. Something where I put quite a lot of work in...
http://www.youtube.com/watch?v=g84zggXvcSY&feature=player_embedded

Since I've began programming there where not to many people out there that where willing to share their code, that's a shame really...because it's all open-source...
So...I attached the code I wrote for this project. :D Use it, Mod it, do what you will with it ;)

Edit: It's written with Arduino IDE 1.0...
Title: Re: Billie's Hydroponic Controller
Post by: terryking228 on Nov 02, 2012, 11:53 am
Billie, This is a really nice project. Lots of people will be interested in doing something very much like this.

To help us, could you post some drawing/diagram of the input and output devices and how they connect to the Mega?

Also, exactly what display are you using, and what code/library do you use to drive it?

Did you research different pH sensors? What did you find? That's a key part.

Nice work!
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 02, 2012, 01:05 pm
Hey Terry,

I can draw a diagram on paper and scan it if you like, with CAD or Fritzing i'm not so good ;)
I'm using the Sainsmart 3.2" TFT touch screen. Ordered it from Ebay. It uses the UTFT and ITDB02_Touch library from Henning Karlsen (http://www.henningkarlsen.com/electronics/)
For the pH I'm using a Phidgets 1130 pH/ORP module, this has got a BNC connector where I can connect the pH probe (also ordered from Ebay) to. The pH probe (http://www.benl.ebay.be/itm/High-Quality-pH-Electrode-Probe-BNC-Connector-for-aquarium-PH-controller-Lab-/251124829815?pt=LH_DefaultDomain_0&hash=item3a7834ce77) itself is the cheapest thing I could find, because the primary idea behind this project was to make a cheap pH controller which wouldn't break my wallet ;)
I must say that the accuracy of the probe is more then enough for hydroponics use. It has got an accuracy of 0.02, which isn't to bad at all. After that was complete the implementation of all the other sensors was a piece of cake ;)

All other hardware and libraries are mentioned in de code, if you want to know...
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 02, 2012, 05:19 pm
Here is a 'simple' diagram of all the sensors.
(http://i893.photobucket.com/albums/ac134/BillieChillie/SchemaSensors.png)

The 3.2" TFT fits on top of the mega. But you only need to connect pins 2-6 for the touch, 22 - 41 for the display & connect GND, VCC and 3.3V
Then for the SD card...you can use pin 50 --> MISO, 51 --> MOSI, 52 --> SCK, 53 --> CS.
The RTC module...SDA --> pin 20, SCL --> pin 21
The four channel relay is pretty self explanatory ;)

Without the cables attached..
(http://i893.photobucket.com/albums/ac134/BillieChillie/2012-11-01131847.jpg)

And with...
(http://i893.photobucket.com/albums/ac134/BillieChillie/2012-11-02171523.jpg)

Greetings... ;)
Title: Re: Billie's Hydroponic Controller
Post by: graynomad on Nov 03, 2012, 01:07 am
Nicely done.

Very interesting to see the redraw times for those displays, not exactly lightning eh? I've got a couple of similar displays (not used yet) and have never been able to get a good idea of how fast they will be.

______
Rob
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 03, 2012, 10:29 am
Hey Rob,

If you check out the code you will notice that there's about one and a half second delay time. This affects the screens refresh rate also ;)
Title: Re: Billie's Hydroponic Controller
Post by: graynomad on Nov 03, 2012, 04:05 pm
Quote
there's about one and a half second delay time

But surely not in the middle of drawing a screen.

For example the function mainscr() does nothing but draw stuff, as indeed do all the functions that draw a screen as far as I can tell, and yet it's pretty slow. I'm just wondering if that's a common thing with these type of displays.

______
Rob
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 03, 2012, 11:06 pm
I guess it's the case with mine, but the refresh rate is fast enough for my application. So I'm quite happy :)
Today I connected all the sensors to the box and after some debugging...one VCC cable which had a bad connection...got it running.
(http://i893.photobucket.com/albums/ac134/BillieChillie/2012-11-03212219.jpg)

In front you see the pH probe and between the probe and the case is the photo-sensor encased in some plastic tubing.
(http://i893.photobucket.com/albums/ac134/BillieChillie/2012-11-03222614.jpg)

On the left side is a 'recovered' serial connector from an old pc. It houses the connection to the two float sensors and the photo-sensor. On the right hand side is the BNC connector for the pH probe. Between these is the SD card.
(http://i893.photobucket.com/albums/ac134/BillieChillie/2012-11-03222805.jpg)

Tomorrow I'll put the sensors in a small barrel (20L) and start building the dosing station so the next tests can be run...
Title: Re: Billie's Hydroponic Controller
Post by: almamater on Nov 09, 2012, 03:09 pm
Silly Question.. where do you found your project box? I want one box with transparent material in front but i dont know where to buy one (water resistance)
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 13, 2012, 08:39 pm
I ordered mine at conrad (http://www.conrad.com/Fibox-MNX-polycarbonate-case-MNX-PCM-150%2f150-T-Polycarbonate-%28PC%29-%28L-x-W-x-H%29-180-x-130-x-150-mm-Light-grey-%28RAL-7035%29.htm?websale7=conrad-int&pi=521104&Ctx={ver/7/ver}{st/3ec/st}{cmd/0/cmd}{m/websale/m}{s/conrad-int/s}{l/int/l}{sf/%3Cs1%3E521104%20-%2089%3C/s1%3E/sf}{p1/61198e485534be0173a8d80cbda6fdd4/p1}{md5/9c542c989de51739e0b573ff9fa52622/md5}). They got loads of different boxes. Mine is polycarbonate and has a moisture seal between the lid and box itself... As I'm going to install it in my greenhouse.

Oh, and i've got an update for the sketch...
Rewritten the pH algorithm. Which included incorporated 'smoothing' and a pulsing (on/off) effect for the dosing pumps.

Greetings... ;)
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 14, 2012, 08:05 am
I've also made a new videoclip. Turn up the volume though, then you'll hear the pumps turning on and off...

http://www.youtube.com/watch?v=bbRGrWuBp-Y&feature=channel&list=UL (http://www.youtube.com/watch?v=bbRGrWuBp-Y&feature=channel&list=UL)
Title: Re: Billie's Hydroponic Controller
Post by: graynomad on Nov 15, 2012, 05:05 am
Looks good, but I don't think Steven Spielberg has anything to worry about :)

______
Rob
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Nov 15, 2012, 11:09 am
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!! ;)
Title: Re: Billie's Hydroponic Controller
Post by: graynomad on Nov 15, 2012, 02:06 pm
Can't wait, he does good stuff.

_____
Rob
Title: Re: Billie's Hydroponic Controller
Post by: sunmark14 on Nov 23, 2012, 06:09 am
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
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Dec 01, 2012, 06:10 pm
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 ;)

These are the parts i used...

Arduino Mega 2560 (http://arduino.cc/en/Main/ArduinoBoardMega2560)
Aquarium Peristaltic Dosing Pump head (http://www.benl.ebay.be/itm/Aquarium-Peristaltic-dosing-pump-Head-Marine-Magic-/280955598728?pt=LH_DefaultDomain_0&hash=item416a423788)
pH Electrode Probe (http://www.benl.ebay.be/itm/High-Quality-pH-Electrode-Probe-BNC-Connector-for-aquarium-PH-controller-meter-/270987262193?pt=LH_DefaultDomain_0&hash=item3f181978f1)
Phigets 1130 (http://www.phidgets.com/products.php?product_id=1130_0)
4 Channels 5V Relay Module for Arduino (http://www.benl.ebay.be/itm/4-Channels-5V-Relay-Module-for-Arduino-ARM-PIC-AVR-DSP-aii-/261039876391?pt=LH_DefaultDomain_0&hash=item3cc7306927)
Pressure Solar Water Heater Dedicated 12V Solenoid Valve (http://www.benl.ebay.be/itm/Pressure-Solar-Water-Heater-Dedicated-12V-Solenoid-Valve-/170860701640?pt=LH_DefaultDomain_3&hash=item27c81767c8)
DHT11 Temperature & Humidity Sensor Module (http://www.benl.ebay.be/itm/New-DHT11-Temperature-and-Relative-Humidity-Sensor-Module-for-arduino-/251132830173?pt=LH_DefaultDomain_0&hash=item3a78aee1dd)
20PCS Photoresistor GL5539 LDR Photo Resistors Light-Dependen?t (http://www.benl.ebay.be/itm/20PCS-Photoresistor-GL5539-LDR-Photo-Resistors-Light-Dependen-t-/261043174168?pt=LH_DefaultDomain_0&hash=item3cc762bb18)
3.2" TFT LCD Shield + Touch Screen TF SD Reader (http://www.benl.ebay.be/itm/3-2-TFT-LCD-Shield-Touch-Screen-TF-SD-Reader-for-Arduino-Mega-2560-A080-/261027696490?pt=LH_DefaultDomain_0&hash=item3cc6768f6a)
2x Gray Duckbill Side Water Level Sensor Liquid Float Switch (http://www.benl.ebay.be/itm/2x-Gray-Duckbill-Side-Water-Level-Sensor-Liquid-Float-Switch-Tank-Pool-/251128047513?pt=LH_DefaultDomain_0&hash=item3a7865e799)
SD Card Module Slot Socket Reader For Arduino (http://www.benl.ebay.be/itm/271044075331?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)
14pcs 2X40Pin Double Row 2.54 breakaway Male header (http://www.benl.ebay.be/itm/170832484569?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)
I2C RTC DS1307 AT24C32 Real Time Clock Module (http://www.benl.ebay.be/itm/170794823401?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)
5 PCS Bread Board Prototype proto Board 10*20cm (http://www.benl.ebay.be/itm/180991882549?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)
DC 9V/1A Power Supply For Arduino (http://www.benl.ebay.be/itm/190698183951?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649)

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 ;)

Title: Re: Billie's Hydroponic Controller
Post by: bobo01 on Jan 04, 2013, 10:13 pm
Any chance of some more detailed instructions?

How are you changing the temperature, I guess you can only monitor that?  How are plants watered?
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 10, 2013, 02:24 pm
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 ;)

I might be persuaded to build one for you, but that's gonna cost you...   :P
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... ;)
Title: Re: Billie's Hydroponic Controller
Post by: superman on Jan 10, 2013, 07:19 pm

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 (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.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 10, 2013, 09:26 pm

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 (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 ;)
Your idea is nice thinking by the way ;)

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 ;) ) 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... :smiley-eek-blue: Still have to use the base code to start from, I'm ashamed to say  :smiley-eek-blue:
Title: Re: Billie's Hydroponic Controller
Post by: superman on Jan 11, 2013, 12:18 am

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?



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 ;) ) 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
https://www.sparkfun.com/products/10221 (https://www.sparkfun.com/products/10221)

Advice is develop some kind of fail safe 
Title: Re: Billie's Hydroponic Controller
Post by: cyclegadget on Jan 11, 2013, 03:03 am

Nice work on your project Billie! I had to go and order one of those touch screens. I really like how your interface looks!
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 11, 2013, 08:15 am

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... ;)
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...



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.



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 ;)



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 (http://scienceinhydroponics.com/2011/01/the-first-free-hydroponic-nutrient-calculator-program-o.html) 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  :smiley-mr-green:


something you might be interested in would be
https://www.sparkfun.com/products/10221 (https://www.sparkfun.com/products/10221)

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 ;)


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.




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 :D 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 (http://henningkarlsen.com) which worked perfect!!!


Byebye and don't forget to have fun while playing with your Arduino ;)
Title: Re: Billie's Hydroponic Controller
Post by: superman on Jan 11, 2013, 09:26 am

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
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 11, 2013, 11:12 am
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 ;)
Title: Re: Billie's Hydroponic Controller
Post by: superman on Jan 11, 2013, 09:02 pm

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 ;)


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 http://www.youtube.com/watch?v=E8FQGz_s_g8 (http://www.youtube.com/watch?v=E8FQGz_s_g8) 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.
Title: Re: Billie's Hydroponic Controller
Post by: terryking228 on Jan 13, 2013, 02:43 am
Hi Billie,

Just wanted you to know I'm quietly following all of this after asking early questions...  Thanks for showing us so much!
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 14, 2013, 11:37 am
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...)...


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. ;)

Title: Re: Billie's Hydroponic Controller
Post by: superman on Jan 14, 2013, 10:53 pm

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?

Title: Re: Billie's Hydroponic Controller
Post by: purgen on Jan 15, 2013, 01:13 pm
Hi! Very interested in your project. But can not download the sketch. please refresh
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jan 15, 2013, 09:41 pm
Here's the latest version of my code...
Here's (http://www.filedropper.com/hydroponiccontrollerv112b) a new link, because the forum gives me a 503 error when i try to download it...
Title: Re: Billie's Hydroponic Controller
Post by: vincent13 on Jan 27, 2013, 12:10 am
hello,

this link does not work for me.

a chance to get one okay ;)
Title: Re: Billie's Hydroponic Controller
Post by: pYro_65 on Jan 27, 2013, 01:11 am
Retry a few times ( file download, not link ), it worked on the 2nd go for me.
Title: Re: Billie's Hydroponic Controller
Post by: DerekPDX on Jan 30, 2013, 08:08 am
I am trying to get this to run, but get the following errors:

Code: [Select]
Hydroponic_Controller_v1_1_2b.ino: In function 'void EepromRead()':
Hydroponic_Controller_v1_1_2b:146: error: 'EEPROM' was not declared in this scope
Hydroponic_Controller_v1_1_2b.ino: In function 'void graphLoop()':
Hydroponic_Controller_v1_1_2b:567: error: 'EEPROM' was not declared in this scope
Hydroponic_Controller_v1_1_2b:579: error: 'EEPROM' was not declared in this scope
Hydroponic_Controller_v1_1_2b:617: error: 'EEPROM' was not declared in this scope
Hydroponic_Controller_v1_1_2b:632: error: 'EEPROM' was not declared in this scope
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Feb 03, 2013, 06:11 pm
Hello,

Which version of the Arduino IDE are you using? It should only be v.1.0 and no other
Also, do you have the EEPROM and ExtendedEEPROM libraries installed? You need them...Al requirements are stated in the code.
If that doesn't work try to download a new copy of v.1.0 and install the libraries you need for the project.

Hope this works out for you
Title: Re: Billie's Hydroponic Controller
Post by: pgiani on Mar 06, 2013, 04:44 am
First thank you for sharing, your set up is great.

But I see that you are in a bugget like my self and you are in need for EC and I found this link on how to make one for 15$
http://practicalmaker.com/ec/diy-ec-probe

I like to let you know so you can update your set up and I will be sharing my when is done

good luck Billie
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Mar 09, 2013, 07:34 pm
Thank you for thinking with me...The probe isn't the problem. That one's easy. It's making the AC circuit for measuring the EC value.
Ive found the Eagle files (https://github.com/practicalmaker/EC-Shield) for this shield, but don't understand them completely...Especially where the connections go is sometimes a mystery...The ground isn't always shown to be connected.
Edit: Just found out how to show the GDN connections in Eagle.
As for the parts. I've got almost everything I need to build the shield. Just the OPA 350 Opamp and the 01µf capacitors is what need to buy...
Title: Re: Billie's Hydroponic Controller
Post by: Fany_CA on Mar 14, 2013, 04:57 am
^_^ Good job Billie... I love it.

Now, I got a screen like that you used it, any recommendation before to start working with it or information that can help me? 
Title: Re: Billie's Hydroponic Controller
Post by: Germ on Mar 17, 2013, 10:19 am
Looks Really Cool. I tried to download the code but could not. I tried on a mac using safari, chrome, firefox and on windows using i.e.. All with save target or save file as, or download file as.
Is there anywhere else you can post the code?

Also your temp humidity problem should be easy to fix by turning the fans on and off a few degrees apart instead of using one set point.
ex

float SetpointTwo;

if (CurrentTemp > Setpoint)
{
   // Turn On Fans;
}

SetPointTwo = Setpoint - 3;

if (CurrentTemp < SetpointTwo)
{
//Turn Off Fans;
}

Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Mar 22, 2013, 02:30 pm

^_^ Good job Billie... I love it.

Now, I got a screen like that you used it, any recommendation before to start working with it or information that can help me? 

Thx!  The first thing I do with everything I order is check if it works. Try the examples that are in the UTFT library (http://henningkarlsen.com/electronics/library.php?id=52) from Henning's site...If you get the examples to work i'd try to get the touch function to work, again with the library you find at Henning's site and go from there...


Looks Really Cool. I tried to download the code but could not. I tried on a mac using safari, chrome, firefox and on windows using i.e.. All with save target or save file as, or download file as.
Is there anywhere else you can post the code?

Also your temp humidity problem should be easy to fix by turning the fans on and off a few degrees apart instead of using one set point.
ex

float SetpointTwo;

if (CurrentTemp > Setpoint)
{
   // Turn On Fans;
}

SetPointTwo = Setpoint - 3;

if (CurrentTemp < SetpointTwo)
{
//Turn Off Fans;
}




Sometimes you can download it from the forum and sometimes you can't. I suspect it has something to do with the download quota that the forum uses...
I'll try to post the code on github or something...

Also thanks for thinking with me. I already thought of using a Hystery with the setpoint. Just like I did with the pH algorithm... This way one can also set the hystery instead of hard-coding it.


With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Mar 28, 2013, 08:21 am
I've made a repository (https://github.com/BillieBricks/Billie-s-Hydroponic-Controller/blob/master/HydroponicControllerV1.1.0) @Github for those of you that can't download the code... ;)
Have fun!! And don't forget, if you improve on the code post it back so everyone can benefit from it ;)
Title: Re: Billie's Hydroponic Controller
Post by: wbegg on Apr 05, 2013, 12:04 pm
Looks like this would fit the bill!

http://www.ebay.com.au/itm/SainSmart-Mega2560-3-2-LCD-TFT-Touch-Screen-SD-Reader-4-Arduino-UNO-R3-Robot-/261094891095?pt=AU_B_I_Electrical_Test_Equipment&hash=item3cca77de57&_uhb=1#ht_8924wt_1031
Title: Re: Billie's Hydroponic Controller
Post by: mlmunro on Apr 19, 2013, 05:12 pm
Love your work by the way. Has inspired me.
Going to modify your code to work with a flood and drain system.
Might be a stupid question but what is the thread size/type on the solenoid valves ?
I bought the ones you linked to but am having trouble sourcing the right type of connecters for plumbing into a garden hose.

Thanks in advance
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Apr 30, 2013, 02:57 pm

Might be a stupid question but what is the thread size/type on the solenoid valves ?
I bought the ones you linked to but am having trouble sourcing the right type of connecters for plumbing into a garden hose.

No stupid question ;)
Actually I don't know. Took the part with me to a plumbing store and asked for connectors and tubing that would fit the part ;)
I'll check later on this evening and see if I can measure it with my calliper...
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on May 01, 2013, 08:57 pm
Today I had the time to measure the thread of the solenoid valve. Inside of the thread is 19.54mm and outside of the thread is 20.56mm. Hopefully you have enough information with this... ;)
Title: Re: Billie's Hydroponic Controller
Post by: mlmunro on May 11, 2013, 09:33 pm
Excellent. Thanks. Have found all the right bits. Now just need to find some time to put it all together. :)
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on May 16, 2013, 11:19 am
Cool! :)
My setup is currently running...
(http://i893.photobucket.com/albums/ac134/BillieChillie/2013-05-06195736_zpseca88172.jpg)

(http://i893.photobucket.com/albums/ac134/BillieChillie/d71ae401-0045-4e3c-9d73-30af6866e4b0_zpsa3126a24.jpg)

(http://i893.photobucket.com/albums/ac134/BillieChillie/2013-05-11164302_zps1f44a3cf.jpg)

(http://i893.photobucket.com/albums/ac134/BillieChillie/2013-05-11164249_zps9c3e193c.jpg)

(http://i893.photobucket.com/albums/ac134/BillieChillie/2013-05-11164338_zps29d88cbf.jpg)

http://www.youtube.com/watch?v=x46TDmO_eUs&feature=player_embedded

http://www.youtube.com/watch?v=30HiTaBkdAo&feature=player_embedded
Title: Re: Billie's Hydroponic Controller
Post by: bigbob6969 on May 23, 2013, 02:29 pm
Hi Billie, I have been following for a while and love your work.It's taken me a while but i am starting to get all the pieces but i am a little stuck on the code side and was wondering if you could help me out?? I tried searching but i cant make seance of it.

Quote
In file included from sketch_may23a.cpp:43:
C:\Users\Ashley Harwood\Desktop\arduino-1.0\libraries\EEPROMEx/EEPROMEx.h:23:20: error: EEPROM.h: No such file or directory
sketch_may23a:45: error: no matching function for call to 'ITDB02::ITDB02(int, int, int, int, int)'
C:\Users\Ashley Harwood\Desktop\arduino-1.0\libraries\ITDB02/ITDB02.h:18: note: candidates are: ITDB02::ITDB02(int, int, int, int, int, int, int, int, int, int, int, int)
C:\Users\Ashley Harwood\Desktop\arduino-1.0\libraries\ITDB02/ITDB02.h:15: note:                 ITDB02::ITDB02(const ITDB02&)
sketch_may23a.cpp: In function 'void graphSetup()':
sketch_may23a:157: error: no matching function for call to 'ITDB02::TouchInitial(int)'
C:\Users\Ashley Harwood\Desktop\arduino-1.0\libraries\ITDB02/ITDB02.h:30: note: candidates are: void ITDB02::TouchInitial()
sketch_may23a:158: error: 'class ITDB02' has no member named 'setPrecision'
sketch_may23a:158: error: 'PREC_HI' was not declared in this scope
sketch_may23a.cpp: In function 'void graphLoop()':
sketch_may23a:487: error: 'class ITDB02' has no member named 'dataAvailable'


Quote
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on May 27, 2013, 07:47 am
Hello,

You are missing the EEPROMEx library (https://github.com/thijse/Arduino-Libraries/tree/master/EEPROMEx)...
Title: Re: Billie's Hydroponic Controller
Post by: bigbob6969 on May 29, 2013, 01:53 pm
Hi again, All fixed now after learning how to read the code it was easier to fix my mistakes :)
Title: Re: Billie's Hydroponic Controller
Post by: Antennas on Jun 07, 2013, 12:55 am
I am having a devil of a time finding the EEPROM library. Also I can't get the sketch to compile as it says EEPROM not declared in this scope. Using 1.05 IDE.

Andrew
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 07, 2013, 07:35 am

I am having a devil of a time finding the EEPROM library. Also I can't get the sketch to compile as it says EEPROM not declared in this scope. Using 1.05 IDE.

Andrew

Hi Andrew,

I haven't tested the code with the 1.05 IDE. I already mentioned that it will work with IDE version 1.0
Also the error you get would be the same one as other people here on this thread are having trouble with...Namely the EEPROMEx should also be installed. This is an extension to the EEPROM library which is already there... So please read the entire thread, because then you'll find the link to the EEPROMEx library...It's not that far away!... ;)
Title: Re: Billie's Hydroponic Controller
Post by: Antennas on Jun 07, 2013, 02:58 pm
I have the EEPROMex library installed. I will have to check to make sure it's in the right place or that it's named properly. Thanks.

So I found that the name of the library is EEPROMEx and as downloaded it was EEPROMex. So I changed the name in the code to the proper one but it still doesn't work. It says 'class EEPROMClass' has no member named 'readFloat'. This must be a library issue but unsure how to fix.
EDIT***
So I copied the files from github EEPROMBackupVar.h and EEPROMVar.h into the EEPROMEx folder and it worked after that. I had tried to add the EEPROM.h but I had to remove it to make it work.

So it seems to be functioning so far.

Andrew
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 20, 2013, 12:05 pm
That's very strange indeed. I have no such library installed... Probably the maker of the library upgraded the old one...
Still glad to hear that it's working now. :)
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Jun 22, 2013, 09:10 am
Hello Billie,

Really nice project :) that's exactly what I'm looking for

As I just started with all the arduino and the project is not really a beginner project I'm not sure about to handle things.

Can you explain me how to measure the ph plus the more important thing is to adjust it automatically if it goes over or under the set point ?

What will I need for this ?

Greetings
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 22, 2013, 11:14 am
Hello Tonno,

Reading the pH is fairly simple as the Phidgets 1130 outputs an analog signal which can be converted to a pH. You just do an anologRead on the pin which connects to the Phidgets and run this calculation --> 0.0178 * sensorValue - 1.889
What outputs is the current pH value at a constant temperature of 25°C...

Dosing is not that easy. I work with a Setpoint and a Hysteris. The setpoint is the pH I would like to have and the hysteris is the amount the pH can deviate from this point.
Explaining how the code works is not that simple, but here goes...
I first check if the pH is above or below the setpoint. Then change a variable according to that so the program knows if it's a base or acid that needs to be added. Note: If your plants are healthy and absorbing nutrients the pH can only go up. That's because plants use the negative ions for nutrient absorption...
Let's assume the pH is above the setpoint. The program now checks if the pH is above the hysteris. If so, dosing will start (which is a small peristaltic pump) until the pH reaches the setpoint. If the setpoint is reached then dosing will stop and the variable is set to 0 again.
This repeats constantly...

I hope this helps ;)
Title: Re: Billie's Hydroponic Controller
Post by: aarondc on Jun 22, 2013, 11:28 am
Great looking project, and some unusual measurements, Billie. Really appreciate you sharing so much detail and info from your project.

When it comes to plant "food", do you have different products (or chemical makeups) for different plants, or use a more generic style food?

In a closed water+nutrition loop (vs nature where it's pretty open), is it possible an element (say nitrogen) could become depleted and require an increase, or do you find this is not an issue?

Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 22, 2013, 11:48 am
Hello aarondc,

Thanks for the nice comment ;)
To answer your first question...I make my own nutrient mix with the help of HydroBuddy (http://scienceinhydroponics.com/2013/02/the-first-free-hydroponic-nutrient-calculator-program-o.html). This program makes all sort of calculations and returns me a list of Macro and Micro nutrients and their weight in grams needed to make a predefined amount of nutrient mix...
If you understand Dutch, I've made a basic usage tutorial here (http://www.chillipeper.nl/index.php/chili-peper-artikels/hydrobuddy)
I have all sorts of recipes in HydroBuddie's database. So I can make a nutrient mix for almost every crop you can imagine...

You probably have some experience with hydroponics...Because of your second question ;)
Yes, singular nutrients (macro or micro) can get depleted. To measure one single substance one would need fairly expensive probes and that's beyond my hobby budget ;)
You could measure the EC value of a mix, but that still wouldn't tell you which substance is getting low. I do measure the EC value (with a pen for the moment, but I'm working on a improved version of my controller), but this is to know how much concentration of nutrients are in my 200L tank...
To make sure I always have the right amount of singular nutrients in my tank (read: the recipe is still as it should be...) I do a nutrient change every 14 to 30 days. The waste goes to my conifers and grapevines...They also like the readily available nutrients ;)
Title: Re: Billie's Hydroponic Controller
Post by: aarondc on Jun 22, 2013, 12:03 pm
Thanks again.

I know nothing of hydroponics, but I worked for a year in a lab developing a LIMS that extracted mass spectrometer data from plant, soil and water samples for determining optimum custom-made fertilizer (chelates?) for farmers and the like.

I was wondering if you could (or would) measure discrete elements - the lab worked on 3 macro (N,P,K) and 14 micro, from memory, including things like copper and cobalt, etc. It was fascinating. N,P,K ratios were critical, but the micro elements could have a major impact on yield and plant health as well. And each crop type was different.

When I looked at sensors for those sorts of things, you are right, they were off the scale in terms of costs vs what a hobbyist would spend on a discrete component. Crazy.

I had to google EC value - but of course that makes sense. Electrolytes. Nice.

Thanks for the hydrobuddy link too - that's great.

I have no garden here, nice sunny back yard but the garden space is full of bark and succulents, in a rental, so when I saw your project I immediately thought - hey, fresh veges!! I will be looking at this more closely in the coming weeks.
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Jun 22, 2013, 02:13 pm
Hi Billie,

Thanks for the quick reply :-)

Is the pH Meter all the time into the water to measure the pH?

I had some information which sad that letting the ph probe all the time in the liquid will cause damage?

Perhaps this is wrong I only want to confirm it.

And second question : basically I only need one ph Probe and two peristaltic Pumps to setup a pH measure and adjustment station?
I have a Arduino UNO Board with max. 5V on the Digital Output with max. 30mA

I have found those two things now: http://www.aliexpress.com/item/Free-shipping-6V-DC-DIY-Dosing-pump-Peristaltic-dosing-Head-For-Aquarium-Lab-Analytical-water/1003369174.html
http://www.aliexpress.com/item/PH-Electrode-Probe-BNC-Connector-for-Aquarium-PH-Controller-Meter-Sensor-NI5L/938643629.html

Do I can connect them directly to the board or do I need a extra power supply ?

And as I have rad you divided the code so I can just take the part that fits?

And last but not least  :smiley-mr-green: : Why do you use a DC 9V plug for your arduino ? I thought 5V is max

Greetings


Hello Tonno,

Reading the pH is fairly simple as the Phidgets 1130 outputs an analog signal which can be converted to a pH. You just do an anologRead on the pin which connects to the Phidgets and run this calculation --> 0.0178 * sensorValue - 1.889
What outputs is the current pH value at a constant temperature of 25°C...

Dosing is not that easy. I work with a Setpoint and a Hysteris. The setpoint is the pH I would like to have and the hysteris is the amount the pH can deviate from this point.
Explaining how the code works is not that simple, but here goes...
I first check if the pH is above or below the setpoint. Then change a variable according to that so the program knows if it's a base or acid that needs to be added. Note: If your plants are healthy and absorbing nutrients the pH can only go up. That's because plants use the negative ions for nutrient absorption...
Let's assume the pH is above the setpoint. The program now checks if the pH is above the hysteris. If so, dosing will start (which is a small peristaltic pump) until the pH reaches the setpoint. If the setpoint is reached then dosing will stop and the variable is set to 0 again.
This repeats constantly...

I hope this helps ;)
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 22, 2013, 10:01 pm

Hi Billie,

Thanks for the quick reply :-)

Is the pH Meter all the time into the water to measure the pH?

I had some information which sad that letting the ph probe all the time in the liquid will cause damage?

Perhaps this is wrong I only want to confirm it.

The pH probe is constantly in the nutrient tank. I haven't seen no degradation on the probe...

And second question : basically I only need one ph Probe and two peristaltic Pumps to setup a pH measure and adjustment station?
I have a Arduino UNO Board with max. 5V on the Digital Output with max. 30mA

I think you will be able to get that on the Uno. I don't have one, but since you are not using the TFT display and touch I think it will work...

I have found those two things now: http://www.aliexpress.com/item/Free-shipping-6V-DC-DIY-Dosing-pump-Peristaltic-dosing-Head-For-Aquarium-Lab-Analytical-water/1003369174.html
http://www.aliexpress.com/item/PH-Electrode-Probe-BNC-Connector-for-Aquarium-PH-Controller-Meter-Sensor-NI5L/938643629.html

Those look ok to me. Another tip: When using silicone tubing (as in your pump) you have to use nitric acid instead of sulfuric acid. Because the latter will corrode the silicone tubing ;)

Do I can connect them directly to the board or do I need a extra power supply ?
No don't connect the pumps directly to the Arduino. You'll need a relay for that...Something like this one --> http://www.benl.ebay.be/itm/2-Kanal-5V-Relay-Relais-Module-Modul-fur-Arduino-PIC-DSP-PLC-TTL-/190698140291?pt=Elektromechanische_Bauelemente&hash=item2c667eb283

And as I have rad you divided the code so I can just take the part that fits?
Yes, it is modular, but you still need to think and debug for yourself ;)

And last but not least  :smiley-mr-green: : Why do you use a DC 9V plug for your arduino ? I thought 5V is max

Greetings

The Arduino needs a power supply with a minimum of 6V and a maximum of 12V. So 9V is just in between ;)
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Jun 22, 2013, 10:27 pm
So another Time thanks for the reply

The relay inbetween the digital Output and the Pumps is only for the higher current right?

The 6V aren't still not supplied by the relay I think?

But anyway the pumps should also work without 6V , so 5V should be just fine you think?


The next few days I will look for a ph connection shield for the arduino and show it to you here in this thread to get the right piece :)

BTW Wehre did you geht your pH shield to connect to Probe from? I also live in Europe , ans the Shopping Costs from the States are really High

Thanks a lot in advance you are rellay helping me out a lot

Greetings
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 23, 2013, 11:08 am
The relay should have it's own power supply. Both grounds from the Arduino and the power supply from the relay should be connected. You can run the relay with the power from the Arduino, but the pH shield is so sensitive that the on/off action from the relay messes the measurements from the pH shield. Also the peristaltic pumps need their own power supply because they need more current then the Arduino can deliver...
So in total you would need three power supplies -->1x 5V (relay); 1x 9V (Arduino); 1x 12V (Peristaltic pumps)
I bought my Phidgets 1130 (http://www.boecker-systemelektronik.de/epages/63381271.sf/de_DE/?ObjectPath=/Shops/63381271/Products/11-60-1043) in Germany last year. Because of the soccer world cup (or something) the owner of the shop would send it free of charge :D
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Jun 23, 2013, 12:27 pm
Why not 6V for the pumps ?

6V power supplie can deliver 2 x times 6V or not?

12V could destroy the pumps or do I think wrong?

So basically i only have to care about the voltage the power supply can deliver ? Not about the current ?
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 23, 2013, 04:01 pm
My pumps where 12V, so that's why i needed a 12V power supply.
The relay and Arduino need two separate power supplies because when the relay switches on/off then a tiny current goes back to the Arduino and disrupts the pH reading the Phidgets 1130 makes...You'll see ;)
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Jun 24, 2013, 06:58 am
Okay so now I think I have all together I need

1 x Arduino Mega
1 x 9V external Supply for they Arduino

1 x 5V 2 Modul Relay
1 x 9V external Supply for the relay

1 x pH Probe With BNC connector
1 x pH Shield for the connection between probe and arduino
2 x peristaltic pumps
1 x external supply for the pumps

The probe will be connected directly to the ph shield for the arduino and the shield goes also directly to the arduino

The pumps will be connected to the relay and also to the external supply

What I don't understand is the connection of the relay,because it need to be connected to the arduino - will it simply be connected to the digital in / out pin? - as well as to the external supply and needs connection to the pumps is this right ?

Can you perhaps describe the way the relay will be connected to all these parts ?


I'm sorry for all the questions ... I'm hoping that's not so disturbing for you, perhaps this is a bit to heavy for my first project but anyway I will try it :)

Greetings
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jun 24, 2013, 08:04 pm
It's actually a 5V adapter for the relay module. I made a mistake before ;)
You connect the VCC and GND from the relay to the + and - of the 5V adapter and the inputpin and GND from the relay to the Arduino GND and outputpin. That way your ground (GND) becomes what's called 'common'...
The output from the relay are 3 connectors per channel (NC and  NO) and are isolated from the input circuit. So you can even switch 120/230V AC if you like (But be careful if you do. Electricity is dangerous ;) )
You connect the peristaltic pumps to each channel per pump on the NO (normally open) connections together with the adapter in series... When you put your Arduino outputpin high the relay switches and current will flow making the pump turn...
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 17, 2013, 12:21 pm
Hey everybody,

It's been a while since my last update.
I was currently busy developing a shield for my controller. Since Eagly CAD doesn't agree with me it's taking quite some time...
In the meantime I found a cool website (http://www.practicalmaker.com/) with lot's of information about the subject. He (Andrew) calls this the 'Arduarium Controller', but since this shield has everything my controller needs I'm trying to build it myself. You can buy the shield ready made, the bear PCB and Andrew even put the Eagle files on Github for people to use. The Eagle files are licensed under the TAPR Open Hardware License (http://www.tapr.org/TAPR_Open_Hardware_License_v1.0.pdf).

Meanwhile I have another short movie ready for you guys and gals to see the results from my controller. I foresee that the plants will reach the sealing within a month or so...

http://www.youtube.com/watch?v=zS8XRpyT5Pg&feature=player_embedded
Title: Re: Billie's Hydroponic Controller
Post by: dxco on Jul 19, 2013, 09:02 am
Thanks a lot for posting this great project! I feel the same way about sharing. If you want a copy of my CO2 controller code, let me know. Easy interface with any CO2 sensor: I used the analog out of my NOSE monitors (with humidity, temp, CO2 & webserver built in) to control a relay for fan & CO2 burner or tank. I think it would be a nice addition to your project.
Thanks again for posting -I'm just beginnning to read the posts but had to post on your comment about sharing. I'd love to see some open source grow software. Not just Arduino but PC too.
Damn - Now I'm going to be up all night...
DX

PS - Here's a link to the NOSE monitor page. Not like you need the temp/humidity but it's nice to be able to check status via the webserver.
http://www.monitor.dxhydro.com/
If you want one of the modules for half price, let me know.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 21, 2013, 01:20 am
Hey DX,

Thanks for your kind reply!! The purpose of this project was to create a low budget, open-source controller which could be used all over the world so people could improve their crop yield and have more money to spend on other things other then food...
Though this project is still in it's infancy I hope one day it will be used by many people.
And off course I'm interested to see your code so you'll soon get a pm from me :D
The screen shots from your web interface look very promising, though implementing CO2 wasn't initially in my plan. I looked it up for some idea's about it and one could build a CO2 generator for a very low budget...So thanks for pointing this out to me ;)
Will be looking out for some cheap CO2 sensors out there...

With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: kain3713 on Jul 22, 2013, 03:22 am
This is awesome!

Any chance you could re-upload your most recent sketch?
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 22, 2013, 11:13 am
Thx! :)
The latest one that's workable is already on-line ;)
Since the controller is doing it's job in the greenhouse I haven't updated it to check if the code is working properly...
Title: Re: Billie's Hydroponic Controller
Post by: kain3713 on Jul 22, 2013, 09:08 pm
Was that the filedropper link? It doesn't seem to be working (the link just takes me to their homepage)... Is it possible for you to reupload it?
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 23, 2013, 11:16 am
Oh I see...Here's a new link (https://github.com/BillieBricks/Billie-s-Hydroponic-Controller/blob/master/HydroponicControllerV1.1.0) ;)


With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: jamesroberson on Jul 26, 2013, 04:57 pm
Hi Billie

I've read through your thread, this project is very interesting.

Just a question regarding the temperature control problem with your fans switching on and off... (I cannot figure out how to place a quote here).

Where is your temperature sensor? (mounted high in your growing room, or down low?). I think that by mounting it up high, you would register a slower rate of temp change, as the colder air from the fans would fill the room from the bottom. Also, what about mounting a small fan to constantly blow air over the sensor, so that you get a more general temperature reading. I'm an aircraft mechanic, and in my experience, this is how various aircraft manufacturers rig up their cabin temperature sensors, in order to maintain a constant temperature. As soon as the fan stops, or the airflow over the sensor gets blocked by something, the temp control becomes erratic.

Just a thought, hanks again for a great project.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 29, 2013, 08:13 am
Thank you for the interesting input :)
The temp/humidity sensor is mounted on the side of the controller, which isn't the best solution...But this is a prototype so I knew there would be problems I would run in to...

Yesterday I made a new movie inside the greenhouse. The plants are growing wild at the moment... Harvested about two kilo's of Jalapeno's and there are more to follow ;)

http://www.youtube.com/watch?v=quDneR11TJI&feature=player_embedded


With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: aarondc on Jul 29, 2013, 09:13 am
This forum needs like buttons on posts. Verdant job there, Bill.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Jul 29, 2013, 08:30 pm
Thanks! :D
I agree! I've also seen some great projects out there which deserve a thumbs up ;)
Edit: Just found out that there's a system like that on this forum. There's a button/link beneath your avatar that called Karma... Press on it and it's like a 'thumbs up' ;)
Title: Re: Billie's Hydroponic Controller
Post by: kripthor on Aug 08, 2013, 07:08 pm
Its pretty awesome!
And the PH reader is really accessible, I had trouble finding one when I was doing something similar.

Great work!
Title: Re: Billie's Hydroponic Controller
Post by: mikegreen on Aug 09, 2013, 04:31 pm
Any chance we could get the code on github or such?

I'm looking to build something similar for an NFT system... wouldn't mind documenting as I go and compiling the hardware lists that are thru-out this thread if we had a repo to save it all somewhere.

nice job, !

-Mike
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Aug 11, 2013, 09:24 pm

Its pretty awesome!
And the PH reader is really accessible, I had trouble finding one when I was doing something similar.

Great work!

Thanks! :)



Any chance we could get the code on github or such?

It already is on github --> link (http://forum.arduino.cc/index.php?topic=130344.msg1175382#msg1175382) ;)
Title: Re: Billie's Hydroponic Controller
Post by: Mikefrancis on Sep 02, 2013, 06:30 pm
Hello Billie

Thanks for your reply on PM
As asked, I'll switch to the forum.
I'll be ordering the hardware today.
Question - is this what I need?

http://www.ebay.com.au/itm/SainSmart-Mega2560-3-2-LCD-TFT-Touch-Screen-SD-Reader-4-Arduino-UNO-R3-Robot-/261094891095?pt=AU_B_I_Electrical_Test_Equipment&hash=item3cca77de57&_uhb=1#ht_8924wt_1031

And my second question - will this board allow me to expand to an internet and/or SMS (cellphone text) connectivity at some time in the future ?

Thanks in advance, apologies on basic questions as I'm a complete beginner at this

Mike
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 02, 2013, 09:32 pm
The kit is ok, but there's a chance that the sd reader doesn't work. You'll have to ask the seller.
Network functionality will be a problem because of conflicting pins ( ie pin 10 & 4) between the ethernet card and the tft shield... You could try and resolder some pins and try to recode everything, but that's beyond my expertise. Another option is to use a seperate arduino to connect to the network ;)

Let me know how your build continues...
Title: Re: Billie's Hydroponic Controller
Post by: Mikefrancis on Sep 02, 2013, 09:48 pm
Ah, OK, glad I asked you first Billie :-)

Can you suggest a bundled kit of components that would be suitable for your software (Arduino + Touch Screen Display + SD Card Reader)?

I found this on e-bay too....

http://www.ebay.com/itm/3-2-TFT-LCD-Shield-Touch-Screen-w-TF-SD-Reader-for-Arduino-Mega-2560-A080-/251117559109?pt=LH_DefaultDomain_0&hash=item3a77c5dd45#ht_6683wt_1029

and this....

http://www.ebay.com/itm/SainSmart-3-2-TFT-LCD-Display-Touch-Panel-SD-Slot-For-Arduino-Mega2560-R3-US-/271236277942?pt=LH_DefaultDomain_0&hash=item3f26f126b6#ht_4329wt_1161

And as you mentioned it, it may be that my application does not require the SD Card Module.... have you found being able to store and replay the data is of value, particulalarly for a non-experimenter like me?

And yes, as a future add on, a dedicated Arduino Ethernet shield would be a much more flexible solution.

Thanks again !
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 02, 2013, 09:55 pm

Ah, OK, glad I asked you first Billie :-)

Can you suggest a bundled kit of components that would be suitable for your software (Arduino + Touch Screen Display + SD Card Reader?

I can only advise you the parts I used, because that's what I got. But if you are willing to forfait the sd card, then the kit will do ;)
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 03, 2013, 03:17 pm
Hi Billie,

great work. I was wondering if you ever consider an RFM12B to talk to a Raspbbery PI. A little like it works with openenergymonitor.
I've ordered a kit from sainsmart in order to make a setup like yours, and gonna try to integrate with emoncms or something like it, so it's possible to check what's happening via web. This would allow a graphical logging solution and interface with SMS gateways in order to receive alarms if something goes wrong. Second step would be to control (adjust) the system from a webpage so one doesn't have to be onsite to make an important change if needed.

If someone wants to participate or have interesting ideas to complement just let me know.

-----> Waiting by the door for my kit to arrive  :smiley-roll:

Tiago
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 04, 2013, 10:54 pm
Hello,

Never used a Pi or an RFM12B before, but am working on a 'networked' version... I'm currently busy developing a PCB so all parts fit together as a shield...
Access through the Internet is the next logical step. ;)

With kind regards
Title: Re: Billie's Hydroponic Controller
Post by: cybergogo on Sep 07, 2013, 05:15 pm
Hi Billie,

Very very interesting project you've got here.
I'm also working on one of my own, to control EC, PH and measure humidity and temperature.

I'm trying to test your code, so i'm using arduino 1.0, all the libraries needed (including eeprom and extended eeprom) but i'm facing the same problem DerekPDX had (posted on 30th january).

Do you have an idea about how i can manage this issue?

Many thanks

Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 07, 2013, 10:37 pm
Hello,

I've figured out why you get the error.
There's been a couple of changes in the library...The current version uses EEPROMEx.h as filename whereas the old library used EEPROMex.h. Change that in the code (#include <EEPROMEx.h>) and the first compile errors disappear.
Next you'll have to edit the EEPROMEx.h file...Change #include <EEPROM.h> into #include <avr\EEPROM.h> and this makes the rest of the compile errors go away...
There's also an #include <avr/EEPROM.h>, but I think this is an error and should be #include <avr\EEPROM.h>. If anyone can collaborate?
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 09, 2013, 03:34 pm
Hi Billie,

so I got my sainsmart kit today (the one with the mega2560, the tft shield and the tft itself.

First of all (and after paying more money for customs and customs service that for the kit+shipping itself) I was quite pleased with the overall quality of the product.

I also stumble in that problem with EEPROM.h. What I did was to remove the line that includes EEPROM.h inside the EEPROMEx.h. It was a matter of error/try so I can't have any valid input on why it works (maybe I'll get to that latter If I have the time to do further testing).

I can also confirm that the SDcard slot on the sainsmart TFT works "out of the box" with your sketch, so cheers for the sainsmart guys.

I'm going to setup some probes and make some lab tests in order to get everything working before I'll go live.

The only issue I have is sometimes the "buttons" don't work. Then I wait 10 seconds and try again. Sometimes it works, sometimes it doesn't and I have to wait a bit more. It's very strange. It happens for instance on pH Settings page 2 with the back button (lower left) and soothing ON/OFF button. Is there something you experienced yourself?

best regards,
Tiago


Title: Re: Billie's Hydroponic Controller
Post by: cybergogo on Sep 09, 2013, 06:40 pm
Hi Billie,
Thank you for the fast reply, the code works perfectly now (on arduino 1.0 and 1.0.5).
I've PMed you to talk about my project without getting off topic here.
Charlie.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 09, 2013, 08:40 pm

The only issue I have is sometimes the "buttons" don't work. Then I wait 10 seconds and try again. Sometimes it works, sometimes it doesn't and I have to wait a bit more.

Hello Tiago,

The buttons react slowly. That's because of the 'delays' that are still in there. Just keep pressing the button until you enter a new window and everything is ok ;)


Hi Billie,
Thank you for the fast reply, the code works perfectly now (on arduino 1.0 and 1.0.5).
I've PMed you to talk about my project without getting off topic here.
Charlie.

Charlie,

Glad to see you getting it to work :)
Hope to see a movie when you get everything up and running ;)

With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 12, 2013, 06:45 pm
Hi Billie,

On PH Settings, the setpoint and hysteris appear both as "NAN".

what am I missing here?

thanks,
Tiago
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 13, 2013, 11:24 am
Tiago,

Can you elaborate a bit further? NAN = Not a number?? Or what?
Do you get errors during compiling?


With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 13, 2013, 02:15 pm
Hi Billie,

this is what I mean.

(http://www.release.pt/images/phnan.jpg)

right now the probe is disconnected, but with the probe the behavior is the same. I'm using your unmodified sketch (other than the pin for LDR)

+/- buttons on setpoint and hist don't work. Maybe because of this NAN issue.

any hints?

regards,
Tiago
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 13, 2013, 02:37 pm
anh... just hit me... I had a problem with eepromex.h and eeprom.h
made some changes to eepromex.h and probably that's where my problem lies.

gonna clean up the eepromex library.
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 13, 2013, 10:52 pm
First of all...Cool to see the controller being of use to someone ;)


anh... just hit me... I had a problem with eepromex.h and eeprom.h
made some changes to eepromex.h and probably that's where my problem lies.

gonna clean up the eepromex library.

That could be it...When you enter the pH adjustment screen the program reads the values for setpoint and hysteris from eeprom...
You could also try and whipe the values stored in eeprom. I faintly remember having problems in the beginning because wrong values stored in eeprom...
Title: Re: Billie's Hydroponic Controller
Post by: Damo1984 on Sep 14, 2013, 10:40 am
Real neat controller Billie!!

Great work on setting up your hydro setup. It's amazing how many plants you have squeezed into that space. It's great to see other projects and share the knowledge. Looks like there are a few people interested in controlling their own food production.

I just have one constructive feedback on the plant physiology side of things. If your able, you should really incorporate EC/CF control. Although pH controls nutrient uptake, nutrient availability is equally important. EC is a great tool for controlling, among others, such things as internode stretching, hardiness and taste. You can also control visual aspects such as cracking/splitting with EC control (particularly important with tomatoes). I think you'll have better control of plant size, especially during seasonal changes (i.e. winter vs summer ).

I'm making a similar controller using a mega connected to a raspberry pi with a 10 inch touch screen controlled by a website.

Anyway, that's my 2c worth, I look forward to your future releases!

Regards,
Damian
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 14, 2013, 04:56 pm
@Billie

Spot On!
clearing the eeprom has done it :) Wouldn't have thought of that.

thanks,
Tiago
Title: Re: Billie's Hydroponic Controller
Post by: tmarquespt on Sep 14, 2013, 06:22 pm
Hi Billie, now that it's setup, the issues begin :)

Regarding the LDR in you sketch you have int lightSensor = 60; I can't get any readings on light (it's only bouncing between 24,25,26) no matter the actual light condition. I know the LDR works because if I set the lightsensor to pin 14 it gives me a range 250~32000 (32000 with the phone led flash next to the ldr). Any hints?

Also would love to know if you have any newer version as this is already a couple months old and you probably have tweaked it already for some issues encountered along the way.

I'm going to kickstart my NFT test project
(http://www.release.pt/images/ntf_test.jpg)

best regards,
Tiago
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Sep 15, 2013, 12:18 pm

I just have one constructive feedback on the plant physiology side of things. If your able, you should really incorporate EC/CF control. Although pH controls nutrient uptake, nutrient availability is equally important. EC is a great tool for controlling, among others, such things as internode stretching, hardiness and taste. You can also control visual aspects such as cracking/splitting with EC control (particularly important with tomatoes). I think you'll have better control of plant size, especially during seasonal changes (i.e. winter vs summer ).

Hey Damien,

Thank you! :)
I already measure the EC value but for now with a pen instead of using the controller. I couldn't find a good priced EC module to put in the controller...
EC control is very important, I know. To high and the plants don't grow well and to low and the same happens. For my peppers I let the EC value swing from 1.8 to 2.4 depending on the weather conditions.
In the new controller EC measurement will be incorporated. But as stated earlier I'm still learning how to use Eagle, so making the new board will have to wait until I and my finances are ready to do so ;)


Hi Billie, now that it's setup, the issues begin :)

Regarding the LDR in you sketch you have int lightSensor = 60; I can't get any readings on light (it's only bouncing between 24,25,26) no matter the actual light condition. I know the LDR works because if I set the lightsensor to pin 14 it gives me a range 250~32000 (32000 with the phone led flash next to the ldr). Any hints?

Maybe there's a problem with your A4 pin..?? Do you mean you use A14 = 68? If so then use that pin ;)

Also would love to know if you have any newer version as this is already a couple months old and you probably have tweaked it already for some issues encountered along the way.

Nope, no new version to be tested until this season is over. I don't want to risk my harvest by overdosing at the moment. This winter I'll be recoding the device to suit the new hardware (EC, new screen, ethernet module).



I'm going to kickstart my NFT test project
(http://www.release.pt/images/ntf_test.jpg)

Nice setup!! :D

With kind regards,

Billie
Title: Re: Billie's Hydroponic Controller
Post by: Slydude on Oct 05, 2013, 09:30 pm
It would be a big help if you could show us a wiring schematic for your setup, it looks nice!
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Oct 10, 2013, 07:00 pm
Are these (http://forum.arduino.cc//index.php?topic=130344.msg980712#msg980712) simple enough? :D
Title: Re: Billie's Hydroponic Controller
Post by: v4nelle on Oct 23, 2013, 12:58 pm
congratulations for your perfect project!
I want to make an automation to control the electrical windows of my greenhouse via sms
and i want to ask you if this touchscreen is readable on sunlight conditions.

Another question i have is : Do you think that this system will work stable on real conditions on a greenhouse?
My greenhouse is about  5000 m2 ,with high temps.

Sorry for my english  8)
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Oct 24, 2013, 01:58 pm

congratulations for your perfect project!

Thank you very much! I did my best at the time, probably could do a better job programming it, but as you say it works so...Call me lazy ;)


I want to make an automation to control the electrical windows of my greenhouse via sms
and i want to ask you if this touchscreen is readable on sunlight conditions.

When the sun is shining directly on it it's difficult to read the screen...

Another question i have is : Do you think that this system will work stable on real conditions on a greenhouse?
My greenhouse is about  5000 m2 ,with high temps.

It works stable, although you probably will need to buy better pH probes then the one's I've used. Also and this is an important one. Make sure the controller is shaded. High temperatures will mess up the stability of the device. Next year I will be installing it outside of the greenhouse in a waterproof housing and in the shade...

Have fun and if you got it working post some pictures here!! :D
Title: Re: Billie's Hydroponic Controller
Post by: acuser on Nov 23, 2013, 05:17 pm
HI Billie

Please bear in mind I'm a complete noob, just had my board for about 5 days.

Awesome sketch. I'm waiting on a few more parts to arrive, mainly cabling cant really hook anything up using my sainsmart board and shield tft, it pretty well covers everything up including the reset button.

I couldn't get the ITDB02_Touch library to work so I am using Utouch and its works fine until I power the board down. When I repower the board the touch screen does not work until i  1.  reload sketch several times 2. touch a 100 ohm resistor across reset and gnd. to reset the board.

I am using 1.0.5 but i did try it on 1.0 and it does the same thing. I've pasted the top part of the sketch where I have changed it the rest is as you wrote it.

I've been searching google for a answer for the last four days but I cant find a solution, but I probably wouldnt see it if I was looking right at it.

Anyway I hope you or somebody can give me some ideas because I am hopelessly stuck.

Thanks


       #include <UTFT.h>
       #include <UTouch.h>
       #include <UTouchCD.h>
       #include <SD.h> //SD card library
       #include <Wire.h> //One Wire library
       #include <RTClib.h> //Real Time Clock library
       #include <EEPROMEx.h> //Extended Eeprom library

       UTFT myGLCD(ITDB32S,38,39,40,41); //pins used for TFT
       UTouch      myTouch(6,5,4,3,2); // original values 6,5,4,3,2);

       #define dht_dpin 69 //pin for DHT1
       

  void graphLoop()
             {
               if (true)
               {
                 if (myTouch.dataAvailable())
                 
                 {
                   myTouch.read();
                   x=myTouch.getX();
                   y=myTouch.getY();
                   
                   if (page == 0)
                   {
                     if ((x>=255) && (x<=312))
                     {
                       if ((y>=17) && (y<=47))

Title: Re: Billie's Hydroponic Controller
Post by: odometer on Nov 24, 2013, 09:38 pm
As for the NaNs for pH: I think it is because you might have a problem writing / reading float values.
I believe in killing floating-point arithmetic whenever practical.
It is usually not difficult to find ways to avoid it.
Code: [Select]

// This is evil:
float pH = 0.0178 * sensorValue - 1.889;

// Instead, use:
int pH = (2 * sensorvalue) - ((11 * sensorValue + 9445) / 50);
// This gives you 100 times the real pH,
// so if the real pH is 5, the pH variable will be 500,
// and if the real pH is 5.25, the pH variable will be 525, etc.
// Just insert a decimal point (or decimal comma!) for display.
Title: Re: Billie's Hydroponic Controller
Post by: retrolefty on Nov 24, 2013, 10:45 pm

As for the NaNs for pH: I think it is because you might have a problem writing / reading float values.
I believe in killing floating-point arithmetic whenever practical.
It is usually not difficult to find ways to avoid it.
Code: [Select]

// This is evil:
float pH = 0.0178 * sensorValue - 1.889;

// Instead, use:
int pH = (2 * sensorvalue) - ((11 * sensorValue + 9445) / 50);
// This gives you 100 times the real pH,
// so if the real pH is 5, the pH variable will be 500,
// and if the real pH is 5.25, the pH variable will be 525, etc.
// Just insert a decimal point (or decimal comma!) for display.



Great advice, use integer for analog sensor math and just convert to float for display purposes if you must.

Title: Re: Billie's Hydroponic Controller
Post by: odometer on Nov 25, 2013, 04:57 am
I found this in the source code:
Code: [Select]

            void fotoLoop()
            {
              lightADCReading = analogRead(lightSensor);
              // Calculating the voltage of the ADC for light
              lightInputVoltage = 5.0 * ((double)lightADCReading / 1024.0);
              // Calculating the resistance of the photoresistor in the voltage divider
              lightResistance = (10.0 * 5.0) / lightInputVoltage - 10.0;
              // Calculating the intensity of light in lux
              currentLightInLux = 255.84 * pow(lightResistance, -10/9);
            }

What is that [font=Courier]-10/9[/font] near the bottom?
Title: Re: Billie's Hydroponic Controller
Post by: acuser on Nov 26, 2013, 01:39 am
Yes Yes Yes

I solved my problem

I think the Sainsmart shield V1.0 is not compatible with UTouch Library. I tried using the ITDB02_Touch Library and
it works great. You need to change  WProgram.h to Arduino.h in the cpp file, this may only be necessary if your using
IDE 1.0 or later. Like I said in my previous post Im a noob, but this worked for me.

Well until my next problem
Later Guys
Title: Re: Billie's Hydroponic Controller
Post by: acuser on Nov 27, 2013, 03:13 am
Im starting to breadboard some of this project and im confused on pins

code
define dht_dpin 69 //pin for DHT1
int lightSensor = 60; //pin for Photoresistor

I have read the thread and looking at Billies drawing DHT =pin  A15  Photoresistor= pin A14

Im guessing the 60 and 69 could be the atmega but how do you get a15 and a14 from that.
I know the A15 and A14 is the way to wire it, im just trying to understand and learn what I can of the code.

This is a lot harder than I thought it would be Im just hoping I can fumble my way through and get most of it working.

Thanks Guys
Title: Re: Billie's Hydroponic Controller
Post by: dissention2112 on Dec 05, 2013, 09:48 pm
Hey Billie,

For the hydro setup your running this for, how many plants are you tending this to? And are you using the Arduino programming language or C#?

I am very interested in building this setup and have been looking into the parts but I want to get the correct parts and don't want any issues.
Title: Re: Billie's Hydroponic Controller
Post by: Jshwaa on Dec 24, 2013, 12:02 am
Billie,

I'm sure you've been asked this, so forgive me for not reading the previous 8 pages of posts on this subject, but...

What exactly does your controller do in response to a pH reading being above or below a setpoint?

I understand that you have fans to 'control' temperature, but what does your controller do in response to a temperature that is too low, or to a temperature that is too high despite every fan being on?

Also, for your data logging to the SD card....

What is the format of the information that you log?  Do you log all sensor information continuously, or do you log 'events' such as broken setpoint thresholds (high/low temp/pH)?

Thanks in advance.



Title: Re: Billie's Hydroponic Controller
Post by: bIG_dEAL on Jan 14, 2014, 06:08 am
Hi Billie.

Before I ask my question I wanted to say many thanks for all your hard work. This thread has been by far the most useful resource in building my own (very similar) project. Hands down awesome!

I just wanted to ask... Have you tried to use the integrated SD card slot on the rear side of the LCD/TFT panel?
When I use the adjustable shield directly on top of the Mega, it works, but with the (8-bit) wiring like in your picture and adding MISO, SCK, CS(SS) and MOSI  to pins 50,52,53,51 (and shield's 16,17,35,34)  I have no luck so far. I am not sure which other pins I should connect or if it is at all possible. I do not know if you are using the break-out SD module for convenience or if you have ran into problems also.

I would really appreciate if anyone can help, I hope it is not too off-topic, but I am still quite a noob and this is the first time I am really running out of ideas. I don't mind to use a separate module but for the sake of compactness I would like to at least explore the idea of using the integrated SD.  I am using Mega 2560 with a Sensor Shield and a custom cable, connecting the same pins on the TFT shield as in your photo and their counterparts on the sensor shield. Everything works, except the SD-card.

Thanks!
Title: Re: Billie's Hydroponic Controller
Post by: gaobeihua on Jan 14, 2014, 09:37 am
Thank you very much for your great work.
I am new... trying to learn form zero... and with very little free time. Would it be possible to get a diagram on paper to unferstand how to do the connections?. I have already bought all the parts, but my knowlegde is quite limited... so I really do not think I can do it unless you help me how to.
Keep up with your great work. Congratullations
Gao
Title: Re: Billie's Hydroponic Controller
Post by: jarno83 on Feb 05, 2014, 12:19 pm
Hi, nice project Billie :) Thanks for sharing!
Anyone used these ph sensors? - http://www.aliexpress.com/item/Free-Ship-1pc-PH-Sensor-Module-V1-1-1pc-PH-Probe-for-Uno-R3-board-mega2560/1024665455.html
(http://www.aliexpress.com/item/Free-Ship-1pc-PH-Sensor-Module-V1-1-1pc-PH-Probe-for-Uno-R3-board-mega2560/1024665455.html)

Thanks,
Jarno
Title: Re: Billie's Hydroponic Controller
Post by: Tonno on Feb 07, 2014, 08:32 pm
I bought this one:

PH Probe: http://www.aliexpress.com/item/Wholesale-Laboratory-Room-Replacement-PH-Probe-Electrode-PH-Sensor-Resolution-ph-probe-Free-Shipping/1049630247.html (http://www.aliexpress.com/item/Wholesale-Laboratory-Room-Replacement-PH-Probe-Electrode-PH-Sensor-Resolution-ph-probe-Free-Shipping/1049630247.html)
I think you can get just any BNC connected ph Sield, it should work !

My probe works fine
Title: Re: Billie's Hydroponic Controller - Issues with ITDB02_Touch library
Post by: zatheros7 on Feb 18, 2014, 11:55 pm
Trying to replicate this project, playing with the software while waiting for parts to come in.
I am getting this message when I compile on both ide ver. 1.0 and 1.05
Billie_s_Hydroponic_Controller_V1_1_2b.cpp:39:57: error: ITDB02_Touch.h: No such file or directory
Billie_s_Hydroponic_Controller_V1_1_2b:45: error: 'ITDB02_Touch' does not name a type
Billie_s_Hydroponic_Controller_V1_1_2b.cpp: In function 'void graphSetup()':
Billie_s_Hydroponic_Controller_V1_1_2b:159: error: 'myTouch' was not declared in this scope
Billie_s_Hydroponic_Controller_V1_1_2b:160: error: 'PREC_HI' was not declared in this scope
Billie_s_Hydroponic_Controller_V1_1_2b.cpp: In function 'void graphLoop()':
Billie_s_Hydroponic_Controller_V1_1_2b:498: error: 'myTouch' was not declared in this scope

Any insight or help would be appreciated
Title: Re: Billie's Hydroponic Controller
Post by: bIG_dEAL on Feb 19, 2014, 07:01 am
@zatheros7

The error should be self-explanatory.
At the start of Billie's sketch read:

Software Requirements:
  ----------------------
  -ITDB02_Touch library

You either don't have it or have extracted it incorrectly. Should be in your libraries dir.
The rest of the sketch then can't compile as stuff from that library is missing, hence functions, definitions etc. don't make sense.

Don't want to be a troll, but this is quite "advanced" stuff and if this is what has gotten you stuck already, you will probably have a bit of a tough time.I got into Arduino just a few months ago and had no prior serious programming experience (bit of basic maybe). Started with the usual silly stuff and by taking small steps (in a quick succession ;) I can now read Billies code and understand exactly what is going on.

Good luck anyway! It's really great fun!

Title: Re: Billie's Hydroponic Controller
Post by: zatheros7 on Feb 20, 2014, 04:01 am
@ bIG_dEAL
Thanks for the reply.  And yes you are correct,  it was self explanatory. All the files appeared to be installed in the correct place, except it was not working.
After the fourth or fifth delete / start over/  reinstall cycle, it apparently installed properly and I was able to get it to compile.
( Now remembering similar problems from the past working on old IBM equipment running open object REXX.)
I too have been playing with the arduino for a while,  doing various and sundry exercises trying to gain a better proficiency with the software.
Just discovered Billie's project about a week or so ago. I had tried to do a basic controller a couple of years ago, using the practical maker PH board from Andrew Oke but was not happy with the fact it would only read / control half of the PH range. I wanted to be able to have ultimate control  up or down for my hydroponic setup. Here Billie has done it with super deluxe features and more. I should have most of my parts by the end of next week. Looking forward to getting this project completed. Once you get all the hydroponic parameters nailed down, explosive growth is a hoot!


P.S. Thank You Billie!
Title: Re: Billie's Hydroponic Controller
Post by: Boardburner2 on Feb 20, 2014, 11:47 am
Do you hane a picture, my valves use
NPT sizes.
Title: Re: Billie's Hydroponic Controller
Post by: zatheros7 on Feb 21, 2014, 05:48 pm
These are the Valves I ordered from Ebay,  They  have male 1/2"-14 tpi  straight thread fittings.
Title: Re: Billie's Hydroponic Controller
Post by: lolocaledo on Feb 24, 2014, 08:20 am
Hello,

I've decided to build this Hydroponic Controller. I've already ordered many parts but I have one question : what is the use of this valve (Pressure Solar Water Heater Dedicated 12V Solenoid Valve) ? This project seems to be very nice.

Thank you very much
Title: Re: Billie's Hydroponic Controller
Post by: zatheros7 on Feb 24, 2014, 09:22 pm
@ lolocaledo
Hello- To answer your question directly, the solenoid valve is used to replenish the potable water in the hydroponic nutrient or aquaponic nutrient  tank. I am trying this valve as I have tried toilet tank valves in the past and they always fail at the worst time, or just fail and waste your money by flushing all of your nutrients out on the ground.

I too am building this project, started mine about 2 weeks ago, most of my parts are in from china and Hong Kong. Still missing a few. I attempted to build a PH controller using the practical maker arduaruim PH board a few years back. It did not work as the PH board can not be calibrated to span the PH range needed for plants. I was not aware of the Phidgets board at the time. (THANK YOU BILLIE!!)
I grow salad greens in plastic beer cups filled with small lava chips placed in PVC pipe similar to what Billie uses.

One of the pitfalls I have found with this build  is the additional code libraries needed have various and sundry names, and some have been updated and called a different name or obsoleted . I managed to sift the pearls from the shit and now have  Billie's latest code release compiling and loading on my mega. I want to get Billie's build working first , and then later add an  EC measurement to fully automate the system.  I currently use an BlueLab Truncheon for my EC reading now.

Where on the planet are you?   .nc  North Carolina?

With kind regards,
Zatheros
Title: Re: Billie's Hydroponic Controller
Post by: wikeda2 on Feb 28, 2014, 11:17 pm
Does anyone else run into issues when connecting the tft sheild pins to the MEGA? I am trying to use less cable, and when I connect the 20 pins to their respective slots on the MEGA and screen displays the image, but the code and the screen do not work at all. Which pins are we supposed to connect to?
Title: Re: Billie's Hydroponic Controller
Post by: McHero on Mar 07, 2014, 04:17 am
I have a like program running on an Arduino Mega. I'm also running a 3.2 inch TTF Touch Screen on a mega v2 shield.
Mega Shield utilizes pins 5V, 3V3, GND, 2-6, 20-41, & (50-53 for SD Card) I found it still runs 100% w/o pins 20 & 21 (the v2 shield does NOT have 20 & 21 thru header pins)
Title: Re: Billie's Hydroponic Controller
Post by: Leinonen on Mar 13, 2014, 11:15 pm
Hi everyone. I am working with this too. My problems is here:

Code is the same as uploaded here, Billie's Hydroponic Controller V1.1.2b

So, i cant find working ITDB02_Touch.h anymore. At first i have working lcd and touch, but the touch was upside down?? I changed the library, to another downloaded from somewhere, and the calibration is too much at the left...

So, i tried the UTouch, and it worked pretty great, BUT.. Touch stop working, when plugged to external power supply??? Working OK when connected to computer, until reboot with ext power...

Anyway, the touch works with the ''right''  ITDB02_Touch.h, but upside down.. Work with external power too :)

Anyway, how i can calibrate this display?
Can i use Utouch someway?

Sorry about being noob, bought my first arduino about two months ago.. :) and sorry about my bad English.. :D
1st post at the forum , jihaa!
Title: Re: Billie's Hydroponic Controller
Post by: venklem on Mar 26, 2014, 02:02 pm
Hey Billie, I am interested in regarding hydroponic system. On the controller to add the EC (PPM) probe and Dosage for fertilizer. Interests elsewhere to get the cheapest material to the matter up and run.
Greetings!
Title: Re: Billie's Hydroponic Controller
Post by: MiracleDro on Mar 30, 2014, 05:03 am
Just wanted to say thanks for all the great info. I'm still turning on LED lights so I am far from understanding all of the code. However I have been growing in hydroponics for ten years and understand what I want to automate and how to do it. (just not how to write yet). What a great thread you have going here. What a great start for anyone looking to automate. I know it's time consuming answering all of these questions so just wanted to say thanks. Not a lot of people are willing to keep up with all the questions so it's great to see your willingness to spread the knowledge. An idea I had for nutrient mixing etc is to mix nutes in a different reservoir and then have a pump from there to your current reservoir. You could then set your floats to activate the pump in the nute reservoir. You could set the program to add from nutes reservoir if ec of the nutes reservoir is proper level else fill from plain water or whatever you currently do. I know I like to add in plain water for a couple top offs and then do half strength nutrients until I change the reservoir out so that could also be programmed as well.

In your new nutrient reservoir you could even have a separate controller if needed and setup similar to your ph method with a delay after a certain amount of nutrients are added in order to assure your reading is valid. If you using a 2 part nutrient you could set it up to add part A until ec is met then add part B in same fashion. Just my .02

Also would any of these TDS sensors work with arduino? http://webpages.charter.net/tdsmeter/products.html

Looking forward to learning more. Thanks again for all of the contributions from everyone.
Title: Re: Billie's Hydroponic Controller
Post by: tuongkha on Apr 28, 2014, 08:54 am
Hello Billie,

Are you still there??
Title: Re: Billie's Hydroponic Controller
Post by: dxco on Jun 15, 2014, 11:45 pm

Hey DX,

Thanks for your kind reply!! The purpose of this project was to create a low budget, open-source controller which could be used all over the world so people could improve their crop yield and have more money to spend on other things other then food...
Though this project is still in it's infancy I hope one day it will be used by many people.
And off course I'm interested to see your code so you'll soon get a pm from me :D
The screen shots from your web interface look very promising, though implementing CO2 wasn't initially in my plan. I looked it up for some idea's about it and one could build a CO2 generator for a very low budget...So thanks for pointing this out to me ;)
Will be looking out for some cheap CO2 sensors out there...

With kind regards,

Billie



Hey Billy -Had not logged on for a while & didn't see your post & message.
I'll past the code to control CO2 using an analog source or 0-5vdc >>my monitor actually is 0-4vdc = 0-2000ppm but that's OK. There are a lot of off-the-shelf CO2 sensor/monitors made for the HVAC industry with o-10VDC output so a simple voltage divider circuit would do the trick (use 1% resistors & a mathched pair to get 0-5vdc & then change the arduino code for 0-5v or whatever.
The monitors I am using are made by a company called PureChoice -they contain a Telaire 6004 CO2 module >>and a Senserion SHT15 temp/RH sensor. Both the Telaire and Senserion sensors are the best of the best at their price level.  Too bad PureChoice went out of business because they had some great products -although good for me because I was able to buy the NOSE monitors on the cheap (less than the cost of the sensors! --and less than the price of the crappy no-name sensor I saw that some guy in another post bought from futurlec (or something like that).
Anyway, back to the sensor. Here is the NOSE unit http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=231088338207 -And
The NOSE has the Telaire & Senserion sensors & uses a Freescale Coldfire MCF5329 processor, running uCLinux with 256MB SDRAM & 128MB Flash memory, external LAN USB controller >which is strange because there are no USB ports -plus the processor has multiple USB ports and an onboard LAN controller -They really overkilled everything. There is also a SVGA LCD controller onboard but it's driving a 8x2 LCD!  There is a webserver so you can view the temp/RH/CO2 via the web as well as a lot of other data about the device status (mostly there to communicate with PureChoice servers that no longer exist -So every once in a while you get this "NO HTTPS" message.
I'm working on logging software with notifications if the temp/rh or co2 get out of whack (sms & email) but for now I just have remote view and graphing -which will keep logging as long as the host computer is running >can be remote computer, I'm currently loggin a couple local NOSE monitors & another in Canada.


Here is the CO2 control code. I don't use bottled CO2 so "fuzzy logic" (PID) control was not something I was concerned with but might be something to add later...
There is also some lines for LCD control that I don't use because the NOSE has its own display -but if you are using another CO2 sensor you might want an LCD display.

Looking at the code, I can say that it definitely can use some cleaning up!
But hopefully you or somebody else will find it useful!

code in next message (this post is too large)
*******************************************************************************************



Title: Re: Billie's Hydroponic Controller
Post by: dxco on Jun 15, 2014, 11:49 pm

// CO2 Controller for NOSE Monitor
// Feel free to distribute all or part of work but leave reference to www.dxhydro.com and monitor.dxhydro.com
// push button connect to GND and to PUSH_BUTTON_PIN
// SPDT switch connect center to GND, other switch pins to MODE_1_PIN and MODE_2_PIN

// if need pins D0 and D1 then remove all rows that contain 'Serial'

//!!!!!!!!!!!!!!!!!!
//BEFORE UPLOAD SET 'USING_PUSH_BUTTON' DEFINITION
//default is for a pushbutton to scroll from 1200, 1300 & 1450 or whatever you enter for setting values.
//A ON-OFF-ON toggle can also be used. If more level options are desired, they could be added to the code.
//Three was enough for me & If I want to go with a higher or lower set point, I'll change the code.
//!!!!!!!!!!!!!!!!!!

#define USING_PUSH_BUTTON 1   // 1 - push button 0 - SPDT switch

// pins

#define CO2_PIN A6
#define LIGHT_PIN A7

#define RELAY_PIN 12

// push button  start
#define PUSH_BUTTON_PIN 2  // for push button only pin 2 !!!
#define PUSH_BUTTON_SELECTOR_PIN 5
#define buttonInterrupt 0
// push button  end

// SPDT switch  start
#define MODE_1_PIN 2
#define MODE_2_PIN 5
// SPDT switch  end


#define OVVERIDE_LIGHT_PIN 3
#define MAY_OVVERIDE_PIN 4

#define L1600_PIN 10
#define L1400_PIN 8
#define L1250_PIN 6

// sensors constant
#define CO2_LEVEL_TRESHOLD 200   // 200ppm
#define CO2_BAD_LEVEL 320  // 300 ppm If reading is below 350, there is a problem with the sensor & CO2 relay will turn OFF

#define LIGHT_HIGH_LEVEL  256 //if light sensor > 300 (0-5V == 0-1023  1.5v=~300  1023*1.5/5=~300)then light is on else off
// might need to tweek this number a bit, depending on the photocell -you can bypass this input too

#define DEFAULT_CO2_MAX_LEVEL 1600    // OLD WAS 1300


// EEPROM
#define BUTTON_COUNT_ADDR 0  //address in internal EEPROM for store CO2 max level when using push button

// LIBS
#include <EEPROM.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
//Libs for I2C LCD

LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27  CHANGED TO 0x21

int maxLevelsCount=3;
int maxLevels[] = {1600,1400,1250};

boolean waitForMax=true;

boolean isPushButton=false;
int buttonCount=0; // ->maxLevels[0] == 1600
boolean buttonChange=false;


void prepareSwitchPins(int pin1, int pin2){
 pinMode(pin1, INPUT);
 pinMode(pin2, INPUT);
 digitalWrite(pin1, HIGH);
 digitalWrite(pin2, HIGH);
}

void detectLevelSelectorType(){

 isPushButton=USING_PUSH_BUTTON==1;
 
 /*
 prepareSwitchPins(PUSH_BUTTON_PIN, PUSH_BUTTON_SELECTOR_PIN);
 isPushButton=digitalRead(PUSH_BUTTON_PIN)==HIGH && digitalRead(PUSH_BUTTON_SELECTOR_PIN)==HIGH;
 */
}

void setupPushButton(){
 prepareSwitchPins(PUSH_BUTTON_PIN, PUSH_BUTTON_SELECTOR_PIN);
 
 attachInterrupt(buttonInterrupt, Rise, RISING);
}

void setupSPDTSwitch(){
 prepareSwitchPins(MODE_1_PIN, MODE_2_PIN);
}

void setPinsMode(){
 pinMode(RELAY_PIN, OUTPUT);
 
 pinMode(L1600_PIN, OUTPUT);
 pinMode(L1400_PIN, OUTPUT);
 pinMode(L1250_PIN, OUTPUT);
 
 pinMode(OVVERIDE_LIGHT_PIN, INPUT);
 pinMode(MAY_OVVERIDE_PIN, INPUT);
}

int getCO2Level(){
 byte i=0;
 long s=0;
 while(i<10){
   s+=analogRead(CO2_PIN);
   i++;
 }
 int a=s/10;
 if(a>820){a=820;} // 4 volts its 820 from analogRead (1024/5 * 4 = 820)   5 -> max volts that read arduino
 int res=map(a, 0, 820, 0, 2000);  // 0 - 4  volts ->  0 - 2000 ppm
 return res;
}

int getLightLevel(){
 byte i=0;
 long s=0;
 while(i<10){
   s+=analogRead(LIGHT_PIN);
   i++;
 }
 int a=s/10;
 return a;
}


int getCO2MaxLevel(){
 if(isPushButton){
   return maxLevels[buttonCount];
 }else{
   int m1=digitalRead(MODE_1_PIN);
   int m2=digitalRead(MODE_2_PIN);
   
   int res=DEFAULT_CO2_MAX_LEVEL;
   
   if(m1==HIGH && m2==HIGH){res=maxLevels[1];} //1400
   if(m1==LOW && m2==HIGH){res=maxLevels[0];} //1250?
   if(m1==HIGH && m2==LOW){res=maxLevels[2];} //1600?
   
   return res;
 }
}

// 0 - OK may switch on relay  1 - light sensor <300  -1 - CO2 sensor failure
int getMaySwitchOnRelay(){
 int co2_level=getCO2Level();
 if(co2_level>CO2_BAD_LEVEL){
   int light_level=getLightLevel();
   int may_ovveride=digitalRead(MAY_OVVERIDE_PIN);
   int light_ovveride=digitalRead(OVVERIDE_LIGHT_PIN);
   if(may_ovveride==HIGH){
     return light_ovveride==HIGH?0:1;
   }else{
     return light_level>LIGHT_HIGH_LEVEL?0:1;
   }
 }else return -1;
}

//state - true then ON relay else Off relay
void switchRelay(boolean state){
 if(state){
   digitalWrite(RELAY_PIN, HIGH);
   
   //lcd
    lcd.setCursor(0, 0);
    lcd.print("CO2 ACTIVE");
   //lcd
   
 }else{
   digitalWrite(RELAY_PIN, LOW);
   
       //lcd    
     lcd.setCursor(0, 0);
    lcd.print("CO2 OFF   ");
   //lcd
 }
}

void switchOffAllLevelLeds(){
 digitalWrite(L1600_PIN,LOW);
 digitalWrite(L1400_PIN,LOW);
 digitalWrite(L1250_PIN,LOW);
}

void showLevelLed(){
 switchOffAllLevelLeds();
 int maxLevel=getCO2MaxLevel();
 if(maxLevel==1600){digitalWrite(L1600_PIN,HIGH);}
 if(maxLevel==1400){digitalWrite(L1400_PIN,HIGH);}
 if(maxLevel==1250){digitalWrite(L1250_PIN,HIGH);}
}



void setup(){
 Serial.begin(9600);
 
 //LCD
   lcd.init(); // initialize the lcd
 lcd.backlight();
 //LCD
 
 detectLevelSelectorType();
 
 buttonCount=EEPROM.read(BUTTON_COUNT_ADDR);
 if(buttonCount>=maxLevelsCount){buttonCount=0; buttonChange=true;} //reset if EEPROM is clear
 
 if(isPushButton){
   setupPushButton();
   Serial.println("PUSH BUTTON");
 }else{
   setupSPDTSwitch();
   Serial.println("SPDT SWITCH");
 }

 setPinsMode();
}


void loop() {

 showLevelLed();
 
 if(buttonChange){
   buttonChange=false;
   Serial.print("Change CO2 level to:");
   Serial.println(getCO2MaxLevel());
   EEPROM.write(BUTTON_COUNT_ADDR, buttonCount);
 }

 
 int sres=getMaySwitchOnRelay();
 if(sres==0){
   
   //getting co2 level
   int co2max=getCO2MaxLevel();
   int co2min=co2max-CO2_LEVEL_TRESHOLD;
   int co2level=getCO2Level();
   
   Serial.print("CO2: ");
   Serial.print(co2level);
   //LCD
   

   //LCD
   
   Serial.print(" max level:");
   Serial.println(co2max);
   //LCD
   lcd.setCursor(0, 1);
       lcd.print("Set Point: ");
   lcd.print(co2max);
   //LCD
   
   // condition for switch relay
   if(co2level>co2max){
     switchRelay(false);
     waitForMax=false;
   }else{
     if(co2level<co2min){
       switchRelay(true);
       waitForMax=true;
     }else{
       if(waitForMax){
         switchRelay(true);
       }
     }
   }
 }else{
   switchRelay(false);
   
   if(sres==-1){Serial.println("CO2 sensor failure!");}
   if(sres==1){Serial.println("Not enough light!");}
 }
 delay(500);
}



//debounce push button logic

volatile int buttonState = LOW; //initial button state
volatile long lastDebounceTime = 0;   // the last time the interrupt was triggered
long debounceDelay = 30;    // the debounce time; decrease if quick button presses are ignored

void Rise()
{
 long currentTime = millis();
 if ((currentTime - lastDebounceTime) > debounceDelay)
 {
   lastDebounceTime = currentTime;
   if (buttonState == LOW)
   {
     buttonState = HIGH;
     attachInterrupt(buttonInterrupt, Fall, FALLING);
   }
   Switch();
 }
}

void Fall()
{
 long currentTime = millis();
 if ((currentTime - lastDebounceTime) > debounceDelay)
 {
   lastDebounceTime = currentTime;
   if (buttonState == HIGH)
   {
     buttonState = LOW;
     attachInterrupt(buttonInterrupt, Rise, RISING);
   }
 }
}

void Switch()
{
 buttonCount++;
 if(buttonCount>(maxLevelsCount-1)){buttonCount=0;}
 buttonChange=true;
}

Title: Re: Billie's Hydroponic Controller
Post by: Paul_Hoover on Jul 18, 2014, 04:00 am

To those still having issues with the Greenhouse controller touchscreen, here is how I setup mine

Running on mega2560
SainSmart 3.2 touchscreen with the adapter board. Kit C97

I made three ribbon cables to go between the adapter and the mega and plugged them in as if plugged directly.
               I now have access to those missing pins :)

Do a global search and replace for the ITDB02_Touch  and make it Utouch

Do not downgrade gcc.
 
The X axis is the problem with the system regardless of ITDB02_Touch or Utouch

The Y axis is fine, the scaling is fine.

X reads Right to Left NOT Left to right as it should.
Someone can probably tell me which two wires to swap for that to work normally
      but cant be fixed if you are plugged in directly to the mega :(

So you have about a dozen simple edits:

Find every         if ((x>=207) && (x<=307))
                                  These numbers can be ANY number

aka:                       if ((x>=LeftSideasZeroValue) && (x<=RightSideasZeroValue))
                   
And we need:    if ((x>=RightSideasZeroValue) && (x<=LeftSideasZeroValue))
                     
Subtract each number from 312 and put the new values back but reverse them


                                  if ((x>=207) && (x<=307))   becomes    if ((x>=5) && (x<=105))

Have fun.












Title: Re: Billie's Hydroponic Controller
Post by: pepadew on Jul 25, 2014, 09:09 pm
is there an easy way to run this on the yun without lcd/tft but with website controls/monitor?
Title: Re: Billie's Hydroponic Controller
Post by: BillieBricks on Aug 28, 2014, 03:19 pm
Hey Everyone,

Long time since I've been on the forum...Great to see that this thread has taken off so nice!! :)
I'm currently busy on a few projects with Arduino - 3D printer, A domatica system for the garden and...A new version of the Hydroponic Controller. This last one will be upgraded so that one can also measure/control the EC value of the nutrient tank.
Also will be trying to incorporate the ethernetshield so it can output data to Cosm (or what it's called today ;) ) if there is enough room for it. I'm currently using the Aduariumshield from Practical Maker as hardware since this shield has got everything we need for this project. Only an Ethernetshield and TFT screen need to be added.
When I'm ready for it I will put the documentation for this project online and you'll all be able to enjoy this upgrade ;)



I just wanted to ask... Have you tried to use the integrated SD card slot on the rear side of the LCD/TFT panel?
When I use the adjustable shield directly on top of the Mega, it works, but with the (8-bit) wiring like in your picture and adding MISO, SCK, CS(SS) and MOSI  to pins 50,52,53,51 (and shield's 16,17,35,34)  I have no luck so far. I am not sure which other pins I should connect or if it is at all possible. I do not know if you are using the break-out SD module for convenience or if you have ran into problems also.

The integrated SD reader from that specific TFT screen wasn't functioning. The seller on Ebay admitted this after a long time communicating about it... So I had to use an external one.



Hello Billie,

Are you still there??

Yes I am, but have been doing some other stuff. :)



is there an easy way to run this on the yun without lcd/tft but with website controls/monitor?

I don't have a Yun so I can't say...


Greetings Billie
Title: Re: Billie's Hydroponic Controller
Post by: HappySmack on Sep 20, 2014, 03:45 am
So glad to see you're still here Billie.

A "friend" told me that he could build myself a killer controller for my system. After 4 months of requesting as to where my controller was, I was given a box of parts and told of a "Billie" to Google search for. So here I am. Struggling with finding libraries, editing code, and crying. But also learning so much.

Needless to say, I am looking forward to version 2 being made available. I am also excited to see as how you have implemented the Arduarium Shield into your project.

  Since I am not a programmer at all, I would like to help either monetarily or by acquiring parts for you.  At some point in a forum I had noticed that someone offered to send some Bitcoin in appreciation for your efforts. I wasn't sure if you were still using that address. Upon checking the blockchain, I see no transactions. I would like to send you a little bit to help with your en devours. I can't offer much but if you can provide a Bitcoin, Litecoin, or Dogecoin address I would be more than happy to send you the equivalent of .075 BTC.

  Thanks again for all of your efforts and I look forward to seeing updates.
Title: Re: Billie's Hydroponic Controller
Post by: jms_ on Oct 12, 2014, 02:45 pm
Hello everyone,

I started to build this project for my hydroponic system. A lot of work for a beginner but also tons of fun.

I have my Arduino up and running, display, pH probe & RTC attached. Guess my DHT22 sensor was faulty, couldn't get any readings from it. Ordered few replacement parts for that.

Now I'm  trying to hook up relay, peristaltic pumps and power adapters. Is this correct way to do it?

https://www.dropbox.com/s/mj34eeyrrlqk80w/example.png?dl=0 (https://www.dropbox.com/s/mj34eeyrrlqk80w/example.png?dl=0)
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Oct 16, 2014, 02:48 pm
This thread is so amazing, and am very glad Billie is sharing his schematics and code for free as many others would see this as an opportunity to get money.  I too got into Arduino to automate my indoor grow as using timers everywhere with extension cord on top of extension cord is just not safe or practical.  I only have an Uno/r3 now and a few LEDs/resistors, but this is just to learn some coding and interfacing skills.  I (like Billie) am on a vise tight budget and once my HID lighting is turned on, all available funds are going right into the power bill.  I have taken the time to carefully read all 10 pages of this thread and will reread them all to better absorb the things I need to learn.  I am eagerly awaiting Billie's latest developments for EC and ethernet capabilities.

1)  will your controller be able to be controlled remotely, say from a smartphone?
2) will wireless control lend towards freeing up space used for processing and defer the need for that space to the host device?  Being unlearned in this, my ignorance might have gotten the best of me but if the mega is coupled to something like a raspberry pi, can't the Pi be utilized for processing and also redirect every parameter to the internet for wireless control?

I am hoping to one day be able to change out my reservoirs remotely via smartphone.  I change out my reservoirs every 7 to 10 days as EC/PPM readings do nothing towards alerting me how much N, P, K and all the micros and trace elements were consumed, so I must waste that and constantly rebuild to have the best balance of everything.  With that said, I have a pretty strict recipe using mostly General Hydroponics nutrients, but having to manually do everything to multiple reservoirs is too much and very cumbersome.

TYIA Billie for being who you are, and TYIA to all those helpful individuals sharing to this thread.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Oct 19, 2014, 09:44 pm
Thank you very much, this is a very nice project that I plan on using, thanks for sharing! I was just wondering how I would change the temperature from C to F?

and also, I was wondering where the coding is at for the DHT11, you dont call out a library for it or have anything in the source code that calls out much
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Oct 21, 2014, 06:47 pm
Would it be possible to merge the arduino with a raspberry pi to also use say a web cam on top of, or in conjunction with Billie's HC?  It would sure be nice to have the ability to visualize our gardens without needing to be physically there.
Title: Re: Billie's Hydroponic Controller
Post by: Josepgatius on Oct 23, 2014, 11:57 pm
Help
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Oct 25, 2014, 08:59 am
Hi everyone,  and good work Billie. I am excited to start my garden controller project. I have been looking for someone that has made a good controller, that is open source. I just downloaded the Hydroponic Control v 1.1.2b? Can someone confirm that it is the latest or most current version? I also planning on adding a co2 sensor and just copied the post by DX and hope to be able to modify the code if needed. I see that many people are having trouble with touchscreens. Anyone know of which one is the most reliable and will be compatible with the code as is?

Thanks for any help..
Title: Re: Billie's Hydroponic Controller
Post by: jms_ on Oct 25, 2014, 01:48 pm
I've this (http://www.sainsmart.com/sainsmart-3-2-tft-lcd-display-touch-panel-pcb-adapter-sd-slot-for-arduino-2560.html), with UTFT.h and ITDB02_Touch.h libraries it works with Billies v 1.1.2b code. Although for some reason y-axis coordinates for the buttons were upside down and had to change those to get it working properly..
Title: Re: Billie's Hydroponic Controller
Post by: le_shanny_koomb on Oct 30, 2014, 11:44 pm
What would be the best arduino for this?  Looking to the best one with lots of inputs/outputs.  I know nothing about this but I'm jumping in anyway.
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Nov 08, 2014, 08:54 am
What would be the best arduino for this?  Looking to the best one with lots of inputs/outputs.  I know nothing about this but I'm jumping in anyway.
Billie used the mega, you can see his list of parts in the beginning of the code, or on page one of this thread.


I've this (http://www.sainsmart.com/sainsmart-3-2-tft-lcd-display-touch-panel-pcb-adapter-sd-slot-for-arduino-2560.html), with UTFT.h and ITDB02_Touch.h libraries it works with Billies v 1.1.2b code. Although for some reason y-axis coordinates for the buttons were upside down and had to change those to get it working properly..
I used your link to get that same tft, just got it in and most of the rest of the parts I am going to use, but it seems billie has a shield of some sort on the bottom of his, mine had the 40 pin connector and a sd read/writer on the bottom but not sure what shield to use to get the wiring correct?? Anyone know of any detailed schematic that I can use to wire up the tft screen?

I also am going to be modifying the code to make it have wireless control of the ph sensors and float switch. Anyone have any experience with the rf24 wireless transmitters??
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 08, 2014, 04:59 pm
I also am going to be modifying the code to make it have wireless control of the ph sensors and float switch. Anyone have any experience with the rf24 wireless transmitters??
I have also been thinking of doing this, I ordered a Spark Core (https://www.spark.io/) which should be here Monday so I'm going to see what I can do. First I'm going to see if I can get it to just monitor my sensors and eventually change settings as well.
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Nov 08, 2014, 05:20 pm
I am new to arduino, but not to pcb's. I am hoping I can modify the code to do what I am wanting. I am not going to do ph adjustment, just monitoring. I am also thinking about adding ec. And I am going to add co2 sensor, with adjustment and relay to run a 120v solenoid. Also like I said in my earlier post I am looking to maybe make the reservoirs  remotely controlled via the rf24's. But that is going to be quite a challenge as I cant find much info on how to get these working. I did find a library for them and some examples. Hopefully I can decipher and overcome :)
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Nov 08, 2014, 05:49 pm
I have also been thinking of doing this, I ordered a Spark Core (https://www.spark.io/) which should be here Monday so I'm going to see what I can do. First I'm going to see if I can get it to just monitor my sensors and eventually change settings as well.
Wow, this is exactly what I am wanting to do with my project, it is amazing how many new things are available, and how many opportunities are out there for us to experiment with. I am very interested in working on this and helping integrate it with my hydro controller.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 08, 2014, 06:56 pm
I pretty much have the code all written to monitor all the sensors (minus the tank level) via the spark core but I'm still working on integrating the ph sensor to the Spark and waiting on parts to test the code but its looking pretty solid so far.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 09, 2014, 02:05 am
i seem to be having problems with my screen, it lights up but noting is displayed. I bought exactly what billie recommended and have it hooked up just like he said "The 3.2" TFT fits on top of the mega. But you only need to connect pins 2-6 for the touch, 22 - 41 for the display & connect GND, VCC and 3.3V"

Can someone let me download their libraries to replace them with mine because I feel like that's the problem?


I can upload example sketches like blink and it works just fine so uploading sketches isn't the problem.
Title: Re: Billie's Hydroponic Controller
Post by: jms_ on Nov 10, 2014, 10:05 am
Check out this page: http://www.geeetech.com/wiki/index.php/3.2TFT_LCD

You can find schematics there on how to hookup display straight to arduino, no shield between. Worked for me.

Someone said that if you connect Led-a pin from display to digital pin in arduino instead of 5v pin, you're able to control display backlight. Command can be found in Hennings utft library manual. But haven't tested this.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 10, 2014, 11:17 pm
Check out this page: http://www.geeetech.com/wiki/index.php/3.2TFT_LCD

You can find schematics there on how to hookup display straight to arduino, no shield between. Worked for me.

Someone said that if you connect Led-a pin from display to digital pin in arduino instead of 5v pin, you're able to control display backlight. Command can be found in Hennings utft library manual. But haven't tested this.
ok well i just tried that, and still nothing but i think i made a discovery. I re-uploaded my sketch just to be sure, and I was going through the arduino IDE program and went to file>preferences> and then opened the preference TXT file at \AppData\Roaming\Arduino and noticed where it lists the last sketch uploaded path.


it says "last.sketch0.path=Z:\Program Files (x86)\Arduino\examples\1.Basics\Blink\Blink.ino"
when I know the last one i loaded was this one so i tried again and for some reason I think it's not uploading this sketch. I loaded different examples and the preferences.txt would update. But it seems like its not uploading the hydroponics controller sketch even though it says its done uploading each time with no errors :/
Title: Re: Billie's Hydroponic Controller
Post by: jms_ on Nov 11, 2014, 12:40 pm
You could try clearing EEEPROM, maybe that will help.
http://arduino.cc/en/Tutorial/EEPROMClear
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 11, 2014, 07:21 pm
You could try clearing EEEPROM, maybe that will help.
http://arduino.cc/en/Tutorial/EEPROMClear

thanks for the suggestion but it didn't fix the problem, though it did upload successfully .

Sorry for getting off topic everyone, I posted a separate thread (http://forum.arduino.cc/index.php?topic=278346.0) to try  to get help for my problem.
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Nov 16, 2014, 11:19 pm
Anyone know where DS for the rtc connects to?? Which pin? I read through the code and I don't see where it shows the pins are setup for the RTC, the scl and sda are marked on the mega.I looked at the photo of billy controller and it isnt easy to see. The sketch I used with the RTC 1307 when playing with it has it connected to digital pin 2?

 Also anyone know how I can change the Celsius to Fahrenheit?
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 16, 2014, 11:37 pm
The RTC module...SDA --> pin 20, SCL --> pin 21


and look here for info for the DHT http://playground.arduino.cc/main/DHT11Lib
Title: Re: Billie's Hydroponic Controller
Post by: redeye_joe on Nov 17, 2014, 04:58 am
The RTC module...SDA --> pin 20, SCL --> pin 21

Yes, I have those pins connected already, its the DS pin that I am trying to figure out.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 23, 2014, 06:12 pm
Well in case anyone was interested I now have mine fully up and working (besides the dosing pumps and pH sensor, which I'm still waiting for them to get here). I am now able to monitor the stats on my phone from anywhere in real time and it logs the data every hours and saves each one and automatically graphs the data. Even that I can access from my phone from anywhere.


If anyone is interested I can share some photos and diagrams and screen shots of my data capture methods
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Nov 28, 2014, 10:29 pm
Hey Everyone,

Long time since I've been on the forum...Great to see that this thread has taken off so nice!! :)
I'm currently busy on a few projects with Arduino - 3D printer, A domatica system for the garden and...A new version of the Hydroponic Controller. This last one will be upgraded so that one can also measure/control the EC value of the nutrient tank.
Also will be trying to incorporate the ethernetshield so it can output data to Cosm (or what it's called today ;) ) if there is enough room for it. I'm currently using the Aduariumshield from Practical Maker as hardware since this shield has got everything we need for this project. Only an Ethernetshield and TFT screen need to be added.
When I'm ready for it I will put the documentation for this project online and you'll all be able to enjoy this upgrade ;)

The integrated SD reader from that specific TFT screen wasn't functioning. The seller on Ebay admitted this after a long time communicating about it... So I had to use an external one.

Yes I am, but have been doing some other stuff. :)

I don't have a Yun so I can't say...


Greetings Billie
Hi Billie and nice to see you back here.
You're the one that helped me getting my hydroponic project rolling in May this year and a truly have to thank you for getting me in the right direction with your initial sketch. (1.1.2b)


My project has since then made your initial sketch fatten up to double it's size and packed with features and peripherals so i'm really happy i got this kick-start..


Now, i see you also have the Arduarium.. i also built my project around this and if you need any help with this i'd gladly help you out..  i have got PH and EC going with the DIY probe and also converted the code slightly to use with the 3.2" Touch LCD..

just in case you want to cut some corners regarding the precious thing we call..*time* ;)


Take care.
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Nov 28, 2014, 10:36 pm
Help
Post your sketch.
You are clearly making calls that have no support in the libraries or you've made programming errors.
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Nov 28, 2014, 11:07 pm
Yes, I have those pins connected already, its the DS pin that I am trying to figure out.

Hello.

I tried to look for what type of RTC is using the DS.. and it looks like its a "Data Select" or also called "Chip Select" ( CS) with which you tell the Arduino which peripheral you are communicating with if there are more items on that bus.. sort of an "On/Off switch"

Often you are free to set this DS / CS pin to whatever digital pin is free and this is done in your sketch

Good luck.
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Nov 29, 2014, 04:13 am
Well in case anyone was interested I now have mine fully up and working (besides the dosing pumps and pH sensor, which I'm still waiting for them to get here). I am now able to monitor the stats on my phone from anywhere in real time and it logs the data every hours and saves each one and automatically graphs the data. Even that I can access from my phone from anywhere.


If anyone is interested I can share some photos and diagrams and screen shots of my data capture methods
I for one would like to see.  On a very similar path, but am still too new to figure a lot out so need to see others projects, or as much as you'll show.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 29, 2014, 06:20 am
I for one would like to see.  On a very similar path, but am still too new to figure a lot out so need to see others projects, or as much as you'll show.
well first of all here are some pictures of the wiring. I extended all the wires for the sensors and the LCD screen because I plan on mounting them all a distance from the arduino. I took out some functions from billies project that I had no need for. I have designed a 3D enclosure that I am going to 3D print to house the board and the dosing pumps.

(http://i.imgur.com/IYvnvsg.jpg)
(http://i.imgur.com/r9QmNDf.jpg)

This screen shot shows the remote web page that displays all the info from the sensors and can be accessed from any kind of device from anywhere. These only show certain stats that I would like to be able to monitor when I am away. I also choose to graph the important parameters so I can track trends and see what needs to me tweaked with all my timers and what not.

(http://i.imgur.com/zA2NYna.jpg)

The data on that graph is just from inside my house so that's why it isn't showing much fluxuation, I just recorded some data to test everything out :P
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Nov 29, 2014, 11:45 am
Nice Mike!  What do the relays control?  There won't be any EMI to worry about, will there?  I just got my Mega and EtherShield and am hoping to be able to manage roughly 3 vegetative rooms and about as many flower rooms from a single board, do you think this is achievable or am I setting the bar too high?  Do you know of any possible ways to multiplex the sensor shields so that multiple sensors can be read from a single shield?  I am hoping to one day control 5 HID light schedules, roughly 4 duct fan schedules, 2 DHT22 temp/RH sensors per room, heat management, humidity management and reservoir management which I expect itself to be pretty complex so reservoirs can be created (filled) with RO and nutrients via gravity and solenoid valves and peristaltic pumps for the nutes.

I am hoping to be able to do all that with minimal resources as possible b/c my budget is almost non existent at the moment. 
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 29, 2014, 07:04 pm
The relays control the dosing pumps and I still have two open spots for future expanding if I find further use for them. As for EMI I haven't had any issues yet.

As for your project yea I believe that's totally feasible. It actually wouldn't be that difficult at all if you base it off of billies project and I HIGHLY recommend you use a Spark Core like I did unless the Ethernet shield has more I/O. I have no experience with the Ethernet shield but the spark core was idiot proof!

The only issue I see you running into is running out of I/O's for all the sensors and what not you want to hook up. And your going to have to extend all your wires like I did but longer if it's all going to be put in multiple rooms but that's not a big deal. Billie's project has everything you want to do by the sounds of it, so that's the hardest part done right there.

Do you know of any possible ways to multiplex the sensor shields so that multiple sensors can be read from a single shield?
Can you show me what shields you are talking about? my guess is no but I'd have to see it.
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Nov 29, 2014, 07:53 pm
Unfortunately I can't yet show you what I mean because I myself am not even 100% sure what I mean, let alone be able to point you in the direction of an image.  However, if you can imagine you PH shield for instance (or is it EC?), it has a single BNC connector for a single BNC probe on the other end.  I assume the chip/shield that the BNC connector is soldered to is capable of sending a voltage down to the probe, reading the condition of the returned voltage, then it sends a signal of sorts back up to the Arduino that performs a function, logs the data or populates that info onto the serial monitor.  Well if the BNC connector could be removed from that shield, and those empty solder points could be fixed with wires that could then be routed to a sensor shield to be divided out into slave channels.  Each of the channels would then be outfitted with BNC connectors, and as many slave slots that are on the sensor shield would then determine the number of PH (or EC?) sensors that can be connected, and only the original PH (EC?) shield would be tasked to take a reading from each of the slave positions of the sensor shield.

So as far as the Arduino is concerned, it only sees the single PH (EC) shield that is wired in/stacked and the Arduino controls it as normal, and as far as the arduino is concerned it takes a PH or EC reading every minute.  The values that return however are from each of the slaves and would be recorded separately in their own category of sensor readings.

It is definitely an incomplete concept in my head and I am still trying to learn what is possible and what is improbable.  From reading this entire thread twice, I know that Billie's controller is mostly geared for aquariums or greenhouse settings, but that is fine as the components included in his controller are the more difficult IMO leaving out only the simple on/off control of HID lighting and on/off fan times.  So for the most part, all the AC stuff is mostly on/off with the exception of fan speed control, but that's another topic for another thread and I am neck deep digging that one up as well.
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Nov 29, 2014, 08:10 pm
As far as spark core, I am a little wary about using wifi in this application as wifi is susceptible to all kinds of interference as well as snoopers.  The snoopers I can deal with, but the noise in the b and g internet protocols sketched me out the most, that's why I committed (prior to knowing all the ins and outs) to the Ethernet Shield.  I was able to find a decent ethernet shield clone that came with a genuine Mega 2650 for about $30 total, just had to wait a month as they shipped from China.  Ethernet can do all the same things wifi can do, I just need to supply the cabling and power supply.  THESE (http://www.adafruit.com/products/435?gclid=Cj0KEQiAs6GjBRCy2My09an6uNIBEiQANfY4zC6YeGzKGfG6ZHVil0YXgCKbRaN3x6LQDK-n2U48cZsaAmRG8P8HAQ) little fellas from adafruit will enable me to use POE to my arduino, I just need to ensure all the routing is set up correctly in my router and switch, plus also I believe a static IP needs to be assigned, but I've done that for my PS3 and am confident I can do it for my arduino.
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 29, 2014, 08:34 pm
ok I see what you mean by the sensors now, I'm really uncertain of that as well. I could see the ability to splice of the signal to multiple sensors as possible but I don't know how well the arduino would be able to read each one individually, that would all be in the coding but maybe it's possible but I'm sure someone has wondered this before too so who knows.


For my lighting and fan controls and automatic watering ( everything that's scheduled for certain times of the day ) will be controlled by this for my setup: http://www.aquacave.com/digital-aquatics-reef-keeper-lite-system-level-1-basic.html

And I'm not sure what to do about my fan speed control yet either, I have this plugged inline with my ducted fan: http://www.ebay.com/itm/191063176059?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

so I want to figure a way out to control that from my arduino but I haven't started researching that yet. My setup is very small compared to yours so I don't know if controlling fan speed is as important for me, mine will be pretty self contained.


Yea I totally understand I don't thin there's anything wrong using the ethernet shield, I think that's better for your large setup now that I think about it
Title: Re: Billie's Hydroponic Controller
Post by: ard_mike on Nov 29, 2014, 09:39 pm
And I'm not sure what to do about my fan speed control yet either, I have this plugged inline with my ducted fan: http://www.ebay.com/itm/191063176059?_trksid=p2060778.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

to quote myself here :P after I said this it got me thinking and I just solved this problem for me though I still need to test it but I'm certain it will work. I just re wrote the code to instead of turning on a relay to control the fans when it reaches a certain temperature, a servo will manually turn the knob on my controller I linked above. When it reaches a certain temp the fans will turn up and once it gets down to the right temp it will turn the fan back down. Simple enough for my setup
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Nov 30, 2014, 12:52 am
Funny you said that as I started another thread asking for a way to remove the analog pot from my analog controller and someone replied with the same exact idea of using a servo.  Right now, my garden has so many wires and timers and plugs and cords everywhere it is such an eye sore.  I'd like to have everything with a cord just ran into something very clean and have the Arduino control all of it, but more important to me is the ability to access my garden wirelessly and have the ability to control or change any part of it from my smartphone.  When I get to where I'm going with this, I will share it on youTube with code, pinout schematics, the whole 9.  The tough part is getting to that point, but I don't have to tell you that, hehe.
Title: Re: Billie's Hydroponic Controller
Post by: jms_ on Dec 04, 2014, 11:11 am
Finally got my controller up and running. Thanks Billie, without your efforts this would've been mission impossible :)
Though it's not complete yet, I'm planning to add waterproof temperature sensor (DS18B20) but for now that will have to wait, need to take some time off from this :)

ard_mike: That remote monitoring system looks very intresting. Can you tell more about it?

(https://www.anonimg.com/img/1adbaf058e2bf9aa7e2bbf10bee5ca5b.jpg)
 
Title: Re: Billie's Hydroponic Controller
Post by: jgatiusbotet on Dec 04, 2014, 07:27 pm
hello
I'm sorry but I'm very late, I've been to other forums and internet to learn a little before enbarcarme in this project, I'm learning every day more, I've been seeing billli elsewhere with almost complete system, you know when you apostear , intend,
well let the mess you soon :o  :o  :o  :o
Title: Re: Billie's Hydroponic Controller
Post by: jgatiusbotet on Dec 05, 2014, 07:23 pm
you may be interested, I'm testing is similar, already tell me

www.theseus.fi/bitstream/handle/10024/81080/Griffiths_Mark.pdf
Title: Re: Billie's Hydroponic Controller
Post by: r-man on Dec 09, 2014, 03:24 pm
Hello Billie, I'm co inspired from this thread so I tried to build my own Arduino GrowRoom controller. My programming skills are below zero, so a friend programmed Arduino code and another one programmed JavaScript webpages. Take a look here, if You're interested http://growduino.cz/indexEU.htm (http://growduino.cz/indexEU.htm) .

There's no PH or EC probe, because I think theese are something if you set up properly at the beginning, it will not need any more measures during time. And also I don't have that really nice touch display, only classic 2x16 i2c. But I found it to be very usable to use internal webserver on Wiznet 5100 EthernetShield, so everything can be controlled via ethernet/internet/smartphone/tablet - everything with a internet browser. You can control your room/greenhouse from any place on Earth (well, if You're connected to internet and Growduino is also) and You don't need to install any application for it. And also alerts are implemented - Growduino will send You an email in case of bad situation.

What is measured:
Light outdoor
Light indoor (checking lamps)
Power
Air temperature 2x
Air relative humidity
Water temperature
Distance (ultrasonic water level)

What is controlled:
Light
Fan
Humidifier
Refiller (valve or pump for refilling tank)
Heater

What is "alerted"
Too hot air
Too cold air
Too hot water
Too cold water
Too much humidity
Too low humidity
Low water level
High water level
Lamp shines when should not
Lamp don't shine and it should
Power down

Check my webpage (it will be updated soon, maybe today).
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Dec 10, 2014, 02:23 pm
That is a nice setup r-man, i thought about that case when i built my box but didn't think of these black sockets you installed so it wasn't practical at the time and i wen't for another similar setup.. but.. the formfactor on your housing is really nice..
Are you planning for a touch LCD /ordinary LCD in that housing? Do you have a video of your program in action?
Next thing in my project will be internet connectivity 4 sure.. Really nice to keep  track of what your plant's and tree's are doing while you are away so they don't tear your home apart.. :)

Cheers
EDIT: Ah.. clever use of those cables / connectors at the bottom for all sensors.. why didn't i think of that.. thanks for the idéa.. im def going to convert to that now.
Title: Re: Billie's Hydroponic Controller
Post by: Arczi on Jan 11, 2015, 04:37 pm
This is a cool project has anyone implemented the ethernet shield into this sketch and does anyone know where in this thread is the most complete or fully functional sketch.  Thank you everyone for working on such a cool project.
Title: Re: Billie's Hydroponic Controller
Post by: acidu on Jan 19, 2015, 10:12 pm
take a look here to this ...more advanced GUI hydroponic controller

 https://www.youtube.com/watch?v=nq5Wde_V-TE (https://www.youtube.com/watch?v=nq5Wde_V-TE)


allso I have spent many hours finding the code, with libs included...below you have a download link... I do not have an arduino board so I can not test it.. ..please feel free to test and come back with results.

https://drive.google.com/folderview?id=0B-lR228ZHhB6dTFSSURjeEg5aTQ&usp=sharing (https://drive.google.com/folderview?id=0B-lR228ZHhB6dTFSSURjeEg5aTQ&usp=sharing)
Title: Re: Billie's Hydroponic Controller
Post by: acidu on Jan 19, 2015, 10:24 pm
...and let`s make a working hydroponic controler and share it for free
Title: Re: Billie's Hydroponic Controller
Post by: r-man on Jan 26, 2015, 11:20 pm
Why not, here it is

I've made a Growduino :-)
http://growduino.cz/indexEU.html
Title: Re: Billie's Hydroponic Controller
Post by: acidu on Feb 05, 2015, 12:05 am
 REALLY good starting point, I like it, add a ph, ec,(TDS conversion), 4 dosing pumps, raindrop sensor to shut off something and email is someting gone bad , wild :)), and it will be TOP ! ;),

take a look at what I`v shared... jarduino Aquarium Controller , you can inspire from there regarding ph ..your desing is fine and simple, but if you wanna display more info at once, you`ll need a bigger lcd



prices are in CZK?
Title: Re: Billie's Hydroponic Controller
Post by: r-man on Feb 07, 2015, 04:09 pm
REALLY good starting point, I like it, add a ph, ec,(TDS conversion), 4 dosing pumps, raindrop sensor to shut off something and email is someting gone bad , wild :)), and it will be TOP ! ;),

take a look at what I`v shared... jarduino Aquarium Controller , you can inspire from there regarding ph ..your desing is fine and simple, but if you wanna display more info at once, you`ll need a bigger lcd



prices are in CZK?
Yes, prices are in CZK. To add PH and EC I need to switch to IDE 1.5.8 - this means code rewrite in some areas (DHT22 sensor was totally unstable) for getting more free memory. Then will be the right time to add sensors like PH, EC, CO2, Raindrop....But emails are working now, this is so crucial for "remote gardening".

And yes, bigger LCD is on the wae, I'be purchased 4x20 char, that will be maybe enough.  The main power is in web GUI, there you can see everything and nice :-)
Title: Re: Billie's Hydroponic Controller
Post by: arizno on Feb 13, 2015, 01:29 am
Has anybody incorporated CO2 into this project? Would it be easy to install one?
Title: Re: Billie's Hydroponic Controller
Post by: undergroundways on Feb 21, 2015, 12:30 am
Mark Griffiths controller:
i have tried compiling the files but i receive this error:

In file included from HydroControl_UI.ino:56:
C:\Users\Name\Documents\Arduino\libraries\HydroponicsEngine/HydroponicsEngine.h:57:54: error: ../PhidgetsORPpH/PhidgetsORPpH.h: No such file or directory
In file included from HydroControl_UI.ino:41:
C:\Users\Name\Documents\Arduino\libraries\EEPROM/EEPROM.h:32: error: conflicting declaration 'EEPROMClass EEPROM'
C:\Users\Name\Documents\Arduino\libraries\EEPROMex/EEPROMex.h:166: error: 'EEPROM' has a previous declaration as 'EEPROMClassEx EEPROM'

i am confused what i should do about PhidgetsORPpH.h since there isn't a library for that.  not sure what to put in the PhidgetsORPpH.h file.   also having issues with EEPROM library which i am looking for a working version.  i have billie's controller working fine.  any suggestions?  thanks
Title: Re: Billie's Hydroponic Controller
Post by: acidu on Feb 22, 2015, 02:00 am
here is another cool project that might help ypu inspire :

video: https://www.youtube.com/watch?v=PqTIHmzoxf0
 
with code

http://www.plantedtank.net/forums/showthread.php?t=677265

Title: Re: Billie's Hydroponic Controller
Post by: badpaddler on Mar 06, 2015, 09:46 pm
So I am having a problem where as my LCD will turn on, and drops rapidly down to around 4.23    , then completely freezes up. I am currently using the 1_1_2B. Thoughts? Does anyone have a wiring diagram for this as of yet? 
Title: Re: Billie's Hydroponic Controller
Post by: amonefe on Mar 20, 2015, 05:48 pm
Did you make any shematic for that
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Apr 02, 2015, 11:12 pm
So I am having a problem where as my LCD will turn on, and drops rapidly down to around 4.23    , then completely freezes up. I am currently using the 1_1_2B. Thoughts? Does anyone have a wiring diagram for this as of yet? 
I had to tweak the hell out of 1.1.2b code before my project even started running and from there another 40-ish hours getting stuff to run smoothly without issues.. now, 8 months and 100's of little tweaks later, what's left is the semi-original name "Hydroponic controller" :-)..

Do you use the exact same components as Billie's original? The voltage drop either tells me you have some component requiring more juice than the Arduino can deliver.. or a malfunctioning component.. or it could be the code trying to initialize the SPI-bus where one or more components are not fed with correct amount of voltage..   I had similar issues in the beginning with the DeadOn RTC DS3234 and the SD card where the DeadOn randomly lost power which made the SD card hanging not being able to initalize.. having no code to handle the error either just froze up the  display or stopped everything from working completely..

my problem was the converted PC Powersupply where the separate 3.3V rail could go cold without notice so hooking the DeadOn and the SD-card up to another 3V supply fixed the problem..

Title: Re: Billie's Hydroponic Controller
Post by: Mike_V_Florida on Apr 03, 2015, 08:53 am
This has been alot to digest.
I found the  UTFT library on the moved site, http://www.rinkydinkelectronics.com/library.php but not the ITDB02_Touch library. Can someone help?
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Apr 03, 2015, 09:16 am
This has been alot to digest.
I found the  UTFT library on the moved site, http://www.rinkydinkelectronics.com/library.php but not the ITDB02_Touch library. Can someone help?
Hi.. Have you tried this?
Utouch (http://www.rinkydinkelectronics.com/library.php?id=55)
Title: Re: Billie's Hydroponic Controller
Post by: Mike_V_Florida on Apr 04, 2015, 08:56 am
Hi.. Have you tried this?
Utouch (http://www.rinkydinkelectronics.com/library.php?id=55)
No I don't see ITDB02_Touch there.
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Apr 05, 2015, 11:19 pm
No I don't see ITDB02_Touch there.
Sorry for not clarifying and i meant UTFT.. not Utouch.. sorry again

..and the meaning of this is that UTFT library already supports a lot if adapters and you change this in the sketch.. there's no separate Utouch sketch for every adapter

The funny part is that there's said to be support for the ITDB02 on the webpage but i couldn't find it in the UTFT header.. it might have been updated since i DL'd it.. well.. hope you get it running

Code: [Select]
#include <UTFT.h>
#include <UTouch.h>

// Initialize display
// ------------------
// Set the pins to the correct ones for your development board
// -----------------------------------------------------------
// Standard Arduino Uno/2009 Shield            : <display model>,19,18,17,16
// Standard Arduino Mega/Due shield            : <display model>,38,39,40,41
// CTE TFT LCD/SD Shield for Arduino Due       : <display model>,25,26,27,28
// Teensy 3.x TFT Test Board                   : <display model>,23,22, 3, 4
// ElecHouse TFT LCD/SD Shield for Arduino Due : <display model>,22,23,31,33
//
// Remember to change the model parameter to suit your display module!


UTFT    myGLCD(ITDB32 ,38,39,40,41);  <--- Here is where you normally set the adapter
Title: Re: Billie's Hydroponic Controller
Post by: njohnson11 on Apr 09, 2015, 07:24 pm
Has anyone expanded on this to include an EC sensor/controller for the nutrients based on an EC target?
Title: Re: Billie's Hydroponic Controller
Post by: myggle on Apr 10, 2015, 06:40 pm
Has anyone expanded on this to include an EC sensor/controller for the nutrients based on an EC target?
I've looked at this a little and of all types of devices I want in my garden, EC and PH measurement seam to be the most complicated, so I will be saving that for last when working phases into my project.

Phase 1 - Online Mega 2650r3, data logging, basic web page, 8 channel relay for lights and feed pumps, and a DHT22 temp/RH sensor.  "If" statements are used to cycle on fans based on high readings from DHT.

Phase 2 - water movement into garden and waste from garden, and peristaltic pumps for meting in nutrients into the system, clickable buttons on the web page to cycle on solenoid valves and pumps.  As PH and EC are not yet included, the gardener needs to be present, but everything can be done from the smartphone.

Phase 3 - PH and EC.  I'm leaning towards using these Atlas Scientifichttp://www.atlas-scientific.com/circuits.html? (http://www.atlas-scientific.com/circuits.html?) products, but as I am running multiple reservoirs at varying nutrient concentrations, I am wanting to only use a single "stamp" per each form of measurement, and hopefully I can later learn how to multiplex signals so I can have a probe in each reservoir, all linking back to that single stamp.  Otherwise my GPIO will quickly get used up, not to mention my project will get significantly more expensive.
Title: Re: Billie's Hydroponic Controller
Post by: Mike_V_Florida on Apr 21, 2015, 08:35 am
Thanks for the libraries!! I'm gettin' all the individual parts together and learning the code.

I have an outdoor unit so fans and lighting are not necessary for me. As i said i'm learning the code to see what I can eliminate, and how do do it.

I plan to auto control water level, add nutrients based on the water used (for now). Measure the PH and adjust automatically. For general information, the air and water temp as well.

I've using the www.towergarden.com/ (http://www.towergarden.com/) unit manually for a few years now and want to go the "next step".
Title: Re: Billie's Hydroponic Controller
Post by: Mike_V_Florida on Apr 22, 2015, 10:26 pm
If anybody is still reading this I need more help/understanding of what is happening.

In the ino for v1.1.2b

There are lines;

#define dht_dpin 69   //pin for DHT11

Can someone explain this to me? #define is a macro is it not? What does that have to do with calling out a pin?

And if it is a pin pinMode(dht_dpin,OUTPUT); Where is pin 69? I can't find it either physical or IDE.

In post #3 the picture shows Analog 15 as the pin used, this equals physical pin 82.

I'm confused.

Then there are some others;

int pHPin = 59;                    //pin for pH probe

But the drawing shows Analog 5 or physical 92?

int lightSensor = 60;              //pin for Photoresistor

And again this does not match the drawing on post #3, Analog 14, physical 83.

I know this was asked before, post #103, but no answer.

I really want to build this but I can't seem to make heads of tails of things. Does someone have a wiring diagram that matches the software?
Title: Re: Billie's Hydroponic Controller
Post by: JeremyWilburn on May 20, 2015, 12:07 am
wow.  great project.  I'm starting one and would love the hybrid of the iAqua with this.  I want a complete controller.  Just ordered the stuff to start.  This will be my first Arduino project, but I have a PhD in Analytical Electrochemistry so it's just a new platform.

I'll start with sensors for lights, CO2, pH, EC, temp (both reservoir and ambient), and humidity.  If I can get that together I will move on to dosing pumps and sensors.  It would be nice to get ion-specific sensors for N, P, and K (with individual dosing for each nutrient), but I suspect the sensors themselves will be the trick there, but I'm used to making my own sensors so maybe I can figure something out.  Otherwise I will do a two or three part nutrient dose (micro/grow/bloom or equivalent) and a pH up and down.

I'll definitely check in here an maybe start my own thread with progress...
Title: Re: Billie's Hydroponic Controller
Post by: Josepgatius on May 22, 2015, 09:56 pm
Niwa hydroponics   Yo he pedido uno, creo que puede funcionar os tendré informados
Title: Re: Billie's Hydroponic Controller
Post by: furkangngr on May 23, 2015, 08:08 pm
hello billie,
pH settings page there is a situation like in the picture. How to solve?
thanks

(http://i.hizliresim.com/zAJpJD.jpg)
Title: Re: Billie's Hydroponic Controller
Post by: Lundin on Jun 01, 2015, 10:12 pm
Hi Mike.. hope you've gotten this straight since it was some time you posted the questions.. if not.. check this out

If anybody is still reading this I need more help/understanding of what is happening.

In the ino for v1.1.2b

There are lines;

#define dht_dpin 69   //pin for DHT11

Can someone explain this to me? #define is a macro is it not? What does that have to do with calling out a pin?
This is another method of tieing "dht_pin" to the physical pin.. ( check up on # define in Arduino glossary)
if i remember corrrectly the compiler treats the "#define" command differently than the regular way and this might be better to use in some situations.. i haven't read up on it though as i got my projects running and haven't had reasons to code it differently.


Quote
And if it is a pin pinMode(dht_dpin,OUTPUT); Where is pin 69? I can't find it either physical or IDE.
A0 = 54 -> A15 =69

Quote
In post #3 the picture shows Analog 15 as the pin used, this equals physical pin 82.

I'm confused.

Then there are some others;

int pHPin = 59;                    //pin for pH probe

But the drawing shows Analog 5 or physical 92?

int lightSensor = 60;              //pin for Photoresistor

And again this does not match the drawing on post #3, Analog 14, physical 83.

I know this was asked before, post #103, but no answer.

I really want to build this but I can't seem to make heads of tails of things. Does someone have a wiring diagram that matches the software?
There's a third structure for these pins , check the above answer A0=54 and up to A15=69 and i hope this will treat your confusion.. good luck

You could search for "Arduino MEGA Pinout" on the internet.. there's alot of really good PDF's floating around that is very detailed..
Title: Re: Billie's Hydroponic Controller
Post by: coryjp75 on Jun 13, 2015, 07:07 pm
Very nice work!  We should get together on this :-)

http://www.instructables.com/id/CoreConduit-Automated-Garden-Controller-System/ (http://www.instructables.com/id/CoreConduit-Automated-Garden-Controller-System/)

Cory
Title: Re: Billie's Hydroponic Controller
Post by: Mike_V_Florida on Jun 30, 2015, 09:31 am
Hi Mike.. hope you've gotten this straight since it was some time you posted the questions.. if not.. check this out
This is another method of tieing "dht_pin" to the physical pin.. ( check up on # define in Arduino glossary)
if i remember corrrectly the compiler treats the "#define" command differently than the regular way and this might be better to use in some situations.. i haven't read up on it though as i got my projects running and haven't had reasons to code it differently.


I almost gave up and just happened to come back here. THANKS for the explanation. Let me start again with this project.
Title: Re: Billie's Hydroponic Controller
Post by: gmichel on Jul 13, 2015, 07:57 pm
Hello,

I have a problem with my librairies RTClib, I work with the IDE V1.0, I have install /


    -UTFT library
    -ITDB02_Touch library
    -SD library
    -Wire library
    -RTClib library
    -EEPROM library
    -EEPROMex library

And the check ERROR said :

 C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp: In member function 'uint8_t RTC_DS1307::isrunning()':
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp:229: error: call of overloaded 'write(int)' is ambiguous
C:\Users\Mezzo\Desktop\arduino-1.0\libraries\Wire/Wire.h:55: note: candidates are: virtual size_t TwoWire::write(uint8_t)
C:\Users\Mezzo\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:49: note:                 size_t Print::write(const char*)
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp: In static member function 'static void RTC_DS1307::adjust(const DateTime&)':
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp:239: error: call of overloaded 'write(int)' is ambiguous
C:\Users\Mezzo\Desktop\arduino-1.0\libraries\Wire/Wire.h:55: note: candidates are: virtual size_t TwoWire::write(uint8_t)
C:\Users\Mezzo\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:49: note:                 size_t Print::write(const char*)
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp:247: error: call of overloaded 'write(int)' is ambiguous
C:\Users\Mezzo\Desktop\arduino-1.0\libraries\Wire/Wire.h:55: note: candidates are: virtual size_t TwoWire::write(uint8_t)
C:\Users\Mezzo\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:49: note:                 size_t Print::write(const char*)
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp: In static member function 'static DateTime RTC_DS1307::now()':
C:\Users\Mezzo\Documents\Arduino\libraries\RTClib\RTClib.cpp:253: error: call of overloaded 'write(int)' is ambiguous
C:\Users\Mezzo\Desktop\arduino-1.0\libraries\Wire/Wire.h:55: note: candidates are: virtual size_t TwoWire::write(uint8_t)
C:\Users\Mezzo\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Print.h:49: note:                 size_t Print::write(const char*)



someone can help me , to solve my problem, or post good Librairies ?



THank's for Help.


Title: Re: Billie's Hydroponic Controller
Post by: claudiok on Aug 28, 2015, 08:36 pm

hello Billies, very good its design, unfortunately happened to me this error in time to check the code before sending to the controller, you can help me, thank you Claudio


Arduino: 1.6.5 (Windows 7), Placa:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Opções de compilação alteradas, recompilando tudo

C:\arduino-1.6.5-r2\libraries\UTFT\DefaultFonts.c:21:14: error: variable 'SmallFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 fontdatatype SmallFont[1144] PROGMEM={         
              ^
C:\arduino-1.6.5-r2\libraries\UTFT\DefaultFonts.c:125:14: error: variable 'BigFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 fontdatatype BigFont[3044] PROGMEM={
              ^
C:\arduino-1.6.5-r2\libraries\UTFT\DefaultFonts.c:234:14: error: variable 'SevenSegNumFont' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
 fontdatatype SevenSegNumFont[2004] PROGMEM={
              ^
Erro compilando.

  Este relatório deveria ter mais informações
  "Mostrar saída verbosa durante a compilação"
  habilitado em Arquivo > Preferências.
Title: Re: Billie's Hydroponic Controller
Post by: gremo on Sep 08, 2015, 08:02 pm
Hi. Is there any chance that DHT22 can be implemented to this skatch?
Title: Re: Billie's Hydroponic Controller
Post by: bubbalicious on Oct 15, 2015, 09:10 pm
Hello,

first , nice work !!!! its amazing !!


i'm gonna buy my first arduino mega and i want to know if its complicate to do this project?

i want to control my hydro room,

ph control and auto adjusting for the dwc system and the temperature and humidity for the room

im a noob in code but i learn fast lol

Title: Re: Billie's Hydroponic Controller
Post by: bigfun on Oct 16, 2015, 09:32 pm
Is there some code that you can include to sense whether it is marijuana that is being cultivated and then disable the watering if this is the case?  My concern is that this could fall into the hands of druggies.
Title: Re: Billie's Hydroponic Controller
Post by: hsnsdt on Oct 29, 2015, 06:23 pm
pH değeri ölmek için bir sensör kullanılmış ama suyun EC değerini nasıl kontrol ediyoruz? Bunun için herhangi bir sensör kullanılmıyor mu, internette analog ec meter diye bazı sensörler buldum ama gerek yok mu anlayamadım ?
Title: Re: Billie's Hydroponic Controller
Post by: badpaddler on Oct 29, 2015, 11:03 pm
So I got the freezing issue taken care of, but have been beating my head on the desk for a while now. The touch buttons do not do anything. I changed to the 1_1_0 version to no avail. All my libraries look up to date and correct, and it has no problem compiling. Thoughts?
Title: Re: Billie's Hydroponic Controller
Post by: badpaddler on Nov 10, 2015, 07:39 pm
Actually, The touch buttons do kind of function, but they are reversed, and are not on spot. Almost like they are not calibrated. I even tried plugging the TFT straight into the shield to account for any OE. Basically if I hit where the PH control button should be, it takes me to the Manual tank control. If I touch the manual tank button, it takes me to the ph control, and the up and down button don't function. Anyone possibly give me a few pointers?
Title: Re: Billie's Hydroponic Controller
Post by: archundial on Nov 22, 2015, 12:48 am
well i read many about this project, its sounds really good, i think i understand all to star working, except how to connect the 3.2" TFT LCD Shield, anyone can help me with that please? Thank you so much!!!
Title: Re: Billie's Hydroponic Controller
Post by: havala4 on Feb 11, 2016, 09:07 pm
arduino ide 1.6.7



C:\Users\Roman\Desktop\Hydroponic_Controller\Hydroponic_Controller.ino: In function 'void setup()':

Hydroponic_Controller:123: error: 'class DateTime' has no member named 'get'

   start_time = now.get();

                    ^

C:\Users\Roman\Desktop\Hydroponic_Controller\Hydroponic_Controller.ino: In function 'void LightControl()':

Hydroponic_Controller:1548: error: 'class DateTime' has no member named 'get'

   seconds_for_this_cycle = now.get() - seconds_elapsed_total;

                                ^

Hydroponic_Controller:1549: error: 'class DateTime' has no member named 'get'

   seconds_elapsed_total = now.get() - start_time;

                               ^

exit status 1
'class DateTime' has no member named 'get'



Thank you
Title: Re: Billie's Hydroponic Controller
Post by: everone on Mar 29, 2016, 04:31 am
So I hope someone is still lurking around watching this thread for new posts.

I have the latest sketch and all the parts. am getting an unspecified error

Arduino: 1.6.7 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\Evan\Downloads\Hydroponic_Controller_v1_1_2b\Hydroponic_Controller_v1_1_2b.ino:38:62: fatal error: UTFT.h: No such file or directory

 #include <UTFT.h>                  //16bit TFT screen library

                                                              ^

compilation terminated.

exit status 1
Error compiling.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Title: Re: Billie's Hydroponic Controller
Post by: everone on Mar 31, 2016, 10:50 pm
hello, I solved the above compilation error by moving the libraries to the correct space.

 this being said the compilation works fine but there is nothing that happens when the sketch is uploaded to the Mega.

    I would like to just start by getting the PH sensor to output correct PH values to a serial terminal.
I don't exactly see how this is supposed to work when there is no #include(phidgits21.h) in the start code.
what library is this sketch using to utilize the PH phidgit sensor?
and if at all possible what lines in the sketch are seting the parameters?

thanks
Title: Re: Billie's Hydroponic Controller
Post by: everone on Apr 03, 2016, 04:49 am
arduino ide 1.6.7



C:\Users\Roman\Desktop\Hydroponic_Controller\Hydroponic_Controller.ino: In function 'void setup()':

Hydroponic_Controller:123: error: 'class DateTime' has no member named 'get'

   start_time = now.get();

                    ^

C:\Users\Roman\Desktop\Hydroponic_Controller\Hydroponic_Controller.ino: In function 'void LightControl()':

Hydroponic_Controller:1548: error: 'class DateTime' has no member named 'get'

   seconds_for_this_cycle = now.get() - seconds_elapsed_total;

                                ^

Hydroponic_Controller:1549: error: 'class DateTime' has no member named 'get'

   seconds_elapsed_total = now.get() - start_time;

                               ^

exit status 1
'class DateTime' has no member named 'get'



Thank you
So are you still interested in working with this. it seems no one is following up on this. it looks like it was outdated and other projects in the ether have become more relevant so I have decided to recode and wok with this. I will try and post to here but think I will start with a new build thread as I am not going to work this the same way as the original poster. this will be a lab grade ph adjustment controller. if you would like to work with me PM me and we can tsk parts of this build and work together. 
Title: Re: Billie's Hydroponic Controller
Post by: everone on Apr 03, 2016, 08:43 am
Hi to all,

      I have started by asking the simplest question.
How do I get these or similar items (shields and phidgets) to work just by them selves?

Going to start first with the pH Phidget 1130.
(Because it is the most important to me.)
 
     So first thing. Phidgets are a little different in the way they report data back to the device.
I originally found good info about this here http://forum.arduino.cc/index.php?topic=57924.0
ill give a thanks to that user. (mapiram)

you will need the above info so look at it. I'm not gonna re write it because looking for information will strengthen your understanding in the end. so even though I have given you the place to look you still have to put a little effort in to get and understand the info.
your welcome.

Please make sure you understand how to utilize the Arduino before attempting a project. I like www.udemy.com courses but there are plenty of free resources out there. But remember when you pay for something you can expect support.

If you don't understand the other post ask and ill address your issue.

So back to the Phidgets pH 1130 and interfacing to your Arduino.

I stated by grabbing a set of jumper wires.

Red = 5v

Black = GND

White = Read (this will go on my A0 pin on my Mega)

I hooked my device through a bread board. When looking at the pics to ignore the wires I don't mention.

Wires





Title: Re: Billie's Hydroponic Controller
Post by: everone on Apr 12, 2016, 12:16 am
Hi to all,

      I have started by asking the simplest question.
How do I get these or similar items (shields and phidgets) to work just by them selves?

Going to start first with the pH Phidget 1130.
(Because it is the most important to me.)
 
     So first thing. Phidgets are a little different in the way they report data back to the device.
I originally found good info about this here http://forum.arduino.cc/index.php?topic=57924.0
ill give a thanks to that user. (mapiram)

you will need the above info so look at it. I'm not gonna re write it because looking for information will strengthen your understanding in the end. so even though I have given you the place to look you still have to put a little effort in to get and understand the info.
your welcome.

Please make sure you understand how to utilize the Arduino before attempting a project. I like www.udemy.com courses but there are plenty of free resources out there. But remember when you pay for something you can expect support.

If you don't understand the other post ask and ill address your issue.

So back to the Phidgets pH 1130 and interfacing to your Arduino.

I stated by grabbing a set of jumper wires.

Red = 5v

Black = GND

White = Read (this will go on my A0 pin on my Mega)

I hooked my device through a bread board. When looking at the pics to ignore the wires I don't mention.

Wires






Find more and continuing information on this in the Science and Measurement section of the arduino.cc fourms.
http://forum.arduino.cc/index.php?topic=391090.0
Title: Re: Billie's Hydroponic Controller
Post by: tfixa on Apr 18, 2016, 04:01 pm
Does anyone have the updated code? or where to get it from along with the libraries? Thanks.
 
Title: Re: Billie's Hydroponic Controller
Post by: everone on Apr 18, 2016, 07:47 pm
Does anyone have the updated code? or where to get it from along with the libraries? Thanks.
 
This looks to be out dated, the original author doesn't seem to be following the thread.
This is why I have began to rebuild the project.
If interested in working on it let me know. Also you can find current garden control systems on the Instructables Web site.
Good luck.
Title: Re: Billie's Hydroponic Controller
Post by: coryben on Apr 26, 2016, 10:24 pm
Hi Billie,

Any way you could repost the schematic and wiring photos? They don't seem to be loading.

Thanks!

Cory
Title: Re: Billie's Hydroponic Controller
Post by: carl1961 on Jul 18, 2016, 06:22 pm
hello, I solved the above compilation error by moving the libraries to the correct space.

 this being said the compilation works fine but there is nothing that happens when the sketch is uploaded to the Mega.

    I would like to just start by getting the PH sensor to output correct PH values to a serial terminal.
I don't exactly see how this is supposed to work when there is no #include(phidgits21.h) in the start code.
what library is this sketch using to utilize the PH phidgit sensor?
and if at all possible what lines in the sketch are seting the parameters?

thanks
@everone  can you share the correct lib file that you used to compile this Hydroponic_Controller_v1_1_2b.ino. thanks for any help.
Title: Re: Billie's Hydroponic Controller
Post by: Usmc124 on May 26, 2017, 07:02 pm
I am new to Arduino but learning.  I made some mods to the code and it compiles fine.  I have all the libs.  I would like to get T/H, PH, Light status, Lux etc. to console (serial.print).  Where/ how do I add it? for testing purposes.
Title: Re: Billie's Hydroponic Controller
Post by: BomberMan1980 on Jul 27, 2017, 05:11 pm
Does anyone has the schematic images? The photobucket links are not working.

Thanks
Title: Re: Billie's Hydroponic Controller
Post by: willy8 on Nov 10, 2017, 07:26 am
Does anyone has the schematic images?
Title: Re: Billie's Hydroponic Controller
Post by: unas1990 on Mar 13, 2018, 08:24 pm
Nice Project Billie until Now i am still trial your project to application on my Hydroponics and will post on http://123rom.me