My Arduino & LEDs

apoulin

Well-Known Member
Hello all,

I have expressed some interest in using my Arduino Uno as a grow room controller. There are a lot of step-by-step guides online but they aren't exactly what I am looking for, so having that DIY bug I decided to give it a shot.

My plans are to

CONTROL
Lights (5 CXA/CXBs, 4 Vero 10s, UVB bulb)
Fans/Heater/Humidity

MONITOR
Voltage at each string/COB and of entire system
Current of LEDs and of entire system
Temperature
Humidity

I purchased:
365buying DS18B20 Temperature Sensor - Waterproof Digital Thermal Probe Sensor DS18B20 - $4.95
Arrela® 4-channel 5v Relay Module with Optocoupler for Arduino DSP AVR PIC ARM - $7.95
Arrela® DHT11 Digital Temperature/Humidity Sensor - $6.43

Total - $18.48 w/prime shipping

I plan to use the DHT11 Temp/Humid sensor in my growing area towards the canopy and will monitor and log this data, I will then be able to convert this to easy to read graphs for the entire grow. This sensor will be the trigger for the Fans/Heater/Humidity elements.

I will be using the DS18B20 waterproof temperature sensor to keep in my res, this will be constantly monitoring the res temp. I will also be able to graph this for different times of the day as well as for the entire grow.

The 4-channel relays will be used to allow the small signal voltage from my arduino to turn on much larger loads. I will be using https://www.sparkfun.com/tutorials/119 to construct the GFCI outlet boxes, this will allow me to control each outlet individually. The relays are 10A each X 4 realys, so each relay could have one GFCI outlet for future expansion. I will most likely only construct 1-2 to start.

I decided to use components that have examples already available online, and that were relatively low cost. I wanted to get a solid base system going and then I could add almost anything I wanted to in the future, for example:
PH Sensor and probe kit - $127.99
EC Sensor and probe kit - $191.99
Dissolved Oxygen Sensor and probe kit - $231.99

Now those prices are kind of steep, but those are lab grade kits with quality probes as well as everything else *including documentation*. So following our LED way of life, higher upfront costs for a better product that will have a longer quality life, I could set up a round the clock monitoring system that logs and graphs all of the data and stores it to an at home server. This could be used to control and maintain my res automatically.

I also think it would be neat to wire up a camera to take a couple snapshots a day so I can compile some nice seed-harvest GIFs, make for some nice comparison pics!

Once you start thinking about it you can accomplish just about anything you want like a light raiser, nutrient feeder, water pump control, CO2 sensors/controller, AC/Water chiller, Dehumidifier, etc.

I am no expert, I am an electronic hobbyist as well as some college courses. This is why I chose parts with documentation and examples. I will not be trying to reinvent the wheel, I plan on using the code already written for each sensor. I am hoping for as close to a plug-and-play experience as I can, not that I don't enjoy it but I feel like I could give back to the community if I made it....uh.....stoner proof?

The parts will be here Thursday!


:peace:bongsmilie
 

heckler73

Well-Known Member
You should have gone with the DHT22, for the resolution.
If you are going to use the DHT for triggering fans, etc. it will be a little wonky, or you'll need to have wide tolerances based on the temp or RH measurements. That price seems a little salty, too. I seem to recall paying only a couple bucks each for my DHT11's (free shipping).


Anyway, you'll have fun putting it all together. I look forward to seeing it in action.
 

alesh

Well-Known Member
Sounds good.
yea there were a lot of build-your-own sensors and parts. I did not want to mess with any of this, I wanted manufactured and safe components. I saw those for relatively cheap and with free shipping, I mean all of those sensors for less than $20 shipped? Guess we will see how they perform lol
For starters DHT sensors are very slow and I wouldn't trust a no-name relay with more than a few amps of resistive load. I burnt a very similar looking/rated relay when controlling a 400W HID.
 

heckler73

Well-Known Member
Sounds good.

For starters DHT sensors are very slow and I wouldn't trust a no-name relay with more than a few amps of resistive load. I burnt a very similar looking/rated relay when controlling a 400W HID.
That's a good point about the relays...probably a good rule of thumb is buy a rating at twice your expected input, just to give plenty of headroom for "quality" (ahem). :mrgreen:

But what do you mean in saying the DHTs are "slow"?
 

alesh

Well-Known Member
That's a good point about the relays...probably a good rule of thumb is buy a rating at twice your expected input, just to give plenty of headroom for "quality" (ahem). :mrgreen:

