Complete environmental control with a PC?

SeattlePot

Well-Known Member
I just finished my first 1 1/2 crops nd had to tear down but Im gonna rebuild soon. Ive got some very nice moms now so Ill do a sog style grow. I am adding co2 and making it a sealed environment. So ill have dehumidifying, air conditioning, recirculating carbon filters, cool tubes etc.

Im also going to build a complete environment control panel with din rail mounted breakers, relays, flip-flops, bluetooth controllers, complete sensor array with data logging, etc. All of this will be in one spot and connected to a computer.

I don't have any formal technical/mechanical training but I am generally intelligent and usually make things work so I think I can take on this challenge.

I am going to try and tie as much of it together as I can. Id like to at least consolidate everything into 2 or 3 systems, preferably controlled by pc. I should be able to get all of the timers/switches/relays for the lights, pumps, fans, co2 enrichment, etc controlled using a ethernet controller card connected to relays and a pc. Likewise Id like to get as much of the sensor array consolidated as possible. Preferably with real time charts of all environmental variables and cycles displayed on a pc monitor.

Some things like air conditioning and heating will just be done as always, with thermostats. It would still be nice to have a nice integration of the sensor array with the relay controller, unfortunately I don't know any programming languages.

Are there any techies out there that have attempted anything like this?

As I research/order/build this thing Ill try and make some update posts.
 

robotninja

Well-Known Member
I'm new to growing myself but had often thought of something similar. I actually wanna have a alert system in place useing a program on my PC that sends a email msg to my cell phone whenever a pump/light/fogger/whatever goes out or the temp rises to much ect.. ect...

Might just have to make my own program using java or something, but I like the idea, kinda like first response.
 

SeattlePot

Well-Known Member
I'm new to growing myself but had often thought of something similar. I actually wanna have a alert system in place useing a program on my PC that sends a email msg to my cell phone whenever a pump/light/fogger/whatever goes out or the temp rises to much ect.. ect...

Might just have to make my own program using java or something, but I like the idea, kinda like first response.
Yeah, I already tied some cheap ass webcams into a motion sensing program. When it detects a preset level of motion it activates a batch file I made that engages a skype command line and calls my cell with a prerecorded message. I have three cameras in three security zones, as an intruder penetrates the property I get a series of phone calls updating me of (zone) activity. I have a doomsday message that plays if the 3rd cam, which faces the inside of the grow room door is activated. Better run fer the hill then! I can write simple batch files but thats about it. I wish I knew a programming language.
 

born2killspam

Well-Known Member
You'd probably have more luck thinking usb, or serial/parallel port inputs.. There are a ton of existing schematics and source code for devices designed to interface with external data sources.. A nic would work, but AFAIK you'd be taking a path much less travelled, and you have to start from the ground up..
You might even score, and find control software source-code that you can use to actually respond to, and log the data.. That is ALOT of work in itself..
Also, you'll have alot more luck finding software/drivers compatible to linux platforms.. (Again, path most travelled for applications like this)..
I've done alot of interfacing work myself, so I'll look around for good starting points, but you gotta realize that you're kind of attempting to climb Everest here.. Greenhouses can pay 100's of thousands to integrate environmental systems.. Have you ever priced a CO2 ppm meter?

What are your soldering skills like? And what programming languages are you familiar with?
 

R1b4z01d

Well-Known Member
I have built a a system that monitors and controls just about anything I want in my garden. everything from temp and heaters to c02 ppm and my tanks. I can use it just to monitor 24 hrs a day (My garden is not in my town) from my computer or even my iphone. I have now started to use it to actually regulate things like light movers, ph up/down nutrients and even water level. The best thing is everything is stored in a Mysql database that you can later check for issues and know your harvest better. I can have basically an unlimited amount of sensors. I can currently control 16 devices. I could add more if needed.
 

born2killspam

Well-Known Member
Adding any new device is going to require more programming to decode/encode the raw data, and set/react to parameters unless you're just adding another add-on module to a commercial system that already has the software support for the device.. Nobody is concerned with any kind of device limit, just obtaining, and implementing the devices.. I'd love to see the control source code for that!!
As for the security system, that is pretty simple-sweet.. I've never played with skype, but I actually set something similar up back in HS that used a good old voice modem, and simple motion sensors in security mode.. In living mode a things like lights were controlled with the motion sensors, and a number of things could be controlled via phonecall scripts, or programmed on timers in the control interface software.. All control connections were through X10 interfaces, and a 'port-master' (An electronics project that interfaced through parallel port).. Those two systems made controlling things almost plug&play, but when you're trying to program event driven processes, let the debugging begin!
BTW, I eat my words about the ethernet difficulties.. I was hunting around and came upon this.. YO2LIO Microcontrolers
I don't know if you've already found it.. It looks sweet.. Every bit of info you'd need to get the parts elsewhere and use his software is on the site for free, but he sells them cheap too.. 25Euros will get you the basic package that will allow you to get raw data from your own serial/analog devices, but for another 5Euros he tosses in a temp/humidity sensor.. (I was reading about the sensor, its primarily a digital thermometer, but uses a wet/dry temp comparison to yeild an RH reading..
 

