|
Some of these posts are very old and might contain outdated information. You may wish to search for newer posts instead.
|
gray

Registered: 03/07/15
Posts: 127
|
Raspberry Pi Controlled Mini Greenhouse 3
#21835569 - 06/21/15 05:56 AM (8 years, 7 months ago) |
|
|
I've been dissatisfied with my automated greenhouse build. I've been using an off-the-shelf humidity/temperature controller, one of these:

But I've found it really sucks for my needs. It's far too slow to respond to changes in humidity. It's probably great for a big grow space, but in my little 4 shelf greenhouse the humidity can change really quickly when the fans start to exchange air and everything just either dries up or floods.
So, I decided to build a custom Raspberry Pi controller.
The Plan Use a simple temperature/humidity sensor connected to the Raspberry Pi and have the Pi turn an ultrasonic humidifier on and off at the appropriate times to keep the humidity within a given range.
The goal being to have humidity maintained around the correct range and graphs of temperature/humidity over 1 hour, 24 hours and 7 days so I could keep an eye on what was happening.
The Main Parts
- A Raspberry Pi (£30)
- An AM2302 temperature/humidity sensor (£2)
- A solid state 240 VAC relay (£8)
- A plastic project box (£4)
The Method Wired everything up, with the AM2302 on a GPIO input pin on the Pi and the relay switched by a GPIO output pin.
Wrote some custom software to do the monitoring and control the output and generate the graphs.
The Results It's been working great. Humidity is maintained at the desired level and the sensor is easily fast enough to detect rapid changes in environment.
Here's a couple of graphs, it's set to aim for 95-100% humidity:

The black bars at the bottom of the graph above show when the humidifier turns on. The sudden dips in humidity are when the greehhouse fans kick in.

Here's the box I built with the relay:

Here's what's inside:

Sharing If you have a Raspberry Pi with Raspbian installed and an AM2302 sensor and a relay connected up, you can install all the required software easily. Software uses the Adafruit AM2302 library and rrdtool for graphs.
From the Pi command line:
Code:
git clone https://github.com/grking/humidity.git cd humidity sudo ./setup
Then simply run the controller with:
Code:
sudo ./control.py <input pin number> <output pin number>
Software project page is here.
Edited by gray (06/21/15 02:48 PM)
|
natedawgnow
Rocky mountain hood rat



Registered: 02/09/15
Posts: 8,939
Loc: ation
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21837073 - 06/21/15 01:45 PM (8 years, 7 months ago) |
|
|
Dude if i showed this thread to my roommate, he would be pissed. He keeps saying he wants to do this exact thing with his Pi and he'd be upset you did it first.
--------------------
|
Psilicon
Really Nice Guy


Registered: 08/26/12
Posts: 7,057
Last seen: 3 years, 1 month
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: natedawgnow]
#21837111 - 06/21/15 01:54 PM (8 years, 7 months ago) |
|
|
I have a lot of respect for people who can make automated chambers work for them. I'll be watching this.
|
Srirachi
Mold Hand



Registered: 10/18/05
Posts: 11,411
Loc: Fare Thee Well.
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21837127 - 06/21/15 01:57 PM (8 years, 7 months ago) |
|
|
Very nice work man! Thanks for sharing the code.
|
lusus
Stranger

Registered: 04/06/10
Posts: 229
Loc: EUROPA
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: Srirachi]
#21837313 - 06/21/15 02:30 PM (8 years, 7 months ago) |
|
|
Why couldn't you have posted this yesterday? I ordered one of those humidistats only yesterday! Is not the exact same model so it might actually perform but its a generic made in china type of thing. Fingers crossed... Very neat job with the PI
--------------------
|
wildernessjunkie
Reshitivest


Registered: 06/13/10
Posts: 8,118
Loc: HTTP 404 Not Found
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: lusus]
#21837431 - 06/21/15 02:52 PM (8 years, 7 months ago) |
|
|
I love this kinda shit. I really want to see this work out.
Edited by wildernessjunkie (06/21/15 04:45 PM)
|
Aero
Orea


