What's new
  • As of today ICMag has his own Discord server. In this Discord server you can chat, talk with eachother, listen to music, share stories and pictures...and much more. Join now and let's grow together! Join ICMag Discord here! More details in this thread here: here.

Lets build a DIY fully automated controller.

rives

Inveterate Tinkerer
Mentor
ICMag Donor
Veteran
So... This thread has already decided to emphasize on how to flick a damb isolated switch (opto isolators) instead of considering over-all control topology.(Poor planing on your part does not create an emergency on my part!)
Sad... soo much potential, soo much energy lost...

Well, to start with, I disagree with your premise that it should be PC based. I would never trust control of anything important to a PC - they are fine for receiving data dumps and compiling reports, but these little controllers (smart relays) are meant for an industrial base that is far less tolerant of glitches than any growing operation. And since they all have their own proprietary software, spending a lot of time flogging a front-end is a waste of time.
 
Thanks for the info thus far...

Stay puff Thanks for you comment you are probably right, but as for planing i am fumbling around in the dark. I am simply trying to harness the power of the people. How would you break this problem down and tackle it?? I am not dissing you in any way, i am simply relying on everyone out here for info then to try and edit the first post to organize things. I hope you reconsider and continue to provide valuable in site. I brought up the opto isolators because i read that they were more reliable then mechanical relays, So i just threw it out here, for discussion.

I think we need to get the hardware aspect nailed down (through discussions as to which kinda device are we going to use to control this thing, with reliability being the main concern, do we need something to chart the progress, hook up camera's, etc?) I would prefer to have the option, but other people might not care. then we need to match the ph, temp, humidity, co2, light, ppm, probes that would give us the best bang for the buck, to our decided on brain (computer/ plc)

As for programing i really don't have a place to start on that, and would encourage the code monkeys out there to pitch in. Here is what i don't get as to why the programing has to be so hard? Say like for programing for a probe for co2 or temp is it not a simple matter of telling the program to say 1500 ppm stop, 1000 ppm start? Same with temp/ humidity? Then if someone program for a doser would it not simply be a case of if you have a know volume container (mix rez), that drains to the main rez. One could then simply apply power to the dosing pumps for X amount of seconds, then fill the mix rez with water till you trip a float valve. Then when the main rez tripped the low solution level you pump the mix rez in and repeat the process?

What i am trying to say is how can i improve this to achieve the goal in the most organized way?

I greatly appreciate everyones time and input!

p.s. i do not mind if someone (or several) takes the lead in this technical aspect, This is not about vanity for me. I am simply trying to provider a fertile space to move the learning ahead.
 

iamdink

New member
iamdink...

The secret to managing the hysteresis in closed loop controls such as this is P.I.D. calculations. The proportional control factor is what 99% of simple control schemes use. While this allows elementary control, the deadband needed to eliminate the constant hysteresis in the actuators will allow for unacceptable swings in some of the processes (think ph, etc). By using integrative and/or derivative calculations the error will be all but eliminated.

indeed, a pid controller is nice. i see need for custom controller for ph level and co2 controller. also a ppm detection would be nice so 3 controllers. but controller would have to be tuned and is very dynamic depending on equipment.

i mean it would be nice if someone could do this on Arduino or some cheap MCU platform..post the firmware. Problem is people will have to replicate hardware for those tuned coefficients.
 
W

wanderer

iamdink,

indeed, a pid controller is nice. i see need for custom controller for ph level and co2 controller. also a ppm detection would be nice so 3 controllers. but controller would have to be tuned and is very dynamic depending on equipment.

i mean it would be nice if someone could do this on Arduino or some cheap MCU platform..post the firmware. Problem is people will have to replicate hardware for those tuned coefficients.
I used to do this for a living (until I retired). You have nailed the specific application for PID control. One can do PID in software as well as hardware. The formulae and psuedocode are easily found if one is interested. The tuning is so specific that each control is usually fine tuned in the field or after parts replacement (like sensors). 4-20 current loop signal is preferred over voltage in sensor input to eliminate signal variance due to conductor length and temperature in field wiring.

PC are certainly stable enough for a grow application, but there is nothing wrong with distributed processing with the PC or some other device as a supervisor either. There are may ways to get the job done, none of them more right or wrong.
 

Stay Puft

Member
I will "try" to STFU ..lol

I will "try" to STFU ..lol

I have shared the same reliability concerns regarding pc based systems.. I will drop the PC thing.:moon:

How about disscussing how to select a PLC make/model?
I will start:
You will need to decide how many I/Os you require. (and if you need analog I/Os)
Sketch it out on paper. Start with a rectangle (label it PLC) and draw a line for each function you want. Describe each line as a Input or Output and any other details.
This is a good way to start visualizing what you are building.
What operating Voltage/Type do you want your PLC to run on?
We will always select one with a Real Time Clock (RTC) in it.


About switching devices:
You will eventually have to select a appropriate switching device. (Relay, Switch, Solid State Relay, Opto-Isolator etc..)
In order to select the proper device you need to know the characteristics of your Source and Load.

Source Information: Voltage Type (AC/DC), Voltage (Potential), Amps (Current it can safely deliver)

Load Information: Voltage Type (AC/DC),Voltage (Potential), Amps (Current required by load)

Having this information is important so you can select a device that is rated properly for your application.
 
W

wanderer

OMRON controls are good quality.

Here's another one (my ex-employer, so I may be just a tad prejudiced LOL), the software support is extremely open and flexible:

Siemens PLC

Let's get as many mfrs. as we can so as to get the best engineering solution for the buck.
 
Hey Stay puff and wander, that a boy, lets get the creative juices flowing. I think that not only should we list products, but as we do we should keep tossing out the less then optimal parts too so we come to a consensus, on the best one or two parts per item. (maybe, 1 cheaper but less funtction/quality, and another with more function/ quality, etc... I would like to keep my links to say under 5 per item, so that we do not get flooded with parts. (ie. is not siemens and idec the same product, re-branded?)

The amount of imputs... ok guys lets split this in 2... basic and advanced.

BASIC CONTROLLER:
1) Manage the control and timing of the lights
2) Control Co2
3) Monitor the ph/ec/nutrient temp
3) Control room temp
4) Control humidity
5) Control air movement fans
6) Control delivery of nutrient solution

