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.

My Arduino based Grow controller

minttu

Member
Arduino what?

Arduino is a 16MHz Microcontroller with 30 kB of programmable memory and 1024 BYTES of RAM + another 1024 bytes of EEPROM, which you can consider being a sort of "hard disk" -- very small, very slow one.

picture.php


In a sense, very, very slow computer with very, very limited capabilities. But in exchange, you get to hardware level. You get to control the actual hardware. Play with bits, bytes and voltages.

Arduino has digital inputs/outputs that can be used for communication and control. I can for example attach sensors that read the environment, and other more complicated devices such as a Clock. Or more memory. Pretty much anything you can think of that is found in any electronic device. Think of 256 colour touch screen - I could make touch controlled grow room with beautiful graphics, that's something.

There are also analog inputs which read voltage, which can be interpreted using software. I got humidity sensor in analog port. And in software I turn the raw humidity into relative humidity taking temperature into account.

Principles

I have programmed control logic using C / C++. That logic reads the environment and makes decisions based on rules I have programmed. Say, temperature is high => turn on ventilation. Or humidity is low => turn on humidifier. Actual logic is a bit more complicated than that, but that's the principle. Most recent addition is control based on time. So, as lights come on at certain time, I can let temperature get higher. At night, I want to keep temperature and humidity low. If I had CO2, I could do even better things! Please send me some.. Watering based on soil moisture is also coming some time.

Based on decisions made, devices are turned on or off. Devices [230 Volts] are controlled using Solid State Relays [SSR]. These are good upto 480 Volts and 40 Amps, so no problem what ever device I got. Although, expensive and large, so I have decided to switch all but light from SSR to more convinient and simpler 250VAC/10A devices. 8 relays so I can control whooooooooooooooole bunch of things.

Live Data in my Browser

But that's not enough! Not for me. Gladly Arduino can be connected to a PC using USB. I just happen to have a big Linux box at the same Location, so I have tapped my grow room into that.

Currently I can only READ data from it, but I am guessing I will be making a sort of "remote control" later on :dance013:

I'm using JavaScript library called Highcharts to draw live graphs about the temperature and humidity and status of all devices. It also shows alerts if something isn't in check. Then with remote control I could actually turn the vent on sitting on my computer if the programmed-in logic isn't for some reason doing what I want. Or program more advanced logic. Open a door to let sunshine in to save money on energy.. Geeh. OR! Receive SMS messages to my mobile when things go HORRIBLY wrong, and then, switch all the electricity off. I might be either intelligent, or simply obsessive..

Live Status

picture.php


Two days fiddling with Highcharts. The sun there is telling me lights are on. No need to walk there to make sure.

Funny to see also how temperature inversely correlates with humidity :) That data I can use to fine tune the logic.

The Hardware

picture.php


Really, really dirty. I want to get this pretty, maybe even solder all onto a breadboard once I have come up with something final.

The Future & Benefits

Umm.. So much to do! I love the idea of getting visual representation of data and grow environment. Using that I can make adjustments to logic and the cabinet itself.

Removing human component should make the grow go smoother. Humidity stays consistent, temperature stays consistent, and if and when I have the automated watering, that too.

I have some kind of vision of intelligent logic in which I set some parameters to each environmental variable and then the controller does its magic using what ever device it sees best fitting to meet those parameters. But that's quite an advanced logic and would require hell of lot of rules and thinking. Priorities and such.

It's truly unbelievable what one could do with this kind of stuff if one has imagination and ingenuity.

Will be posting updates.
 

Hydropimp

Active member
Veteran
Nice work I wish you would of posted this 2 weeks ago I would of made one instead of buying a controller.

But still would like to take on a project like this.

Taking a seat.
 

audiohi

Well-known member
Veteran
Thanks for making this thread! Please keep us updated, and I'd really appreciate any additional info you can provide.
 

minttu

Member
Nice work I wish you would of posted this 2 weeks ago I would of made one instead of buying a controller.

Apparently proper controllers aren't cheap at all. Looked into manual and pretty much does the same as my Arduino. Although, mine isn't that pret-ty, and doesn't come with very intuitive user interface. Then again, nothing beats doing it self, isn't that one of The reasons behind growing stuff, one might wonder.

CO2 sensor is actually quite expensive, in perspect. Costs $20-50 depending on quality. Arduino Mega 2560, which is what I am getting, cost me $17.. So.. But overall, even with CO2, wouldn't cost over 100 bucks if all parts from eBay.

There is also a cheaper open source / open hardware controller called OpenSprinkler, although it might need some modification since it only does, well, sprinkling. But the framework is solid as far as I have looked into it.
 

DreamsofTesla

Member
Veteran
I wish I had the know-how to work with Arduino. I've read up on them, seen lots of instructables. Such a great tool. Bravo to you.

<3 Tesla
 
Nice dude ! This looks sick ! i was also thinking of using a raspberry pi for my grow. ive got a laptop monitor, all i need to do is order the controller for it, get a vga to hdmi converter, attach screen to raspberry then arduino to raspberry. You think they will make a good combination ? : ) Peace
 

