Introduction: Arduino Controlled Terrarium

Hi everyone, this is my first attempt to actually create something useful using an Arduino board. My first thought was an automatic terrarium control for my ball python so wish me luck...hopefully it won't burn down :)

WARNING: We are going to work with high voltage so be careful! Everything is on your own risk.

Requirements:



• Temperature measurement
• Humidity measurement
• Room temperature measurement
• Room humidity measurement
• Temperature control
• Light control (timer)
• Fan/Humidity control (in the future)
• Displaying all the values on LCD


I have some basic programming /engineering skills so I'm probably going to find out few things during the process I should do differently, but for now...

List of parts:



• Arduino NANO $2,30
• 4-Channel Relay $3
• DHT22/AM2302 Sensor $3,10
• DS3231 RTC Modul $1,00
• 1.8" TFT LCD Display $3,80
• 5V power adapter $1,00 (any mobile charger should do)
• 3x Power Socket ABB 5525N-C02347 $7,00
• Light DPDT On-Off Snap in Switch $1,50
• 2x Male + female 3,5mm jack connectors (for DHT22 sensors) ~$4
• Wires
• Box (when all parts arrive I will decide if the box/case will be 3D printed or bought somewhere). At the moment I have two designs in mind, we'll see which one is going to be used.


Step 1: Connecting the Components

This connection is simplified, the actual connection will probably use small breadboard and separate power to single components.

DS3231 RTC -> Arduino

GND -> GND
VCC -> 5V
SDA -> A4
SCL -> A5
SQW -> (not used)
32K -> (not used)

LCD -> Arduino

LED -> 3V3
CSK -> D13
SDA -> D11
AO -> D9
RESET -> D8
CS -> D10
GND -> GND
VCC -> 5V

DHT22 -> Arduino (terrarium)

VCC -> 5V
Data -> D2
NC -> (not used)
GND -> GND

DHT22 -> Arduino (room)

VCC -> 5V
Data -> D3
NC -> (not used)
GND -> GND

Relay board -> Arduino

GND -> GND
IN1 -> D4
IN2 -> D5
IN3 -> D6
IN4 -> D7
VCC -> 5V

Arduino -> Power

VIN -> +5V
GND -> -5V

Step 2: Let's Start the Program...

At first I want to make sure that the temperature and humidity values coming from DHT22 sensors are correct and the code is able to control relays. So let's connect sensors and relay board to Arduino and upload the code.

I'm still waiting for some components to arrive. Once I have them, the instructable will continue...

Step 3:

Update:

I was really looking forward to create this device and I got almost everything working but then I got my hands on NodeMcu Lua 12e which was more suitable for this project (using a webserver). It was much easier than using ardunio; all I needed was the board and relay, no need for display or RTC module. I will post link to this instructable once it is done.

Update II:

Here is the promised link. Creating the TerraControl was really fun job! I have got many more ideas how to improve it so as I see it, it will be continuous Instructable. Enjoy and please share it with other!

https://www.instructables.com/id/TerraControl-V10-W...

Comments

author
GuyS31 (author)2017-08-30

will modifi it at too zones night day cyclus eaven add season cycles

evry help welcomm

author
cordax (author)2016-10-31

I assembled the LCD screen, Arduino, and one DHT22 to test and screen comes on shows graphics that's its suppose to for a second then goes all white. If I reset I get the same thing. Any suggesting on what might be going on? If I apply a different code to test the LCD, it works fine so I know the LCD screen is good. Any help would be greatly appreciated.

author
tomaskuchler (author)cordax2016-10-31

Are you using my code or modified? If modified, can you sent it? I discontinued this project because of NodeMcu but I can try and take a look.

author
cordax (author)tomaskuchler2016-11-01

Hello thanks for the reply, it was me I mistakenly set a pin as the same pin that one of the relay was using. Up and working with temp sensor. Now I just need to assemble the rest of the parts and test again. Thanks so much for sharing.

author
tomaskuchler (author)cordax2016-11-02

Hi, I'm glad to hear the problem is solved! Good luck and when you finish the project, please share! :)

author
tibun1 (author)2016-05-26

Hi, your project is very interesting.

But I d'ont understand your code, how do you do for pinting in the LCD?

Thanks

author
tomaskuchler (author)tibun12016-05-26

Hi, the first version was only draft without LCD printing. I have added
version 1.1 where the LCD printing works. But it is still in progress so
the code is quite messy...sorry about that. Also, I'm not sure if I use
the same pins as in version 1, so mind the definitions. I'm now working
on 3d print and circuit board (sort of...), I expect big update in 1-2
weeks.

author
tibun1 (author)tomaskuchler2016-05-27

thanks for your reply,

I updated your code with light et water control but i search the code for TFT LCD.

I found a code for a LCD but it isn't fun, i prefere a TFT.

If you have just a code for TFT, I take!

many thanks

author
tomaskuchler (author)tibun12016-05-27

Unfortunately I don't have any TFT to try this with and LCD is more fun for me :) If you study some basic examples for LCD you will get the idea pretty quickly...good luck!

author
ThomasK19 (author)2016-04-05

I had a quick look at your code. You should add some hysteresis. Else you might encounter fast switching on/off for fan/heat etc.

As a side note: if else cascades must not be indented but with the same indentation. They are a different form of a case statement.

author
ThomasK19 (author)ThomasK192016-04-05

If you are using a Mac try CMD-T to get good indentation. On a PC it's probably Ctrl-T (just at a guess).

author
tomaskuchler (author)ThomasK192016-04-05

Thanks for the advice! Code is just a quick draft but I would not think of hysteresis at all... Can I contact you if I ran into some problems with the code?

author
ThomasK19 (author)tomaskuchler2016-04-06

Sure you can :-)

author
WimD16 (author)2016-04-04

Please keep me posted on the code! This looks like what I'm planning to do with my aquarium: controlling the lights (by RTC) and measuring & controlling the temperature.

author
wold630 (author)2016-04-04

Did it burn down? :)

author
tomaskuchler (author)wold6302016-04-04

I'm still on theoretical level so not yet :)

About This Instructable

5,075views

17favorites

License:

More by tomaskuchler:TerraControl - With NodeMCU WebserverSelf-learning IR remote controlled switchPaper windmills
Add instructable to: