From CSclasswiki
Jump to: navigation, search

Automated Terrarium [Groduino]

Project Goal

The ultimate goal of this project is to create a sealed-off environment that can be regulated by a microprocessor and interacted with by a human at a computer. The prototype created for this class will use sensors to regulate light, water, and temperature levels; it will automatically adjust the first as needed, and alert the user when the plant needs to be watered or placed in a cooler spot.



  • A light sensor to monitor how much light the plant gets.
    • Depending on how the light sensor is able to measure things, this may be able to keep track of how much sunlight the plant gets (and, using that input, adjust how long the plant light is on for), or it may simply be used to sense when the room is dark and the plant light should be turned on.
  • A temperature sensor to monitor the current temperature of the plant's environment.
  • A 'touch sensor' to monitor water levels.


  • A plant lightbulb connected by relay to the Arduino, which will be triggered either on or off.
  • A red LED that triggers on when the plant environment grows too warm.
  • Perhaps a way of emailing the user when the plant needs to be watered; else a blue LED.


  • Maybe it could check the weather somehow and determine (ie: if it is currently raining, or cloudy, etc) whether or not the light should be turned on.
    • Most plants prefer at least 5 to 6 hours of sunlight a day.
  • Alert the user when the plant needs to be watered.
    • It will alert the user when soil moisture falls beneath acceptable levels, and again when it reaches critical levels; it might be able to tell when the user is/has just watered it and will then thank the user; if soil moisture is above acceptable levels, it will complain about overwatering.
  • Flash the red LED when it needs to be moved to a warmer spot.
    • Plants thrive best in temperatures of 65 to 75 degrees F.
  • I will have a better idea what's expected here once I figure out how Arduino interfaces with Assembly.


  • Basic relay schematic.


Referenced from Arduino Playground Rougher schematic of light-switch circuit

  • Light-sensing schematic.


Referenced from Squidbee

  • Moisture-sensing circuit schematic.


Referenced from KisdSpaces

Hardware Circuits List

Light Relay


  • Lamp (I already have one)
  • Extension cord
  • 5V Relay
  • IN4004 Diode
  • 2N22222 Transistor
  • 1K Resistor

Using an extension cord cut in half and a 5 volt relay, it is possible to solder the relay to the extension cord, which ultimately plugs a lamp into the wall. By providing this relay with a small amount of voltage (using the transistor as a switch and powering it with Arduino's 5V output, protecting it against back EMF current with the diode), the relay is switched on and the lightbulb is allowed to be powered.

Moisture Sensor

  • Two galvanized nails
  • 2N3904 transistor
  • 100 Ohm resistor
  • 10K Ohm resistor

Using the nails as probes (soldering them to wires beforehand), it is possible to measure the amount of water in the soil of a plant. Wire them to the transistor through the resistors, and connect them to the Arduino pin 0 and through the power bus... When the soil is wet the water is connecting the two probes closing the circuit and electricity is going through creating the signal for the controller.

Approximate Cost


5V Relay: <$2.00 [1]
Small Signal Transistor: <$1.00 [2]
Light sensor: <$1.00 (these come in packs -- can split with someone?)
Temperature sensor: $1.20 [3]
Red LED: $1.40 [4]
IN4004 Diode: ~$1.00 [5]
2N22222 Transistor: $2.59 for a 15-pack [6]
Extension cord: ~$2.00 [7]

Total: ~$11.00
Not including shipping.


Plant: Free?
Light bulb: ~$3.00, depending on the bulb

I do not actually own a plant this could be tested on (mine all died because I kept forgetting to water them, of course.) My plan is to contact the Smith Botanic Gardens and see if perhaps they have any leftover First Year Ivies I could have -- they have been more than willing to work with groups and other departments in the past. I will also ask them what they recommend for the terrarium and what sort of light bulb and supplies I should invest in for a successful project, and I suspect any leftover money in my budget will be spent on this.


Terrarium Resources

Tutorial -- Temperature Sensor and Arduino
Tutorial -- Using Arduino and Relays to turn on a Light Bulb
Tutorial -- LDR Light Sensor
Tutorial -- Plants and moisture sensors