Registered: 11/01/13
Posts: 2,253
Last seen: 1 year, 2 months
|
|
-------------------- SPREAD THE SPORES
|
thoraxx
Wizard


Registered: 12/27/13
Posts: 580
Loc: Bavaria
Last seen: 4 years, 10 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: Aero]
#21837795 - 06/21/15 04:22 PM (8 years, 7 months ago) |
|
|
I wanted to do something like that for some time now, but instead of digital hygrometer connect the humidifier to a timer
I have a very similar looking ultrasonic, its got a fan built in and the idea was to connect the fan to an external power source controlled by a raspi then alternate between ultrasonic misting and FAE with just the fan running and dial in the optimal timetable with a decent analog hygrometer
I still have a few weeks to go until my next grow, still busy isolating on agar, if i get this working until then ill make a thread
|
natedawgnow
Rocky mountain hood rat



Registered: 02/09/15
Posts: 8,939
Loc: ation
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21837812 - 06/21/15 04:25 PM (8 years, 7 months ago) |
|
|
Definitely keep us updated! Awesome job, man!
--------------------
|
RyeJar
StrangerDanger


Registered: 04/16/15
Posts: 523
Last seen: 9 months, 30 days
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: natedawgnow]
#21838093 - 06/21/15 05:34 PM (8 years, 7 months ago) |
|
|
Yay! This exact thing has been on my mind for some time now. Thanks so much. +5
|
shroomfiend1936
Stranger

Registered: 02/05/15
Posts: 17
Last seen: 4 years, 11 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: RyeJar]
#21840228 - 06/22/15 12:50 AM (8 years, 7 months ago) |
|
|
Brilliant write-up.
I had (still have) the same humidity controller but gave up on it. Like you, my GH was constantly too dry or flooding. Nightmare. I bought a Sestos B2E short interval timer from Amazon and then, using a reliable analogue hygrometer, I noted the RH over a period of 12 hours. Finally dialled it in at 3'20" every 15'. RH is now rock solid at 96-99%, dropping a tiny bit every two hours when the air gets exchanged by a big fan.
I'm a much happier chap now. Those IC sensors don't seem to like being kept in 95-99% RH.
PS: My ultrasonic is very similar to yours. I keep it inside the GH but I've been wondering about piping it in. Do you find it works well? And did you write up your tek for connecting the hose? I'll search your post history.
|
shroomfiend1936
Stranger

Registered: 02/05/15
Posts: 17
Last seen: 4 years, 11 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: thoraxx]
#21840451 - 06/22/15 02:24 AM (8 years, 7 months ago) |
|
|
That's pretty much exactly what I've done, except I bought a short-cycle timer from Amazon. See my post further down. I'm so much happier now I'm not stressing over the RH and checking the fekkin GH every ten minutes...
The thing is, you see the digital hygrometer/switch and think "Ooh, science". The problem is the sensors aren't reliable in the tough conditions of a GH.
Short cycle timers FTW!
|
gray

Registered: 03/07/15
Posts: 127
|
|
Thanks guys for the many kind comments.
I have short cycle timers too, but for various reasons I couldn't get on with them. I do currently use timers for the fans.
I'll certainly keep an eye on sensor stability. Seems fine so far, but there's no test like running it for months, so we'll see.
Quote:
shroomfiend1936 said: My ultrasonic is very similar to yours. I keep it inside the GH but I've been wondering about piping it in. Do you find it works well? And did you write up your tek for connecting the hose? I'll search your post history.
I did reference it here. The black pipe you see in the photo is really all there is. Just a short bend from the humidifier directly into the greenhouse, right at the top. It's been working great, although I do need a small container inside the GH to catch the drips from the end of the inlet pipe.
|
YaMoonSun
The Double Standard


Registered: 10/23/14
Posts: 3,967
Loc: NY
Last seen: 5 months, 10 days
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21841271 - 06/22/15 10:57 AM (8 years, 7 months ago) |
|
|
 I love Raspberry Pi; Cool beans, man
|
gray

Registered: 03/07/15
Posts: 127
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: YaMoonSun]
#21842074 - 06/22/15 03:31 PM (8 years, 7 months ago) |
|
|
For those interested in general sensor stability of the AM2302, there's a pretty comprehensive study conducted over the course of 1 year right here.
Specific details of solid state relay are over here.
I should probably mention the software prevents the relay from switching more rapidly than once every 60 seconds. I had concerns that an edge case could trigger high frequency switching and kill my humidifier.
Edited by gray (06/22/15 03:41 PM)
|
shroomfiend1936
Stranger

Registered: 02/05/15
Posts: 17
Last seen: 4 years, 11 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21844123 - 06/22/15 11:44 PM (8 years, 7 months ago) |
|
|
Wow, ta v. much for that.
|
MycoRunner
Stranger


Registered: 09/23/09
Posts: 135
Last seen: 9 months, 11 days
|
|
I've been thinking about using my Pi for automation too, but until now I was too intimidated to try it. Can the raspberry pi switch the relay by itself from the GPIO? And what is the circuit on the relay's input? Nice work!
--------------------
|
36fuckin5
Alchemycologist


Registered: 08/11/03
Posts: 12,079
Loc: Diving into Mystical Territori...
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: MycoRunner]
#21846073 - 06/23/15 01:31 PM (8 years, 7 months ago) |
|
|
You don't want your RH that high all the time. Dropping to 70-80% once in a while is a good thing, as it lets evaporation happen, which starts pinning.
-------------------- Redd Foxx said: If you're offended I don't give a shit and don't come see me no more. Pat The Bunny said: A punk rock song won't ever change the world, but I can tell you about a couple that changed me. bodhisatta said: i recommend common sense and figuring it out. These are the TEKs I use. They're all as cheap and easy as possible, just like your mom.
|
the_other
Registered: 06/08/15
Posts: 6
Last seen: 8 years, 4 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: 36fuckin5]
#21846181 - 06/23/15 01:56 PM (8 years, 7 months ago) |
|
|
Quote:
36fuckin5 said: You don't want your RH that high all the time. Dropping to 70-80% once in a while is a good thing, as it lets evaporation happen, which starts pinning.
So would you only want this drop during the first week after starting fruiting and then a more consistently high RH? ...or it's beneficial to have these dips throughout the whole flush?
--------------------
Whatever we have words for, that we have already got beyond. - Nietzsche -
|
36fuckin5
Alchemycologist


Registered: 08/11/03
Posts: 12,079
Loc: Diving into Mystical Territori...
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: the_other]
#21846204 - 06/23/15 02:07 PM (8 years, 7 months ago) |
|
|
Through the whole flush.
-------------------- Redd Foxx said: If you're offended I don't give a shit and don't come see me no more. Pat The Bunny said: A punk rock song won't ever change the world, but I can tell you about a couple that changed me. bodhisatta said: i recommend common sense and figuring it out. These are the TEKs I use. They're all as cheap and easy as possible, just like your mom.
|
gray

Registered: 03/07/15
Posts: 127
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: 36fuckin5]
#21846318 - 06/23/15 02:49 PM (8 years, 7 months ago) |
|
|
Quote:
36fuckin5 said: You don't want your RH that high all the time. Dropping to 70-80% once in a while is a good thing, as it lets evaporation happen, which starts pinning.
Thanks. I'll add a humidity schedule so it's possible to specify humidity cycles, x minutes at y humidity, z minutes at t humidity, etc.
Edited by gray (06/23/15 03:28 PM)
|
gray