ADVANCED CONTROLLER: (all of the above +)
1) Flip lights between rooms
2) Inject nutes
3) Monitor room (video, text message, flood detection, and low water levels, etc
4) Link via Internet (control via iphone)
5) Adjust ph
6) data logging, and graphical output.


Lets throw out some products, and as a group decide the best bang for the buck and keep the best 1-2, or even 3 solutions.

I personally would prefer solid state relays as i have built a few flip/flops in my day (i used to be known as kung POW back in the OG days, and somehow got in the grow faq here LOL) I have had some contacts freeze on me with the old style relays. So when the rubber hits the road i would pay a slight premium to avoid items of lesser reliability.

I think from my reading that most of the stuff (or at least a wider range of choices) in reguards to sensors is 24v (ac or dc???) I believe those are analog as opposed to digital. Is it better to go digital or analog for most items? (discuss) (always looking at reliability vs cost)

It is no good building a Ferrari if most people could not afford it, or buy it for the same price.

So if you think you have a better choice speak up and explain why your part/ idea is superior, then we can debate it here and lock it in.

So bottom line lets get to work comparing parts, sourcing prices, figuring out compatibility's future expandability, etc....

Also as a idea we could work on a bare bones for one type a group, and a more advanced unit for the people with greater means/ wants.

As this evolves i will update the first two posts.

I think it's going to be a VERY good new year!!
 

David762

Member
Requirement to not be tied to any specific MCU ...

Requirement to not be tied to any specific MCU ...

IMHO:
I feel it is a waste of time working on the back-end (hardware design of senors and I/O) when you do not have a proper/common Front-end . (software that provides user interface/control) The front end should be open and not be exclusively tied to any specific MCU or proprietary interface.
These type of threads always get overwhelmed with the hardware design comments/requests with no attention given to controlling software. The hardware comments are great but the front-end design is usually the show stopper for projects like this.

might be difficult. The closest solution that comes to mind is an MPU rather than an MCU that supports an open source *nix variant (linux or BSD) in conjunction with an old school programming language that supports graphics for a UI, like Tcl-TK.

Almost any MPU that supports open source *nix can run Tcl-TK. Tcl also supports modules built in ASM and C, although ASM is processor specific. IMHO, BSD has a smaller demand on system resources than any current (2.6.xx) linux kernel. That would be one solution for the controlling software.

This goes well beyond a PLC, but an MPU that supports posix and multithreading at an operating system level removes the equivalent tedious programming for similar functions. I rather like the new BeagleBoard-XM or the somewhat more expensive Hammer product. Is this more or less what you had in mind?
 
David...

I like the looks of a small proccessing board. i am going to add a link to it.

Maybe some of us could get on the beagle and Arduino chat boards and ask about how to set things up to automate our "fish tanks"??? Then bring the knowledge back here.

