Terrarium Controller

Introduction

Reptile terrariums (in this case, specifically, a frog terrarium) require a good deal of monitoring. One must turn the light on in the morning, off at night, spray water to keep the humidity up, and turn a heating pad on and off. Therefore, it seemed not a bad idea to automate it.

/media/uploads/chinson3/_scaled_img_0104.jpg

Project

The requirements for this project are as follows:

  • Accurate clock
  • Control of terrarium light
  • Control humidity
  • React to change in temperature and humidity
  • Send e-mail notifications for different events
  • Display temperature and humidity on LCD at tank
  • Allow user to change parameters

These requirements were accomplished with several different parts and libraries:

  • SHT15 Temperature and Humidity Sensor
  • LCD Breakout board from Sparkfun
  • Potentiometer, buttons, and resistors
  • Ethernet breakout from Sparkfun
  • Powerswitch Tail
  • Windshield washer pump from a car (and relay to control it)
  • Libraries: SHTx/SHT15, EthernetNetIf, NTPClient, SMTPClient, TextLCD

Schematic

/media/uploads/chinson3/final4180-1.png

/media/uploads/chinson3/temp.jpg

Basic Function

The terrarium controller uses I2C to talk to the temperature and humidity sensor, displays data on the LCD using the textLCD library, uses Ethernet for time and smtp, and then toggles relays for the Powerswitch tail and pump. A very high level overview of how it works is as follows:

Initialization:

  • Connect to internet
  • Get time from NTP server

Loop Routine:

  • Check temperature and humidity
  • Display time, temp, and humidity on LCD
  • If humidity too low -> spray windshield washer pump for five seconds (wait 5 minutes before spraying again)
  • If Light on time or Light off time, turn light on or off, respectively
  • If 12pm, send e-mail over SMTP with current temperature and humidity
  • Check for button presses to display time/humidity setting interface

Ethernet - NTP/SMTP

An important, and difficult, component was the ethernet. This was extremely important as the NTP Client provided an accurate clock that is used to turn the light on and off (and the user doesn't need to set it, which is also a plus). This also allowed us to use the SMTP Client library to send an e-mail through a hostgator server. We found that, for some reason, gmail addresses reject e-mails from the SMTP library because of a small formatting issue, but our gatech e-mail addresses worked fine. After sorting out that issue, and some authentication problems, all of the internet connected features were good to go.

Car Windshield Sprayer

The car sprayer was a little bit difficult to interface with. We found that, for decent operation, it needed a 12v supply that could provide at least 3A. After adding a relay to the circuit for control it worked pretty well. A permanent solution is required, as it is currently running off of a lab power supply (as can be seen in the video below). We may also needed to find a finer mist nozzle to force a finer spray out of it.

Video

Below is a video of it in action that gives a better idea of how it works:

Code

Import programTerrariumController

Terrarium Controller code


Please log in to post comments.