Registered: 03/07/15
Posts: 127
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: MycoRunner]
#21847023 - 06/23/15 06:12 PM (8 years, 7 months ago) |
|
|
Quote:
MycoRunner said: I've been thinking about using my Pi for automation too, but until now I was too intimidated to try it. Can the raspberry pi switch the relay by itself from the GPIO? And what is the circuit on the relay's input? Nice work!
No, at least not that particular relay. The GPIO output is 3.3V and that relay needs at least 4V to switch it. That is what that little circuit is, it's allowing a 3.3V output to switch a 5V line (off the PI) which in turn switches the relay. I'll post the details as soon as I get chance.
If you had a relay which was switchable via 3.3V that little circuit wouldn't be required.
|
Srirachi
Mold Hand



Registered: 10/18/05
Posts: 11,411
Loc: Fare Thee Well.
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21847577 - 06/23/15 08:16 PM (8 years, 7 months ago) |
|
|
|
eatyualive
Eat's You Alive :)



Registered: 08/17/01
Posts: 19,026
Loc: In Your Head
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#21847588 - 06/23/15 08:19 PM (8 years, 7 months ago) |
|
|
|
gray

Registered: 03/07/15
Posts: 127
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: Srirachi]
#21848660 - 06/24/15 01:00 AM (8 years, 7 months ago) |
|
|
Quote:
Srirachi said: I rebuilt a timer-based IR heat controller with a PID and SSRs recently and they were 3V "coil" http://www.ebay.com/itm/Solid-State-Relay-Module-SSR-25DA-25A-250V-3-32V-DC-Input-24-380VAC-Output-KN-/321625626679?pt=LH_DefaultDomain_0&hash=item4ae2619837
Ah, nice. I couldn't find cheap 3v solid state here in the UK. Perhaps I didn't look hard enough. :/ Those relays you have would be great for the Pi. Cheap too!
|
quetzel
Stranger

Registered: 07/17/16
Posts: 63
Last seen: 6 years, 7 months
|
Re: Raspberry Pi Controlled Mini Greenhouse [Re: gray]
#23630783 - 09/09/16 09:57 PM (7 years, 4 months ago) |
|
|
Did something similar with a raspberry. Unfortunately both my cheap ebay AM temperature/humidity sensors seemed to be shit and give temp but no humidity. I think they are defective. Their reputation doesn't seem to be very good. High humidity probably kills them fast too.
As an alternative I just brute force it with some crontabs. Run 400cfm fan every hour to douche chamber. Run humidifier and circulating fan afterwards and then twice more in an hour to keep humidity up. Fiddle with times, fiddle with humidifier settings.
Haven't killed the oysters yet.
Is your humidity sensor still working? Have you had to replace it? I'm starting to think that humidity is voodoo anyway and any measurement above 70% is suspect unless you paid $100 for the sensor.
I have light, circulating fan, venting fan, and humidifier all controlled by sainsmart 4 port relay. Wiring was pretty straight forward.
I have a circulating fan in the chamber, I run it when I'm venting and when I'm humidifying in the hope of stirring things up. Was running it all the time but bad things happened.


Bought the same 20A relay. Will use it for the heater when winter gets here. Also need one for the pasteurizer when I figure out how to make the steam generator.
On the raspberry pi scale of difficulty I rate this about a 2. Slightly harder than trivial. I'm just happy that I didn't have to do it with an arduino because I would still be working on it. As an added bonus I can play music with the pi while I'm working on the chamber .
Downside... I probably need to buy two of everything because if something blows up I'm fucked.
I expect to be eating oysters in a week. Once I'm sure I haven't created an oyster death machine I will pack the fucker with 240 pounds of straw and see what happens.
I have bigger hopes for the raspberry pi pasteurizer. It will measure temps of the substrate and steam chamber and eliminate all guesswork. Log in with the cell phone, start the cycle and go have a beer. Nothing left to do until it cools and gets unloaded.
|
|