OK, while I was still waiting on the tank to arrive, and after I got the feeding timer completed, I was still bored. On ReefCentral Forums, there has been an ongoing project to develop a DIY aquarium controller similar to an Aqualogic. That is one that will monitor several tank parameters, temp, pH, ORP, etc... and also control timers and relays to start/stop lights, pumps etc. There is a seperate forum within the DIY forum with the entire thread of posts about this. Well, the most recent progress seems to have been made by "Banger" with the posting of schematics for an Atmel controlled project. The only problem was that there was no software for the device, as well as the fact that the Atmel microcontroller used is a 64 QFP chip. This is a nice chip, but for the average DIYer, a surface mount chip with leads spaced 0.05mm apart is, well, IMPOSSIBLE to solder themselves. OK, OK, not impossible...I have done it..but I wanted to make a true DIY controller that anybody can download the board files, etch their own board, and then download software and fire the thing up! So with some encouragement from Mbelding on the forums, I set off to design my own. Here I will chronical the trials and tribulations of working with this idea from the ground up.
OK, First, I decided to use an Atmega16-16. This chip has 10 A/D converters, a built in ocillator, 16k of program memory, 1k of RAM, and 512 of eprom. I believe it will be more than enough for the project, and hey, it costs $5. It is also a 40 pin standard DIP chip...I.E. normal through hole type stuff... i.e. easy to solder. Anyway, after deciding on the main microcontroller, the next problem is deciding on the interface. I want to keep it inexpensive, and easy. I decided on an Optrex 2x16 LCD. That is two lines with 16 charachters each. It is NOT an SVGA with an Nvidia video card, but it is completely similar to the aqualogic controller, and they are pros :). Well, Banger's design uses 10 pins on the processor. While this may be fine for a chip that has 64 pins, for our more modest processor using 10 pins for the display would severely limit its abilities. The LCD is a parallel interface requiring 14 pins...6 for power and control stuff, and 8 for a data bus. Hmm...how do we use only a couple pins on our 40 pin chip to control 14? Well...just like I alluded to earlier, the answer is a "video card" and no, I am not talking about one like you have in your pc. What I made is a small (very) interface that uses ANOTHER microcontroller to drive the LCD's 14 pins, and takes in SERIAL input from one pin of our main microcontroller and turns it into the 14 pin signals needed for the LCD.
The entire design is based on the works of two people on the internet: Scott Edward's Electronics Serial Backpack Here, and Tom Coonan's LCD Serializer Here. Full credit is given to these Gentlemen for both the design ideas as well as Tom Coonan's code for driving the 16c54. The device is explained in detail on those pages above. Basically I tweaked a few things on the design, and added some custom initialization information. The board uses a 16c54 PIC microcontroller to take the serial input and drive the LCD.The 16c54 is $3 so we are up to ~$8 so far...heh
Here is a shot of the schematic I made from their designs using EAGLE...see the home page for a link it's FREE! I have also placed a zip file of all the eagle files, a parts list, and a HEX file for loading onto a 16c54 chip for those so inclined.
Here is a shot of the completed prototype. Astute readers will notice the fact that this board has a diode on it, and a 2x7 14 pin header and the schematic does not. As I said, it is a prototype :), The diode was to prevent negative current from a PC RS232 port during testing, it is not needed in a microcontroller to microcontroller serial communication (heck I found out it is not needed for the rs232 from the PC either, and actually prevents communication). The 2 x 7 pin header was for a poor Luminex LCD that gave its short life for the project. The final board is made for the optrex pinout.
The ever-present Code Red can is for scale...It's small. The other thing you may notice is that this chip has a sticker on top. The chip I used for prototyping was a 16c54c /jw. All that means is instead of being OTP (one time programmable or NOT eraseable) it is an EPROM chip so I could erase the code and reprogram as needed during testing. The final board uses a chip that is a one shot deal...you program it and it can't be changed...hence the eprom one...and why there are erasers on pencils.