Can420

Member
Nice start, If you have a chance, could you post the moduals you are using and where are you are getting them?

Hopefully at end of month I can start my arduino grow also. It be nice if a few users would combine efforts in programming and building how to for ones that have no clue to this stuff.
 

t33to

Member
Arduino what?

Arduino is a 16MHz Microcontroller with 30 kB of programmable memory and 1024 BYTES of RAM + another 1024 bytes of EEPROM, which you can consider being a sort of "hard disk" -- very small, very slow one.

View Image

In a sense, very, very slow computer with very, very limited capabilities. But in exchange, you get to hardware level. You get to control the actual hardware. Play with bits, bytes and voltages.

Arduino has digital inputs/outputs that can be used for communication and control. I can for example attach sensors that read the environment, and other more complicated devices such as a Clock. Or more memory. Pretty much anything you can think of that is found in any electronic device. Think of 256 colour touch screen - I could make touch controlled grow room with beautiful graphics, that's something.

There are also analog inputs which read voltage, which can be interpreted using software. I got humidity sensor in analog port. And in software I turn the raw humidity into relative humidity taking temperature into account.

Principles

I have programmed control logic using C / C++. That logic reads the environment and makes decisions based on rules I have programmed. Say, temperature is high => turn on ventilation. Or humidity is low => turn on humidifier. Actual logic is a bit more complicated than that, but that's the principle. Most recent addition is control based on time. So, as lights come on at certain time, I can let temperature get higher. At night, I want to keep temperature and humidity low. If I had CO2, I could do even better things! Please send me some.. Watering based on soil moisture is also coming some time.

Based on decisions made, devices are turned on or off. Devices [230 Volts] are controlled using Solid State Relays [SSR]. These are good upto 480 Volts and 40 Amps, so no problem what ever device I got. Although, expensive and large, so I have decided to switch all but light from SSR to more convinient and simpler 250VAC/10A devices. 8 relays so I can control whooooooooooooooole bunch of things.

Live Data in my Browser

But that's not enough! Not for me. Gladly Arduino can be connected to a PC using USB. I just happen to have a big Linux box at the same Location, so I have tapped my grow room into that.

Currently I can only READ data from it, but I am guessing I will be making a sort of "remote control" later on :dance013:

I'm using JavaScript library called Highcharts to draw live graphs about the temperature and humidity and status of all devices. It also shows alerts if something isn't in check. Then with remote control I could actually turn the vent on sitting on my computer if the programmed-in logic isn't for some reason doing what I want. Or program more advanced logic. Open a door to let sunshine in to save money on energy.. Geeh. OR! Receive SMS messages to my mobile when things go HORRIBLY wrong, and then, switch all the electricity off. I might be either intelligent, or simply obsessive..

Live Status

View Image

Two days fiddling with Highcharts. The sun there is telling me lights are on. No need to walk there to make sure.

Funny to see also how temperature inversely correlates with humidity :) That data I can use to fine tune the logic.

The Hardware

View Image

Really, really dirty. I want to get this pretty, maybe even solder all onto a breadboard once I have come up with something final.

The Future & Benefits

Umm.. So much to do! I love the idea of getting visual representation of data and grow environment. Using that I can make adjustments to logic and the cabinet itself.

Removing human component should make the grow go smoother. Humidity stays consistent, temperature stays consistent, and if and when I have the automated watering, that too.

I have some kind of vision of intelligent logic in which I set some parameters to each environmental variable and then the controller does its magic using what ever device it sees best fitting to meet those parameters. But that's quite an advanced logic and would require hell of lot of rules and thinking. Priorities and such.

It's truly unbelievable what one could do with this kind of stuff if one has imagination and ingenuity.

Will be posting updates.

Wow, very cool! Would you mind sharing what SSR's you are using that can switch your appliances on? Can you really drive a relay that can handle all that power and voltage with only 5v from the Arduino?
 

minttu

Member
Can you really drive a relay that can handle all that power and voltage with only 5v from the Arduino?

Yup, at least in theory. SSR tend to leak some current through even when in off-state. But I don't know if that has any practical significance, my 250 Watt HPS works perfectly with or without leaking.

You might want to check this page, it has lots and lots of cool information on driving higher power devices with lower power such as Arduino.
 

setaemies

Member
How neat is that! Too many times I have almost ordered a kit after seeing something awesome done with the arduino. I think this might just push me over the almost. :biggrin:
 

t33to

Member
Yup, at least in theory. SSR tend to leak some current through even when in off-state. But I don't know if that has any practical significance, my 250 Watt HPS works perfectly with or without leaking.

You might want to check this page, it has lots and lots of cool information on driving higher power devices with lower power such as Arduino.

Awesome. Thank you for responding. Please link me a model number of those SSR's you are using. I wouldn't mind seeing your sketch code as well :D
 

minttu

Member
How neat is that! Too many times I have almost ordered a kit after seeing something awesome done with the arduino. I think this might just push me over the almost. :biggrin:

Do it man! :bump:

Awesome. Thank you for responding. Please link me a model number of those SSR's you are using. I wouldn't mind seeing your sketch code as well :D

Well if you honestly want the model numbers, I got a ZG3NC-340B and a MGR-1 B4825. Code is private, at least for now. Maybe version 3 could be OpenSource, if I manage to rewrite some key control elements :)

I would certainly like to kick some $600 ass with 70 bucks and some Code. Make it all available and OpenSource just to piss them off :whee:
 

Symbiotics

New member
I'm on the verge of using an Arduino for grow automation. Actually about 40 days from setting it up, just waiting for this run to finish. Been tinkering/learning for months now.

So... much... potential...

You can make moisture sensors out of plaster of paris and 2 nails. Not super accurate (unless you change the circuit to send the 5V in both directions) However, even in basic form it is enough to tell when the soil is "almost dry" versus saturated. So its enough to meet the needs at hand.

The raspberry pi is an excellent addition to arduino (actually should just be using an Atmega chip on a breadboard, use your arduino to program them ;) )

The raspberry pi uses linux, and and has full usb support. you can connect a usb wifi device to go wireless, as well as host the automation server, or just communicate with an actual server through php or .net framework, etc. Did I mention is also linux? Alot easier to use IpSec VPN tunnels, so you can SECURELY check whats going on at your grow, or get realtime notifications. As well as issue commands over your phone (IpSec VPN is supported in Android) you could use your computer as well.

You could also use another raspberry pi in place of a phone/computer. There are small monitors and keyboards (crazy small, not expensive), so you could have a totally "close loop" network over VPN to monitor grow in real time.

As for watering, basic drip systems can be used. Attach pressure regulator, so every dripper drips at 1GPH, and well, you get the idea. The 1/2 in poly tubing can branch off 3/4" PVC pipe, and there are solenoids that connect to Arduino (any microcontroller) that will allow you to open and close the water source with 5V.

Of course there are solid state relays, which can handle any current and voltage depending on which relay you use. Most common is 15amps 120V. So you can control 1Kw lights with an arduino (actually more). So if you only have one a small grow, and not a warehouse, then you would just use a relay to turn the pump on, but the 3/4" solenoids help to distribute water to different "areas" in larger or outdoor grows.


Yes, so much potential. Just thought I would throw out a few more things as I have been working on this for many months, this is just the tip of the iceberg.

It'd be nice to hear some fresh ideas and bounce code off fellow stoners :)

Forgot this was a new account, no editing posts, tried to add the 6th paragraph, and ended up double posting.

So I will make amends by adding a bunch of sites you should look at for info.

sparkfun
adafruit
hackaday
instructables
thingiverse

Also to add, touchscreens and graphics with arduino don't mix well. Previously I talked about having RaspPi in the growroom, Beaglebone is a better option (its sorta kinda halfway b/t Arduino and RaspPi)

Beaglebone has touch capabilities built in, but no HDMI out (no graphics/monitors), however it does have more GPIO pins then the arduino itself, and is more powerful than the Arduino/RaspPi, but runs on Linux(among others) instead of something like Arduino's dialect of C. (depending on your coding background, good or bad)

Beaglebone in the grow in place of (but better with) Arduino. Connects to internet. RaspPi is the client with USB Wifi, has HD user interface, built in keyboard and monitor (you can always add touchscreen with capacitive touch) Or just the board itself that can hook up to any tv (has composite option, not just HDMI) and log-in to grow with pre-mentioned secured VPN tunnels.
 
Last edited by a moderator:

samba

Active member
I so wish I know how to program Arduinos, I have a million ideas, but no programming experiences...
Can you recommend a book or something to get started?

How about the electric side?
Have you made a speed controller for your fan?
 

audiohi

Well-known member
Veteran
The arduino site has so much information for beginners. That's one of the best things about it, is all of the freely available info!

Getting Started with Arduino is a good cheap introduction book. Very basic info and step by step project instructions.

Just about anything you may want to do with arduino, you can find examples already done! Good luck!
 

minttu

Member
I so wish I know how to program Arduinos, I have a million ideas, but no programming experiences...
Can you recommend a book or something to get started?

How about the electric side?
Have you made a speed controller for your fan?

I'd recommend you just go through Arduino Sketches, or perhaps start with something simple like PHP, or go straight to C. It doesn't really take alot to make something happen.

Hard to give any advice how to learn, because we all learn differently. I just Google and browse eBay for all kinds of parts and when I find something that seems appropriate, or might do the job, I dive a little deeper. As long as you start somewhere, you are going forward and building that knowledge base.

Speed control for fan would be awesome to have. I mean I have, but it's manually adjustable. I want Arduino controllable. I should look into that. If it can be manually done, it sure as hell can be done electrically with circuits.

EDIT Found it. Would make a nice module.
EDIT 2 And ready-made for $39.95 :biggrin:

Just about anything you may want to do with arduino, you can find examples already done! Good luck!

Exactly! Arduino makes learning electronics so much simpler. Pure AVR / PIC development is like black magic in comparison.
 
Last edited:

Latest posts

Latest posts

Top