# High Tech Raspberry PI / tablet controlled terrarium



## corbosman (Jul 8, 2012)

I have been a member of this board since 2012, when I first wanted to build a terrarium. I never did, because I simply couldnt find the time. Finally, this year I decided to just have one made instead. I contracted Dutch-Rana, a dutch builder, to build me a 48x24x42 (120x60x110) rectangular terrarium focussed on orchids. It will eventually house Panamanian dart frogs, since my wife grew up in Panama and would love some of those frogs in there. 

I wanted to build a high-tech terrarium, so I opted to do most of the technical system myself with a lot of help from my brother, an electrician. Together we designed an industrial style electrical/computer setup that can run the terrarium in two different modes, either controlled by a Raspberry PI, or by a set of timers. Each device can individually switch mode. 

A benefit of this setup is that it's very clean and compact. If I need to do any work on the Raspberry PI, I can easily switch everything to the timers and things will just continue running. The software I use to run the system and drive the tablet interface is Node-Red. 

The terrarium has 4 T5 bulbs, 2 Solar Raptor HID lamps, a moon light led strip, 5 mist heads, several fans, an aquarium heater, a small aquarium pump for a little water stream, and an automated led strip inside the cabinet. All of these can be controlled using a tablet. 

The cabinet was custom made out of oak by a separate company according to my specs. 

Some pics of the system.


----------



## corbosman (Jul 8, 2012)

I thought it would be nice to explain the different parts of the control system.



From top to bottom/left to right:

1. The driver for the cabinet leds. These are ikea cabinet leds that automatically turn on/off as the cabinet doors are opened. 

2. These set of switches decide what controls each device. Up means Raspberry PI, down is one of the timers.

3. This is the Raspberry PI in a DIN-rail case.

4. Electrical relay switches. The Raspberry PI controls these to turn on/off each electrical component.

5. 5V power supply.

6. Industrial Timers. 

7. Relay Timer. The regular timers can only switch per minute at the lowest. But for the misters I need seconds. This relay timer takes an input change from one of the regular timers, and after a set amount of seconds drops back to off regardless of the input voltage. It is used for both the timer and raspberry pi outputs to make sure the mister is never on for more than a set amount of seconds.

8. This is where the outside power comes in and is distributed. 

9. 24V power supply for the mister pump.


----------



## Art93 (Mar 19, 2017)

Wow This is one awesome setup! Wish I were smart enough to have it electronically setup like this too.


----------



## Kalle (May 14, 2010)

Very nice and clean! 

I'm curious about the RPI controller, have you incorporated any sensory conditional controls? Like for temp/humidity etc. My head is full of early concept ideas but haven't yet realized any or written any code for them. So it would be nice to hear how you're controller is setup. 

What I mean is, does it respond to what your sensors is returning? For example, If humidity is below XX --> mist for 10sec, if temp is above XX --> mist for 10 sec + put fans on high.


----------



## Luckyfroggie (Apr 4, 2017)

Love the well organization of components! So clean.


----------



## mwallrath (Mar 8, 2013)

Wow, i mean really what else can you say but WOW.


----------



## hp192 (Feb 28, 2016)

Beautiful job. You've definitely set the bar pretty high for the rest of us. Any plans to add inhabitants?


----------



## corbosman (Jul 8, 2012)

Hi all, sorry I didnt respond earlier. For some reason I didnt get notifications about responses until today, even though they're over a week old.

@Kalle, I can only tell you about my own ideas about this. That doesnt mean they apply to you. Everyone needs to make their own decisions. My own personal view is that taking decisions based on sensors in an environment with live animals is asking for trouble. The sensors people generally work with can and do fail, and that could potentially lead to disaster. So I dont take automated decisions like misting based on sensor data. I only detect and notifiy. If temperature or humidity goes outside certain range, I send myself notifications on my iphone and email using IFTTT. I even went a step further and added the mechanical switch failsafe that would always limit the misters to max 20s no matter what the RPI says. 