But what do you mean in saying the DHTs are "slow"?
TBH I'd say more like ten times. Or it's just me being paranoid.
Exactly what I said. They're slow. They take a lot of time to respond. And in that time, the DHT library is waiting.
 

heckler73

Well-Known Member
TBH I'd say more like ten times. Or it's just me being paranoid.
Exactly what I said. They're slow. They take a lot of time to respond. And in that time, the DHT library is waiting.
Is one measurement every 5 seconds too slow?
I don't see a need to take measurements more than once a minute. Is there a particular reason you believe it needs to be more than that?
 

alesh

Well-Known Member
Is one measurement every 5 seconds too slow?
I don't see a need to take measurements more than once a minute. Is there a particular reason you believe it needs to be more than that?
Nah, that's not what I mean. I agree that once a minute is more than enough.
The measurement itself is slow and the DHT library blocks Arduino from doing anything else while waiting for DHT to respond. Ie I had a simple web-server running on Arduino Mega and it caused some problems if I accidentally send a request while Arduino was waiting for DHT (there were 4 of them taking measure each 30 seconds - it happened).
 

heckler73

Well-Known Member
Nah, that's not what I mean. I agree that once a minute is more than enough.
The measurement itself is slow and the DHT library blocks Arduino from doing anything else while waiting for DHT to respond. Ie I had a simple web-server running on Arduino Mega and it caused some problems if I accidentally send a request while Arduino was waiting for DHT (there were 4 of them taking measure each 30 seconds - it happened).
Which library were you using, if you don't mind? I've seen a couple different ones, and looking at the one I use (FVI version) it doesn't look like much of a pig. Granted, I haven't incorporated it into anything involving Wifi or web-based control.

How large was your code (i.e. total peripherals, sensors etc.)?
 

alesh

Well-Known Member
Which library were you using, if you don't mind? I've seen a couple different ones, and looking at the one I use (FVI version) it doesn't look like much of a pig. Granted, I haven't incorporated it into anything involving Wifi or web-based control.

How large was your code (i.e. total peripherals, sensors etc.)?
I'm not sure. Probably DHTLib. This was 2 years ago.
I eventually moved and had to stop growing and never got to finish that project :'(
It now rests in a nice box waiting to come to light. And it will someday...
There were quite a few sensors I tried and several peripherals. The code was large and a mess.

You can easily measure how long does it take to get measure from a DHT with a simple sketch. Just save micros() before and after and print out.
 

apoulin

Well-Known Member
@apoulin

Are you going to run thru a comp real time or collect data to an SD card?
I thought about using an sd card but honestly I was thinking of getting an ethernet shield. That way not only is my data being stored, I can access it from my home computer network.

I know that some of these parts may not be ideal and I was worried about the build quality. I plan on getting solid state relays once I get everything hooked up and tested.

I have seen a lot of examples using this equipment (found online) and the parts seem to do the trick. However if I get it together and my sensor is an arduino hog or slows my system down, I will let you guys know!

I knew the resolution for that dht11 was lower than the dht12, but I have seen a few examples of them reading in from the sensor every min or so and logging the data, but without the refined resolution it may be hard to control things with a ton of precision. But hey at this point I'm looking for it to do what I need it to do, even if I have to purchase additional equipment.

This was also my first time dealing with the relays for my arduino, this was the part I was most unsure about. I got 4 relays @ 10A each, even if I only run them at 5A each, that is still 20A total. So my thought was that should be plenty to get my feet wet and be able to turn everything off/on. If the relay shows any issues with higher loads, I will be purchasing higher quality solid state relays.

The great thing about a system like this is I can have it up and running and change parts out or upgrade things whenever I would like. I also don't have to pay for everything up front, as in I'm a broke ass college kid and I can manage $50 a week for some extra parts, but blowing $100s on a system is not possible lol

:peace:bongsmilie
 

apoulin

Well-Known Member
You should have gone with the DHT22, for the resolution.
If you are going to use the DHT for triggering fans, etc. it will be a little wonky, or you'll need to have wide tolerances based on the temp or RH measurements. That price seems a little salty, too. I seem to recall paying only a couple bucks each for my DHT11's (free shipping).


Anyway, you'll have fun putting it all together. I look forward to seeing it in action.
yea I interested to see how the tolerance would work, especially for triggering fans and things. It says +-%5 for ratings, I guess at this point I want a rough "it's too hot and humid" sensor. Lol I guess I'm not looking for perfection right now, just closer to having a monitored system

:peace:bongsmilie
 

heckler73

