If you are a reptile owner like myself you should already know that your little friends have very special needs. Be it a certain temperature which they would appreciate in their natural habitat or special humidity settings. You also need to make sure that they have the correct lighting and most importantly that you don't forget to feed your companions.
With most other pets you wouldn't have a hard time keeping track of everything as they would remind you in an audible way. Reptiles on the other hand tend to suffer quietly. This is a big problem as there are a lot of inexperienced reptile holders out there which are overchallenged with their reptiles special needs. Too often this results in reptiles being released into the wild, putting them into animal shelters or in the worst case them dying silently. To give my chameleons a voice to be heard I decided to hook up their terrarium with some sensors and tweet certain events via twitter to be always up to date when my reptile friends need some extra attention.
With this instructable you will be able to be notified via twitter when the humidity or temperature reaches a defined threshold, when the light is turned on/off and when someone opens/closes the terrarium doors. It is important that the humidity and temperature values are in a range which conforms to the natural habitat of your reptile. So when a threshold is reached you will get notified to take action like sprinkling some water on the terrarium plants to increase the humidity and lower the temperature. Reptiles have also special needs when it comes to light settings. They need spotlights to heat up an area for sunbathing and regulating their body temperature. They also need special UV lights to enable molting and to harden their bones since they lack calcium in captivity. With the twitter monitoring you can keep track of the on/off cycles of your lights, if they are broken or even if they decay slowly in their intensity. It might also be helpful to monitor when the terrarium doors have been opened or closed to make sure that they can't wander around in your home. You could also be reminded that you haven't fed them yet if the doors were closed the whole day.
After this long but neccessary introduction it is time to get to work.
Step 1: Prerequisites
- Arduino Uno
- WiFly shield
- Arduino stackable header kit (needed for the WiFly shield)
- SHT15 Humidity and Temperature Sensor
- Tilt Switch
- 10kΩ resistor
Step 2: Assembling the WiFly Shield / Ethernet Shield and Arduino
Step 3: Building the Door Sensor
Connect one wire to a digital port (I used D5 ) of the Arduino and the other one to GND .
Congratulations you already finished the door sensor.
Step 4: Building the Light Sensor
Solder some wires to your photoresistor and again make sure that they are long enough as they have to reach from your Arduino to your lighting setup. Then connect the photoresistor to +3.3V and an analog port of your Arduino (I used port A0 ). Connect the 10kΩ resistor to the same analog port and to GND . This is how it should look when you connected everything.
Congratulations you finished the light sensor.
Step 5: Building the Humidity and Temperature Sensor
Step 6: Sources and Communication With the Desktop Computer
You can download the example desktop application from github. Once downloaded you can run the code from a console. Make sure that you have Java installed on your machine and navigate to the download folder. Change into the executable_jar folder and edit the twitter4j.properties file. You have to insert the credentials for your own Twitter account. Afterwards run the application from the console by typing:
javac -jar TwitterTerrariumConnector.jar
Now the desktop machine will listen for incoming data.
The Arduino code is pretty simple too. The most complex part is getting the values from the SHT15 humidity and temperature board. The rest is a piece of cake. The Arduino code can also be found on github.
You will have to change some settings in this code to let the WiFly shield connect to your home network. The lines are documented in the setup routine.
After you have uploaded the code to your Arduino the WiFly shield will connect to your home network and starts to poll the sensors for their values. If one of your configured thresholds is reached or an event is triggered, the Arduino will send the corresponding event in form of a byte to the IP-address of your desktop computer. The desktop computer receives and evaluates the event and posts the corresponding message to Twitter.
Step 7: Final Step: Position the Sensors and Let the Monitoring Begin
Humidity and Temperature Monitoring:
Have fun with this instructable and vote for me in the Adafruit / Instructables Make It Tweet Contest.