It would be trivial to add though, if you wanted to. I use node-red (https://nodered.org/) to orchestrate the software/hardware and controlling devices like misters or fans would be super easy. 

@hp192 I am absolutely planning inhabitants. We're thinking maybe a few Auratus bocas and Oophaga pumilio, but any advice is welcome. It's our first terrarium.


----------



## Kalle (May 14, 2010)

corbosman said:


> Hi all, sorry I didnt respond earlier. For some reason I didnt get notifications about responses until today, even though they're over a week old.
> 
> @Kalle, I can only tell you about my own ideas about this. That doesnt mean they apply to you. Everyone needs to make their own decisions. My own personal view is that taking decisions based on sensors in an environment with live animals is asking for trouble. The sensors people generally work with can and do fail, and that could potentially lead to disaster. So I dont take automated decisions like misting based on sensor data. I only detect and notifiy. If temperature or humidity goes outside certain range, I send myself notifications on my iphone and email using IFTTT. I even went a step further and added the mechanical switch failsafe that would always limit the misters to max 20s no matter what the RPI says.
> 
> ...


I understand your concerns and definitely see your point. The more I dive into this project I realise that I want to keep it as simple and robust as possible with redundancy built into it. I might split everything up on different controllers (misting/fogger, lighting, and pure monitoring) just so that if one thing goes not everything goes at once. 

Thanks for the feedback!


----------



## corbosman (Jul 8, 2012)

Most of the devices are relatively harmless, I only worry about the mister and the heater. The terrarium builder probably thought I was nuts but I dont trust these cheap aquarium heaters at all. I come from aquariums and they fail all the time, including in permanent on state. 

I also anticipated having to work on the RPI (it's only a computer after all) leaving the terrarium uncontrolled. That's why I added the fallback to timers. Now if I need to work on the software or whatever I just flip a few switches and everything runs from the timers. 

Of course, with all that technology, I still hand mist it twice a day


----------



## chulainnledsom (Mar 28, 2017)

No that's a tank! Love the idea of integrating tech with nature!


----------



## Toekie (Nov 11, 2018)

Hello, 

I am working on a similar system based on arduino and (for now) without app/wifi control. But I love the idea of a proper emergency backup functie of the DINclocks, What switches are those? Simple breakout ones?
Fantastic project, by far the best one yet going on fuinctionality and how well thought of the complete system is!

Sincere, 
T.


----------



## corbosman (Jul 8, 2012)

Unfortunately these specific dinrail timers are not cheap. You can probably find much cheaper ones. I happened to be able to get them cheap when a company unloaded a bunch locally. Whatever works as a backup for you, you could even use another arduino or rpi. The manual switches select which input is used to control everything, either the timers or the rpi in my case. But you could also switch between arduino 1 and arduino 2.

Im really glad i have them. Ive already had 2 failures of the RPI (caused by cheap SD cards, i switched to USB now). If I wouldnt have had this backup i would have had to hurry to fix it. Now I could just fix it whenever.


----------



## shackers (Nov 29, 2020)

Hi @corbosman , I know this is a few years old now, however I wondered how this was going? Have you found any issues with it etc? I don't suppose you have your node-red flow that you would mind sharing at all?


----------



## corbosman (Jul 8, 2012)

Still going strong. I haven't had any RPI issues since I switched to USB. I did change my dashboard from Node Red to Home Assistant. This also means I can more easily control it using Alexa. The actual control is still done using Node Red. The flows are kind of big, but feel free to msg me your email address and I can send it over. 

Picture of my current dashboard. But full disclosure I actually rarely use it. It's so much easier to use Alexa


----------



## scrumpydc (Mar 9, 2015)

XD i was just looking at that home assistant for mine I have had mine running for over 2 years now and looking to make a better version of it something that would be easy for others to replicate if you fancy helping just pm me


----------