Well-Known Member
yea I interested to see how the tolerance would work, especially for triggering fans and things. It says +-%5 for ratings, I guess at this point I want a rough "it's too hot and humid" sensor. Lol I guess I'm not looking for perfection right now, just closer to having a monitored system

:peace:bongsmilie
Well, that's fine. It does work as a general monitor, so long as one isn't paranoid over those tolerances. In my tests, I found it working well in 2% RH steps. But in any future work, I intend to use something of higher precision. I did another survey last night, and noticed some new versions coming out; however, their tolerances don't appear any better than the DHT22/21. It could be they are just stripping the guts and repackaging them on little proto-boards.
 

az2000

Well-Known Member
Not long ago I played with a temperature controlled exhaust fan. Coming from a computer background I always think worst-case scenarios. I.e., what if the sensor fails (or the relay sticks)? I tried to wire it so the worst-case would be that the fan is full speed, not off. Even then, I'm concerned it could fail in a manner that would be off. I could be worried about minutia -- but it's still a matter of *when*, not if. (I.e., if something can happen, it will happen.).

Have you thought about redundancy or alarms for critical thresholds like exhaust, temperature or light?
 

apoulin

Well-Known Member
Not long ago I played with a temperature controlled exhaust fan. Coming from a computer background I always think worst-case scenarios. I.e., what if the sensor fails (or the relay sticks)? I tried to wire it so the worst-case would be that the fan is full speed, not off. Even then, I'm concerned it could fail in a manner that would be off. I could be worried about minutia -- but it's still a matter of *when*, not if. (I.e., if something can happen, it will happen.).

Have you thought about redundancy or alarms for critical thresholds like exhaust, temperature or light?
Yes I have thought about it, I definitely will have an alarm to alert me if something is wrong. Maybe a stealth email or text or something. I come from the same type of background, so I understand the paranoia lol My thoughts are I will be visiting my area multiple times a day, worst case scenario a day or two at the most away from it. I don't want this to be a completely automated system, so I am not too worried about something failing. I don't have a real extreme environment as it is, so if something failed and stayed open or closed for a day it wouldn't mean disaster, of course there are limits lol

I figured until I get the kinks worked out I will be visiting as if there was no microcontroller keeping an eye out lol Plus lets be real, I am just trying to have to do less work WHILE I am with my plants. I don't want to spend less time in the grow area, just less time monitoring and maintaining it.

This is also the advantage of using LEDs, most controllers I have seen use HPS bulbs. So if a fan did not turn on and your bulb was running all day....well I am sure you can guess what happens at that point lol Death, Destructions and maybe FIRE! My LEDs run without extra fans as it is, so my fan controlling will be less for heat and more for fresh air exchange and humidity. My closet does get humid, especially now that they are sucking down water in flowering.

But obviously, once I am knee-deep in the project I am sure there are things I want to add, such as more alarms or add redundant equipment.

:peace:bongsmilie
 

AquariusPanta

Well-Known Member
This thread needs blown up.... we don't have enough threads on the computing aspect of indoor growing!

I'm still intimidated and interested in this subject but am in no rush to jump into the mix. I suppose if I was a grower and my life sort of depended on getting the best results, I'd totally have this shit figured out and implemented throughout my growspace.

:joint:
 

Abiqua

Well-Known Member
This thread needs blown up.... we don't have enough threads on the computing aspect of indoor growing!

I'm still intimidated and interested in this subject but am in no rush to jump into the mix. I suppose if I was a grower and my life sort of depended on getting the best results, I'd totally have this shit figured out and implemented throughout my growspace.

:joint:
Just jump in, $25 - 50 is all you need for a variety of sensors and a board....most of the code is already written [especially for most of the common sensors] and some are included in the your libraries with Arduino's IDE....

Now when you start throwing multiple sensors on 1 board [probably should use something like this.....sensor shield..
,
and add a PWM controller and a Touchscreen, plus any other variable....Yeah, the code will stack up quickly, but none of that is needed at first to Get a feel for the fundamentals.....I am living slack-jawed proof
that if I can do it, literally anyone can...:)


These things were meant for people without programming skills, but also compiles C if you really know what your doing, so they aren't just "toys" or gimmicks...
...although circuit knowledge is invaluable and that's where I struggle just from inexperience...

I have another Nano V3 board on the way...the micro Uno....another super tiny all in one board, to build portable instruments for the grow environment...


@heckler73 @stardustsailor

have both been patient and answered questions for me, can't thank them enough...

@apoulin
definitely following along, as there are about 4 active / semi-active threads in the entire RIU :peace:
 
Top