DIY CHEAP DIY microcontroller (arduino) grow room environment controller

"unbalenced nute solution"

That just shows my ignorance. Woops

I like the web server idea and being able to control your grow from your phone, but over this side of the pond it's probably not such a good idea. Could you imagine someone vindictively hacking your grow though mwahahaha!

That sounds like a really cool system, I wish I had less limitations and could go all out on something like that. "Incredible Sulk"

The idea i had for light height's quite simple really. Have the light on a chain connected to ratchet pulley or bike cog and a geared down dc motor or stepper, laser diode array on one side (with shielding from the grow light) and photo transistor array on the other. attach it to your light by some kind of structure that allows you to move the array up and down to adjust the desired light height. Then program the controller so that if the beam is broken the light moves up until all the photo transistors are triggered again. If that makes any sense!
 
Nahh
i Think its my lack of language skills, That's why i didn't understand.

About the web server (hacking). i think it´s possible to firewall for incomming traffic from the outside world.
But that's something to worry about when times come.

That light mover thingy seems quite possible, it could not be that hard to fit those Ir diodes and get it to work.
There is a few solutions on youtube also (not with arduino) but could easily be made with arduino as the "brain".

Ive been stuck in some programmimg most of the day.
but finally i finished the "menu" settings for my Soil watering system.
Im seems like i got it to handle around 10 buckets. (Its not finished yet, Right now im using 4 io ports for each bucket inclusive the "menu") Override from switches / Moister level up / down / Watering time up / down)..
and all buckets will have a manually setting (Pr bucket) so it´is possible to give the exact amount of water you whant and also a manually setting for when it will get water ( Moister level in each bucket ).
This is so much fun :smoke:



Fu.k im behind when it comes to programming these little fuckers.

but that's the beauty with Code,, you only have to do things ones and then it´s a matter of copy and paste :coffee2:
:Sharing One:
 
but that's the beauty with Code,, you only have to do things ones and then it´s a matter of copy and paste

Amen brother! Gotta love open source coding. Have you had a look at using the atmel instruction set instead of arduino language? Don't know it myself as I'm used to pics, but if you're using the digital write function you could save a lot of processor resources by using at least a little of the basic atmel libraries, probably not too important for small projects but as they get larger it could help with anything time critical. The way mcu's work is that the instruction fetch, memory access and output require information from the previous stage and possibly one before, so to optimise this process the data is stored in a latch register (mips pipelining) between each stage so that the processor doesn't lose the info and have to go get it again, simply put anyway! With pics whenever you output a value (direct addressing) to a port in C it's much faster and less costly to directly write the data to the latch register rather than write to the port which requires far more time/processor resources. I don't know if I explained that properly but I know digital write is a crappy function and there's a much better and faster way to write values directly to ports/pins using the native language. With pics it's latAbits.RA1 = 1; for example to make pin 1 of port A go high instead of PORTAbits.RA1=1;. Not the same for reading pins though that requires a read from the port rather than the output latch register.
 
PS if I could have a look at your code for the watering system I would be eternally greatful! :Cool bud:
 
Amen brother! Gotta love open source coding. Have you had a look at using the atmel instruction set instead of arduino language? Don't know it myself as I'm used to pics, but if you're using the digital write function you could save a lot of processor resources by using at least a little of the basic atmel libraries, probably not too important for small projects but as they get larger it could help with anything time critical. The way mcu's work is that the instruction fetch, memory access and output require information from the previous stage and possibly one before, so to optimise this process the data is stored in a latch register (mips pipelining) between each stage so that the processor doesn't lose the info and have to go get it again, simply put anyway! With pics whenever you output a value (direct addressing) to a port in C it's much faster and less costly to directly write the data to the latch register rather than write to the port which requires far more time/processor resources. I don't know if I explained that properly but I know digital write is a crappy function and there's a much better and faster way to write values directly to ports/pins using the native language. With pics it's latAbits.RA1 = 1; for example to make pin 1 of port A go high instead of PORTAbits.RA1=1;. Not the same for reading pins though that requires a read from the port rather than the output latch register.

:Woozy..?:
LOL i properly understood 20% of this post. after reading it 5 times
I don`t know anything about the atmel instru..
Don´t know what pics is.
IM a total noob when it comes to programming anything in c.
Any of my programming in c is self taught....
First time i have use a "void" was yesterday. And i don´t know what id means either.......
Baby steps baby steps my friend.
I just use my common logic.when it comes to programming.
Find out what i whant to do "functions i need". And find a solution on the reference section on arduino website

PS if I could have a look at your code for the watering system I would be eternally greatful! :Cool bud:

Ofcourse no prob. it would be nice to get another to look at my poor programming skiils....
I have no schematics over this project. no drawings of how its going to be assembled. Its only and idea evolving as times goes (mostly while high as a kite) the same goes whit the proogramming..
I properly would go with a one bucket setup with a settings menu. Get that dialed in and. then do the rest 9 buckets
Need the arduino mega to handle all thoes buckets.

Well i will take a look at my code,, Redo,, some so its in english,, Make a shitloads of comments so it hopefully make sense.
Watering system will be in one ino.file
Menu / settings will be in another ino.file

I'll get back to you on this. Be patience
:Sharing One:
 
Last edited:
I'll get back to you on this. Be patience

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.

Don't know what pics is.

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

(mostly high as a kite)

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

First time I've used a "void" was yesterday.

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!
 
Last edited:
I send you a PM with the watering system.
I been looking at How to Toggle in and out of different functions
with the digital write /digital read...it´s starting to make sense now
thats a hole new world with the functions :smoke:.

I´ll start over with the settings... should not be a problem to get it to work :cool:
For what im doing (arduino is a great learning tool to get my feed wet in programming in C.
Different projects = new things to learn..
I´ll keep you in the loop
:Sharing One:
 
Count me in! I've been dreaming of an automated hydro system. I don't have anything to contribute but you've got my eyes and ears.
 
Count me in! I've been dreaming of an automated hydro system. I don't have anything to contribute but you've got my eyes and ears.
Im working on it [emoji6]
But at the moment im working on a automatic watering system for soil.
Well that part is done.
But need a menu also. Need to change values for when and how much to water the plant/s..

When menu is finish.
The hydro setup is almost complete.using the same menu
The hydro setup im working on..
controls the res. (NOT DWC but should work for RDWC)Its made for a reserculation system
It will handle. Atm
Ph up
Ph down
That part is done
The next part is the same in princip
Ppm up
Ppm down
[emoji6]
Summer is soon to be over, and loong winter,, so what else todo..
[emoji317]
 
  • Like
Reactions: JM
Well that's one good thing about Winter."Munch..munch..munch I'll look forward to seeing the results.
 
Back
Top