What it looks like to me is if we build a BASIC controller we can use just a micro PLC. For the more ADVANCED controller we could tie a micro PLC with a small computer board as wanderer suggested.

Does this make sense?

P.S. i added links for Arduino / beagle boards, and a link to Peristaltic dosing pumps via Ebay... Also Those replaceable ph probes for the the TRI-meters, what is their operating voltages?
 

Newd

Active member
I agree with Stay Puft. Hardware is the easy part. Defining the control interface should be the first step.

While I agree that a PC is not the most reliable controller (I wouldn't want one controlling my life support) it can be the best solution. Let's face it, everyone of us here has one. The secret to a reliable control system is to ensure that if there is a failure that can compromise safety or security, you have dedicated safeguards to prevent both. Even an airplane won't rely solely on the firmware that controls the plane.

With that said, there are many types of DAQ (Data Acquisition and Control) systems that interface directly with a PC through USB, Ethernet, RS232, etc. All one has to do is write the interface software (yes, I would volunteer) and wire everything up.

So what do we want to do? Let's compile a list of exactly what we want the controller to do. Let's break it up into inputs and outputs and start with the inputs. I'm not a hydro guy so feel free to add anything I've missed.

Inputs

1) Monitor Temperature
2) Monitor humidity
3) Monitor PH
4) Monitor Co2
5) Detect a fan failure
6) Detect an overflow
7) Detect an underflow
8) Detect a dry soil condition

Outputs

1) Flip the lights on or off
2) Turn a fan on or off
3) Turn a pump on or off
4) Turn a Co2 valve on or off
5) Alarm for some condition

Typically, cost is the prohibitive factor here, which is stunning to me given the amount of money spent on a really good set up. It really comes down to "How much do you want to spend"?

Newd
 
So when deciding inputs and outputs, do we not need to decide on a voltage?

12v, 24 v (AC or DC)???

Which voltage gives us the widest selection of probes and sensors?
 

Newd

Active member
Uncle Freedom,

24VDC for digital inputs and outputs, 4-20mA for analog inputs is preferred for long wiring runs. (Voltage drops over distance, but current remains a constant).

I'm a simple dirt farmer so I don't monitor things like ppm's but I have complete control over my cabinet through a PC (including a camera).

I monitor temp, humidity, soil moisture and whether or not my fan is running. If the temp goes over 85F, I automatically shut down the cab.

Newd
 

thinkin

Member
HydroHomeSoft- DIY Automated Hydroponics Software

HydroHomeSoft- DIY Automated Hydroponics Software

Currently reviewing software but this looks very promising.

Anyone heard/used of this software?


Free software all setup for hydro with setup instructions AND links to compatible hardware! (TOO GOOD TO BE TRUE?)
  • control grow-room temperature and humidity
  • control lights, fans and pumps with intelligent timers
  • control nutrient levels for up to four separate growing systems
  • automated nutrient mixing for up to three growth phases
  • progressive nutrient formula changes between growth phases
  • automated control of pH
  • automated control of Electrical Conductivity
  • email reporting of system progress and problem situations
  • extensive graphs and reports of system activity

Thanks pete!

http://peterphrastus.com/

-Thinkin
 
UPDATE...

Added links for barrel connectors, float sensors, Solid state relays and gravity feed solenoid valves....

If anyone has better links for prices / products please let me know.
 

Stay Puft

Member
Electronic Parts Vendors:
Digikey- Digikey.com
Mouser- Mouser.com
Newark- Newark.com (Farnell for the UK people)
Allied Electronics- alliedelec.com
Jameco- jameco.com
BG Micro- BGmicro.com
Marlin P Jones (MPJA)- mpja.com
All electronics- allelectronics.com

Materials/Fasteners/hardware:
McMaster Carr - mcmaster.com
 
Hydro pimp i just bought a idec smart relay, but there are other options out there... do some reading and feed back any info you learn to the group...

Staypuff thanks for the links... the first post has been updated.
 

maggot420

Member
You can also accomplish something that could be both manually adjustable or pc controlled cheaper with a pic system. I still think it's probably cheaper and less time consuming to buy an already made system and I have programming and electrical engineering experience and all the equipment to do this sort of thing. A pic system would be the cheapest way to what you want to accomplish though, imho. If you plan to go ahead get a pic starter kit that is both usb and serial. A plc system would be less flexible but may be easier in the long run.



Definitely going to be a tough project.


You could always use the accessories from the big boy packages along with your pic micro controller setup.




http://www.rollitup.org/grow-room-design-setup/196997-microcontroller-auto-adjust-temp-humidity.html
 

Latest posts

Latest posts

Top