LCC code

I haven’t published my code for this project yet. Mainly because it’s dangerous and not totally tested. Here’s what I mean:

This software controls the environment of a living thing. Failure of the software can cause death. I’m not ok with that. For example- last night I  had an over heat condition. Because of a badly written IF statement, the corrective actions never executed. Thankfully I was home!

I am in the process of re-writing the code to simplify the corrective actions and to provide more debug information.  Arduino doesn’t provide ANY error trapping/reporting so testing has been more difficult than I’d prefer.

I hope to have a viable and tested code base to publish this weekend.

I just hope my lizard doesn’t mind the flashing lights while I’m testing…. 😉

 

LCC Breadboard Visual

Below is the breadboard circuit diagram. It’s pretty final. I hope to clean it up a bit when the project is final.

The major additions in this rev is that I’m using transistors against the Arduino digital outs to control the AC relays and a corresponding LED indicator.  The on/off switches in those circuits provide a bypass to turn on the AC switches if necessary.

Real Time Clock

For the LCC project I had to add a real time clock (RTC) so that it could manage the light schedule independently of a PC. I added a fairly generic RTC shield. I could have used this one or this one. They both use the I2C bus and the DS1307 RTC chip.

The example from LadyAda didn’t allow me to manipulate the date/time components well enough so I went with a library that pulls the date/time in BCD format.  The issue was that I needed those preceding zeros on numbers less than 10. 8:8:8 is not as easy to read as 08:08:08 to me. The library I used allowed me to prepend the zero when necessary.

The library is from the Arduino Playground and also has lots of time related functions that work with any DS1307 chip.

 

 

LCC Requirements

The Lizard Climate Control system has these requirements (updated as they change):

  • turn lights and heaters on/off at specified times
  • maintain specified temperatures during day and night
  • report current temperature/humidity both locally (at cage) and remotely via internet
  • manual bypass of Arduino control of AC switches
  • built in fail-safe for over temperature situations
  • protect sensors from lizard and other in-cage hazards
  • visual indication of temperature situation (green=good, red=bad etc)
  • document it!

 

Lizard Climate Control

The background for the project is simple, the mission- not necessarily so.

New Baby Bearded Dragon. Gotta have heat and light, on a schedule and deal with over/under heating conditions. I could fork over $60+ for a ready to go solution or I could make my own.

Guess which I went for? Arduino to the rescue!

Keep watching for pics, code and schematics as I build it. Basic requirements are here.

Bearded Dragon Collage