Go Down

Topic: Billie's Hydroponic Controller (Read 244573 times) previous topic - next topic


Nov 02, 2012, 11:27 am Last Edit: Nov 02, 2012, 11:29 am by BillieBricks Reason: 1
Hello everybody,

As promised 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...

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


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!
Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info


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


Here is a 'simple' diagram of all the sensors.

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

And with...

Greetings... ;)


Nov 03, 2012, 01:07 am Last Edit: Nov 03, 2012, 01:11 am by Graynomad Reason: 1
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 Gray aka the GRAYnomad www.robgray.com


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


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 Gray aka the GRAYnomad www.robgray.com


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.

In front you see the pH probe and between the probe and the case is the photo-sensor encased in some plastic tubing.

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.

Tomorrow I'll put the sensors in a small barrel (20L) and start building the dosing station so the next tests can be run...


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)


Nov 13, 2012, 08:39 pm Last Edit: Nov 13, 2012, 08:43 pm by BillieBricks Reason: 1
I ordered mine at conrad. 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... ;)


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



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

Rob Gray aka the GRAYnomad www.robgray.com


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


Can't wait, he does good stuff.

Rob Gray aka the GRAYnomad www.robgray.com


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

Go Up