I got all excited about this automation thing, and since I'm currently out of the country with only one brew going (see Pilsung Porter in my signature), I've been itching to get my hands on a brew project. So, I scratched together some Java code like I said I might. Here's two screenshots of my very early test application:
On the left, the program is basically just lying in wait for user interaction and displaying the actual mash temperature (at 60 degrees). On the right, a mash temp of 155 is selected, and the software is automatically turning the mash heat on and off. With the automation turned off, the user has the option to turn the heat on and off with the toggle button. The "Delta" is the temperature differential below the target temp at which the heat will kick back on.
All of the logic for this portion of the program is finished, though I think I will convert it from integer temperature variables to floating point variables for more accuracy. Because Java so elegantly (or easily...) supports threads, almost every user action spawns or kills a thread. Sensor input is currently emulated by very simple inc/dec threads, but the intent is to have a SerialPoll class that, when created and an instance of "run" is spawned, it will continuously update a "value" field with a sensor reading (at some interval equal to or less than one second).
Additional panels for temperature control will be easy to add at this point (for control of a steam vessel, HLT, etc). A HERMS system is just as easily controlled via an almost identical scheme...just turn the recirculating pump on instead of a heating element when the mash is too cold. Additional controls for pumps, valves, and burners (with appropriate safety plumbing/shutoffs) are as simple as adding buttons and creating a "SerialSwitch" class that will control relays and/or low power DC switches. With a liquid level sensor (perhaps as simple as a float and potentiometer) and a stepper motor controlling a valve, I think it's possible to automate fly sparging, also (in lieu of expensive flow sensors as I alluded to previously).
I'd post the source code, but it's a bit cumbersome, and this post is already a bit long...
I'll probably fiddle with the code and GUI a bit more until I can get a hold of an Arduino board and actually start interfacing with it. Java serial libraries, here I come!
Whaddaya'll think of my first hack?