Page 1 of 1

Hydroponic Garden controller

Posted: Thu Nov 13, 2014 2:48 pm
by pmpaq
I'm building a hydroponic garden, and using a Phidgets 8/8/8 interface kit with an separate external 8 channel relay set and a raspberry pi to be able to monitor and control lights and pumps with configurable events.

I plan to control through digital output and 8 channel relay:
Timing of at least 3 lights
1 fan
Timing of at least 3 water pumps

And I plan to monitor:
Lux from lights ( to monitor light performance)
CO2 content of Air in room
Current of power circuit in room ( to find Watts used)
Air temperature

The main loop will have a resolution of 1 minute, re-read the event file each time, and check whether to turn on or off devices.

The PI OS is Raspbian
Core program is in Python 2.7.3
Added the Flask framework for interface between web scripts and core program
Web interface is PHP/Apache 2

I still have to get into the monitoring portion of code, but the web interface and event timer is well on its way, except I don't have much(any?) data validation yet. I also have the ability to override the automated events, and manually turn ports on and off, and since I have the web interface, I can control it from my phone (or whatever).

I haven't seriously programmed something like this for some time, and I've never programmed with Python, but wanted to learn, so my code is likely not great and not very "pythonic".

I'd like to post my current code and hope for feedback of tips and critisisms, but it looks like new forum users can't attach files, so maybe I'll try again another time.

Re: Hydroponic Garden controller

Posted: Wed Dec 31, 2014 11:49 am
by pmpaq
Update - I've added my project to github:

Its a work in progress, as I have some code cleanup to do, much more documentation, maybe an installer, and am currently trying to build a rustic CoAP extension to PHP to switch the internet-interactions to an IOT friendly method.

Most notable is this has been completely stable for weeks now (with the exception of one of the relays on the Sainsmart 8 channel relay board dying), and my garden is starting to produce salads already :)

Thanks Phidgets for producing an easy to use IO board!