R1b4z01d

Well-Known Member
My system supports motion detectors! This could then activate a camera or any cmd you would like really. The system has a series of sensors (PH,Temps,humidity,TDS,CO2,water level). Each sensor has a upper and lower limit. When one of the sensor limit is meet a number of things can happen. 1st of you can control the power of any 120, 12, 5 volt device. It can send a SMS, and email send an ftp file, as well as run a bat file and a few other things. There is also an action when the sensor returns from the upper or lower limit.
 

R1b4z01d

Well-Known Member
seattlepot contact me directly for more information. I am not planning on selling any of my software only the hardware devices. I want to keep it open sources with part lists and DIY instructions for anyone that wants to build the devices themselves.
 

born2killspam

Well-Known Member
How does it interface with the PC? What types of peripheral interfaces does it support, and is the source-code available?
I get the general logic of how an automated system works, its the integration that I'm curious about.. Controlling CO2 alone like you describe is going to set you back $3000-4000, and if all you supply is basic power-outs then you obviously need supplimentary control components to actually control the devices.. It would make more sense to have far more control right off the unit.. PWM ability etc..
 

R1b4z01d

Well-Known Member
I use the 1wire network to interface all the sensors together. And not Co2 sensor will not set you back 2-3 g if you know how to build that sensor. I have found that basic on/off is all i need. The computer does the calculations. like the doser. if the ppm drops below 1000 (could be anything) it send 12 v to the nutrient mixture to pump for 1 sec. then in about a min the computer checks its sensors again. the only reason you would want to control something else other then just on and off would be fan control. all my lights are connected together pulling air from the out side of the room threw the lights (cool tubes) then exhaust out. This inline fan as well as my rotating fans are on 24hrs a day. The only fan I control via the computer is the rooms exaust fans. I only need to turn this one once or twice a day. if the temp gets to high it turns on. when the temp normalizes it turns off.
 

R1b4z01d

Well-Known Member
o and the system bug posted is a waste of money. You could build it for 1/8th of the price if you do your research.
 

born2killspam

Well-Known Member
Bug's site offers so oksensors, and devices, but the one I linked to essentially does the same thing that basic package does without any extra tinkering, and is adaptable for well less than $100..
Funny thing about pumps/motors though is they don't run predictably when you just feed them straight up voltage.. Programmable PWM is necessary for a system you can trust..
What is the delay between nutrient addition, and subsequent testing?
What concentration do you keep your nutrient top-up, and pH correction resevoirs? Are they fed with peristaltic pumps?
 

AdReNaLiNeRuSh

Well-Known Member
R1b4z01d,

Just out of curiosity, what platform are you running it on and what language did you write it in? Also, what kind of hardware did you have to build? Did you write the firmware for that as well? This sounds like an interesting project...

PICS!!!!

:peace:
-AR
 

R1b4z01d

Well-Known Member
pm me if your intrested in more info. Sorry but I do not want to publish stuff for the public just yet.
 

Rollbilly

Active Member
Hey, did you try integrating the hard drive sensors for temp?
Most modern pc`s have a plug-in sensor.
 

born2killspam

Well-Known Member
Temperature sensors are pretty widely available, but if I had to build a circuit from scratch I'd go with an LM35DZ or equivalent..
My guess is that the SMART temperature functions would be built into an extremely complex PIC etc that may be really tough to reverse engineer.. Don't take my word on that until you scour datasheets though.. For all I know hdd's may even have LM35's..
Still though, surface mount components are pretty damn tough to harvest/use.. Decoding the actual SMART attributes yourself wouldn't be at all feasible since simpler options exist, and if you were to just kill the motor and stick the drive in the area attached right to the PC you face IDE cable hassles (assuming the HDD doesn't puke on temperature readings due to the dead motor)..
 

Johnny Bongs

Active Member
I use the Dallas DS18s20 to monitor the temp. Everything gets logged to my hsqldb database. All I'm doing is logging, I just don't have time to work on the software lately.
 

born2killspam

Well-Known Member
The link I posted offers the DS18B20 to incorporate with his controller for 5euros.. Your model is a bit cooler.. How does it connect to the pc?

Edit: I just realized that to get a humidity reading from that system, you'd need 2 of those Dallas units, with one sensor encased in a saturated fabric.. The library included with the controller for programming has a wet/dry bulb temperature correlation for RH.. Apparently the Dallas unit doesn't handle RH intrinsically.. The controller supports multiple units though, and the Dallas sensors are cheap..
 
Top