Billie's Hydroponic Controller

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

@Billie

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

thanks,
Tiago

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

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

best regards,
Tiago

Damo1984:
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! :slight_smile:
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 :wink:

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

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 :wink:

tmarquespt:
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).

tmarquespt:
I'm going to kickstart my NFT test project

Nice setup!! :smiley:

With kind regards,

Billie

It would be a big help if you could show us a wiring schematic for your setup, it looks nice!

Are these simple enough? :smiley:

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)

v4nelle:
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 :wink:

v4nelle:
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...

v4nelle:
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!! :smiley:

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

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.

// 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.

odometer:
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.

// 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.

I found this in the source code:

            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 -10/9 near the bottom?

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

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

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.

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.

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!

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

Hi, nice project Billie :slight_smile: 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

Thanks,
Jarno

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
I think you can get just any BNC connected ph Sield, it should work !

My probe works fine