DIY CHEAP DIY microcontroller (arduino) grow room environment controller

#TH

Looking at the mosfet driving the valves..
Now it does seem completely stupid to use relays.
no moving parts to break down.
Smaller enclosure for the hole setup.
But they are pricey

:roflcry:

FQP30N06L fet 1$ a pop
1ok ohm pull down resistor 0,02$,, maybe not nessery
in4001 diode about 0,02$

would work

10 relays is about 10$

So almost the same price.
:woohoo:
 
Last edited:
Check out how much a fotek solid state relay costs on ebay where you are, they work well and might actually cost a little bit less than fet setup, but are basically the same thing with all the components in a nice black box, or grey in this case! You won't need a heat sink for switching such low power circuit :).

If you use fets it's still advisable to use an optocoupler even though they have good gate insulation, also you might want to use a shotky diode which has a smaller turn on voltage and hence faster switching than silicon, or a fet with a built in flywheel diode as otherwise after prolonged use it might blow. I could be wrong but better safe than sorry I say! :)
 
Hey!
Looking good!! I am on this road myself. Looking more for monitoring ATM. I have two tents and a cab that I need temp and RH, and 16 pots of which at least half should have moisture monitored to get good representation. After I get that stable and my grow areas as well, I want to move up to controlling the environment in regards to temp and humidity. I have 4 fans in four areas now with two more areas planned. I want to be able to track and graph the data and look at it almost real time. Right now controlling my environment is top priority. I will also need to coordinate heat and a/c with all of this as well.
Looking at the Dallas one wire protocol for the sensors or at least some of them, to cut down on port use. There are some other notes about that I need to gather up It's quite a project, but I think it will be very beneficial to my garden.
 
Hey!
Looking good!! I am on this road myself. Looking more for monitoring ATM. I have two tents and a cab that I need temp and RH, and 16 pots of which at least half should have moisture monitored to get good representation. After I get that stable and my grow areas as well, I want to move up to controlling the environment in regards to temp and humidity. I have 4 fans in four areas now with two more areas planned. I want to be able to track and graph the data and look at it almost real time. Right now controlling my environment is top priority. I will also need to coordinate heat and a/c with all of this as well.
Looking at the Dallas one wire protocol for the sensors or at least some of them, to cut down on port use. There are some other notes about that I need to gather up It's quite a project, but I think it will be very beneficial to my garden.

Nice project there www !
Have you started yet ??
Im waiting on parts from china / usa, So i can get on with my projects
Monitoring is easy to do,, the fun stuff begins when triggering other stuff AC / fans / e.t.c..
Whit that many buckets "to lift" thats sounds very beneficial to your garden :grin:
:Sharing One:
 
My perfect scenario is this. im growing with recirculation system in hydro

Controller should handle

Ph up (i have not used ph up the last 3 years)
ph down (thats my biggest problem with my current system)
ppm up (dosing from ready made solution. apropiate for the plant)
ppm Down ( delute nute solution with fresh water)
humidity NO control just messuring
Temp NO control just messuring

Webserver To check
ph/ppm/temp/humidity.

Watering is done by another controller.

My res is also dump´d / refilled every 7-8 days,,,,, Les salt build up. I did not fully understand the "unbalenced nute solution" :-)
You can´t messure salt build up with ppm ore ec,, So dumping nute solution is a must.
So there will be manually labour....Tweking the nutes for the plant / making a new res.

Things is fast in hydro, nute burn / defiencies / e.t.c.
Basic ppm in hydro
If ppm goes up (nutes to strong = delute)
if ppm goes down (nute to week = ad more nute)
if ppm is stable (sweet spot plant is happy)

but a have managed to figured out a way to up my ppm and keep my plant slight underfeed the hole grow. I have used my last 4 grows to figure it out.. (simple math :-) )

I can see your point now with dumping nutes and the smaller secondary resevoirs.
But if you growing the same strain (Photo) clones.. a single res should be enough. in theory.
I completely suck. when it comes to growing in soil... :-)..

