aquarium project – 2010-04-04
Things are getting serious.
So just a quick synopsis of the current situation as I’ve been lazy with updates lately. I gave up trying to source a nice thermostat to control my cooling fans. The problem was all line voltage thermostats are for triggering heaters, not cooling systems. Cooling thermostats were typically using a 24v system, and were getting up close to 200$ in cost. Although from the specifications it was unclear weather or not I could create a small buffer to avoid rapidly switching on and off the fans if the temperature was hovering around the switching point. So started exploring the second option, which was to utilize my ambiguous mini computer that had been doing nothing for far too long.
Originally I had hoped to use the mini computer for an in-car setup, but that concept was having a hard time getting any traction at this time. In order to get the mini computer to jive, I had to source out some sensor and control kits. After a few days of intense googling; came across phidgets.com and ordered a temperature sensor, the usb interface board, and a relay module to toggle a pair of wall outlets. With all the hardware in hand, I can now fully mockup how I’d like the electronics to sit and deal with all the necessary remaining holes, welding tabs, and visits to Home Depot for any fastening type pieces. One of the big pluses of using the mini computer, is that adding a webcam in the future should be no big thing ;)
So part of the purpose of this post is to layout my intentions in a clear way and to refer to peoples as I solicit for help on a few matters. My first contention is the operating system. I’m a freebsd guy, but this mini computer does nothing but kernel panic, sad times. I’ve tried installing gentoo on it, however even a x-less gentoo install is needlessly large, and takes forever to bootup ( sorry gentoo guys ). For the record my mini-computer is running with 1gb RAM and an 8GB compact flash card as its hard drive. My wishful criteria for a candidate operating system would have to accomidate :
- Fast bootup, low idle overhead
- Allow for remote terminal via sshd
- Allow for logging of the phidgets sensor data
- Provide a lightweight httpd to allow access of webcam feed, and graphs for phidgets sensor data logs
- Run a custom implementation of the phidgets control software ( see below )
The second issue will be dealing with the software to control the phidgets hardware. They have documentation and API’s available for various languages, the two candidates would be C/C++ and Python. At this point I’m thinking a C variant program running as a daemon with a simple config file would be ideal. However it is one I’d need to rely on someone else to write for me, although I could probably learn it quick enough. The Python option looks like something I could jump into again. A simple script that would run every 5 minutes scheduled via Cron for instance. However this just isn’t as elegant as the C route; I won’t claim to understand Python at this time, however loading up the Python runtime every 5 minutes to read a temperature sensor and toggle a relay just seems a bit overkill. Anyways for the sake of having it on here, my imagined config file would probably look something like:
# aquarium pc control file
# /usr/local/etc/tank_control
#
# relay1 is used to toggle cooling fans
# relay2 is used to toggle lighting
port_temp_sensor = 1
port_temp_relay_sensor = 2
port_temp_relay_control = 2
port_lighting_relay_senor = 3
port_lighting_relay_control = 3
temp_sensor_onTemp = 25
temp_sensor_offTemp = 23
lighting_onTime = 0700
lighting_offTime = 2100
temp_sensor_log = /var/log/tank_temp.log
temp_sensor_log_interval = 5
The phidgets interface has a few I/O ports on it, which might allow me to add various environmental sensor to measure things like water pH and CO2 levels, but for now, temperature is good enough. Hopefully this post should give a better idea what my intentions / wishes are at the present regarding the software. Any help with this will be greatly appreciated, rest assured you will be shamelessly immortalized in this blog series :)
Meantime I will continue to mockup, measure, and mount all the hardware. More pictures should be coming soon in the next couple days, getting closer !

Leave a Reply