OK - here goes...
- Raspberry Pi revision B
- Raspbian OS (latest - i keep this updated)
- 8Gb SD card
- USB wifi dongle
- ads1115 i2c 4-channel ADC (for temperature probes)
- 2 Adafruit thermistors (water and filter temp)
- 2 Jeelabs relay boards for controlling ORP valve, lights x 2
- Adafruit 16x2 I2C LCD backpack with 5 buttons
- Aquamedic ORP probe (in NR Blue nitrate reactor)
- Atlas Scientific ORP board (serial interface)
- "wiringPi" library to handle the I/O on the Pi
- Apache to run the web server
- PHP and HTML for the web pages
- MySQL 5.5 for the database to hold control data and measurements
- pchart for charting the data
- libesmtp for sending emails
- various miscellaneous code I've found and adapted to read the ADC, talk to the serial port, LCD, etc.
I've written the control code in C since that's the language I'm most comfortable with (but rusty
), and I'm using PHP for the web pages. There is a bunch of Python code for the Pi but that language gives me the creeps, so I've stayed away
.
I've currently got a control loop that runs every 5 seconds, reads the inputs, checks for exceeded limits, and implements the control algorithm for the filter. It averages the readings over 10 minutes and records the data in the database. This loop also re-reads the control info (ORP setpoints, loop times, min/max alarms, etc) from the database every 10 minutes. If limits are exceeded, it sends me an email (but not more than once per hour per condition).
There are curently 3 sets of web pages:
- one to allow me to specify a charting interval (last N hours or start/stop date/time) and then shows a chart with the temperature, valve on/off data, and ORP level over time.
- one to allow me to update any of the control parameters
- one to allow me to turn off/on either of the two sets of lights (these are otherwise on a schedule using the Linux "cron" facility) .
I have a Mac and installed an AFP file service on the Pi so i can attach the Pi's file system to my Mac, and I use the Mac's XCode environment to edit. Then i SSH into the Pi to compile and run.
That pretty much covers it...
I just got the LCD going so I'll integrate that shortly to display the current metrics. There are some buttons on it as well but I'm not sure what I'll use them for yet
. I'm sure I'll think of something...
Right now everything is on a big breadboard sitting under my aquarium - at some point I'll solder everything to a more permanent board.
Oh - the aquarium has 7 4" Discus, some dwarf Plecos, 9 Nerite snails, a few Amano shrimp, and is planted. This whole project is a result of my desire to minimize water changes by using the Nitrate reactor. I don't want to start a flame war here about that, so lets just leave it at that. But I needed a system to control the flow into the Nitrate reactor based on the ORP level within, and commercial units cost about $500 by the time you are done with the controller, pump, valves, etc. Thus the DIY effort... plus my wife said I needed a hobby.
regards
Don