I also worry about the controller over time..
Things need to be looked after over time... Probes/sensors e.t.c.
Fail safe should be incorperated in the programming (warning if someting is wrong Sms / email / e.t.c.

But that is the fun part about DIY. Tweeking things to perfection..

Im doing my controller in baby steps.
In that way i can see if things work out over time. Tweeking things as time goes.
And learning as i goes.
Up til now my arduino`s is steady.. no hickups (temp/himidity sensor_-_ On off timer 40 min off 3 min on.
Im not in a horry to finish this project. To much info to take in.

as you can see hydro and soil growers have different needs / problems

btw controlling light height that would be nice.
Smilies%20Smoking%20a%20Weed.gif

I like what your trying to do. don't know that I'd want to go that far with it myself, other than as an experiment, sounds too micro-managed for me lol! Kinda would take of fun out of hydro for me. However, I could see commercial applications for what you have in mind. Imagine 500 reservoirs in a big grow op. A controller like that would sure make life easier in that scenario.When you complete this, I'm sure we'd all like to see it in action!
 
nice one dude! That's pretty impressive that you're managing to pull it off with next to no programming experience. That just proves my point at the beginning of the thread, anyone with the patience and interest can do this... Well not anyone...:Got it Covered..?:hehehe.



A pic is just another microcontroller made by a company called microchip.



Best time to do it! I'd never have the patience otherwise.



Void is the return type for the function. It means that the function wont return a value. A Fnc in C can pass a value back to the function it was called from to be used in that function! It's like a tree branch with main as the top level function and the all the others branching from it. If you were to put "int" before the function name then you're saying that that fnc returns an integer and the last line of that function you would put return int;. Then to pass that int back to say main you would have a line in main like variablename=functionname(); to store the int passed by the function in a variable declared in main. Equally in the prototype of the function in main, if you want to pass a variable to the function it goes inside the brackets
I.e. int functionname(int variable1, int variable2.....) would take two integer variables and return an Integer.

Functions in C can only return one value otherwise you have to use pointers which is more tricky to get to work with microcontrollers and hardware at least, can't say for software running on proper CPUs. The variables that you pass to the function are created when the function is called and then destroyed at the end of the function without effecting the variables that were originally passed to the function, (local to the function) this stops having to track the values stored in variables which would get really messy otherwise and completely screw up your program.

The basis of good programming in C, is to split each task up into simple functions and then build them up rather than having it all in main, main is often only a few lines of code. This makes it much easier to write functioning code and if anything goes wrong you can work out where that's happened because you know the lower level building blocks work, so it's most likely to do with the bit of code you've just been writing, unless its to do with the way the hardware you're programming works, and then you have to be a god to figure it out and might as well scrap it and start again! This is one of the ways arduino is great because it already has functions like digital and analogue write, which are a bit of an over simplification, at least in the case of analogue write. Analogue write actually outputs a fixed frequency (carrier wave) train of pulses and uses a timer and a value stored in a particular register that you define when you configure it. The timer value is compared to the number in the special function register say between 0 and 1024 for example and whenever the timer counts upto that number it outputs a pulse and resets the timer, hence allowing you to program the duty cycle(on off time) of the output. By varying the number it counts upto you vary the duty cycle and can create an arbitrary waveform I.e. a sine wave by modulating the carrier train of pulses. When you use the pwm function with the atmel instruction set you can configure it in multiple ways and get much more control.

I can recommend a good book that's basically the bible of C it's called: The C programming language by Brian kernighan and david ritchy i think, anyway they invented C and its really helping me. im still a noob too really just studying it on my course. The books really short and mostly focuses on writing software that would run on some proper crappy oldschool computer but it teaches a lot of stuff in a really compact and intuitive way. Check it out if you're interested. Using C libraries and chip instruction sets is really easy and you end up learning a lot more than just sticking to arduino, lots of digital electronics etc. Sounds like you're up to it and don't need to stick to arduino forever! I find arduino is really helpful for proofing a concept but if you want improved performance you can get more out of "doing it properly"! ;) A lot of chips have handy extra peripherals too that make life easier or better! Check out the data sheet for the chip you're using too, atmel will have loads of handy application notes on how to do stuff as well.

Peace bro keep me updated I'm really interested and am definitely going to get round to doing this sometime. If you have any questions or problems gimme a shout too, might not be able to help but I'll try!

I took C programming in college....twice.......got kicked out for being face down in the book, snoring...........twice..........Hey! I tried! Bored me to tears lol!
 
Im just getting into it really. I think if I tried to learn C for the sake of learning C I would fall asleep too! I prefer to learn it as I need it and controlling hardware... Get to see a physical output. :)
 
Hey!
Looking good!! I am on this road myself. Looking more for monitoring ATM. I have two tents and a cab that I need temp and RH, and 16 pots of which at least half should have moisture monitored to get good representation. After I get that stable and my grow areas as well, I want to move up to controlling the environment in regards to temp and humidity. I have 4 fans in four areas now with two more areas planned. I want to be able to track and graph the data and look at it almost real time. Right now controlling my environment is top priority. I will also need to coordinate heat and a/c with all of this as well.
Looking at the Dallas one wire protocol for the sensors or at least some of them, to cut down on port use. There are some other notes about that I need to gather up It's quite a project, but I think it will be very beneficial to my garden.

wwwillie, I use this product to monitor Temp, RH and Res Temp. It's a little pricey but Lacrosse's web site tracks the data for the last 7 days of these properties and allows you to download the results. The service is free with purchase and then it's $3 or $4 a year for the service. I think it will do want you've described out of the box. Good luck!

http://www.amazon.com/gp/product/B0081URJHI/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1

If anyone has a simple diagram of what you are talking about I would be a great help. Thanks
 
Last edited:
wwwillie, I use this product to monitor Temp, RH and Res Temp. It's a little pricey but Lacrosse's web site tracks the data for the last 7 days of these properties and allows you to download the results. The service is free with purchase and then it's $3 or $4 a year for the service. I think it will do want you've described out of the box. Good luck!

http://www.amazon.com/gp/product/B0081URJHI/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1

If anyone has a simple diagram of what you are talking about I would be a great help. Thanks

Hey! Thanks man, appreciate it. I'll look it up.
 
Back
Top