• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

Mash Monitor

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
You might want to check out my mash steam heating posts. As far as I can tell, that is about the simplest way to heat a mash.
 
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:

4688-mashmonitortest.JPG


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?
 
Looks good.... Should be interesting to see what everyone makes their interfaces look like with the different levers and indicators...

For liquid level detection, I plan to use a pressure sensor as described in this app note...

I recently ordered 2 solenoid valves, a 1500Watt heating element, and a couple of 15a relays to play with... I'll probably try to throw it all together next week and then start working on the software.. I have a rudimentary version that will turn the loads on or off with a click of a button for testing the mechanical stuff out...

For the automation stuff, do you plan on just writing it into the SW app you use, or do you plan to come up with a simple scripting language for customization?
 
For the automation stuff, do you plan on just writing it into the SW app you use, or do you plan to come up with a simple scripting language for customization?

Algorithms in the application, input data like setpoints, times, etc, in am XML doc. Java supports those.

I'm jealous you guys have time to work on yours ! It will be at least the beginning of April until I do.
 
Not bad.. Java's swing libs make everything look nice dont they?
FYI on the aurdino:

<technical>
the Arduino board makes a 10-bit analog to digital conversion. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1024.
</technical>
 
Jer said:
For liquid level detection, I plan to use a pressure sensor as described in this app note...

I recently ordered 2 solenoid valves...
I like it! Realize, though (and you might already know), that solenoid valves are binary (full open or full closed). That means that for fly sparging, you may have to have some means of flow restriction on the outlet side of your pump or gravity feed system so that the sparge water doesn't rush into the mash too quickly. That's why I was thinking about using a stepper motor to control a ball valve.

For the automation stuff, do you plan on just writing it into the SW app you use, or do you plan to come up with a simple scripting language for customization?
I was planning on initially just hard coding everything until I get the bugs worked out of simple automation tasks like sensor input and switch/motor actuation. Eventually, I plan on using a setup dialog where the user specifies how devices are connected (i.e., which pins he's using on the board), calibrates any sensors, and selects a mode of operation (RIMS, HERMS, steam, etc). The mode selection may be a moot point - if I offer up to three temperature controls, two level sensing controls, and a few manually controlled toggle switches, I think one could control most any brew system.

MadWeezel said:
Not bad.. Java's swing libs make everything look nice dont they?
FYI on the aurdino:

<technical>
the Arduino board makes a 10-bit analog to digital conversion. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1024.
</technical>
Thanks! Yup...gotta love the Swingset... Thanks for the info on the Arduino - I guess I'll keep my serial thread variables as integers, then convert to floating point with a calibration factor.
 
though (and you might already know), that solenoid valves are binary (full open or full closed). That means that for fly sparging, you may have to have some means of flow restriction on the outlet side of your pump or gravity feed system so that the sparge water doesn't rush into the mash too quickly. That's why I was thinking about using a stepper motor to control a ball valve.

Currently I only batch sparge, and I see no reason to change yet since I more or less just started AG and am fairly happy with my process (so far)... So I have little need for flow control besides off and on...

For controlling a valve, maybe a servo motor like for radio controlled type stuff might be easier to control (if you just plan on physically turning the valve) than setting up control for a stepper.. I think those are just voltage controlled, so you could just use PWM and some type of simple lowpass circuit (resistor and a cap) to get variable voltage from the board...

I received my solenoids and relays, now just need to wait for the heating element... I'm headed to the UP (Michigan) for the weekend and a couple days next week, so I probably won't be making much progress except for maybe working on the software on the ride up...
 
Fair enough, Jer. Batch sparging is much easier from an automated control standpoint.

As far as servos vs steppers...it seems there is an eternal debate about which is better. Ultimately, price and availability will probably drive which one I use.

Best of luck on everyone's systems - I'm excited to see what you come up with!
 
you guys realize that you have given me a brewing woody?!!!!

I am so geeked up about this! When all the bugs are worked out I am DEFINITLY going automated steam!!!

I love how brewing brings together such an immense knowledge base from all across the spectrum. Electronics, welding, physics, etc. this is truly a temple of knowledge!

You guys rock!
 
Instead of trying to match really small flow rates with a throttle valve, I was going to use a water level switch and turn my pump on and off. I'll put a check valve in the intake line to keep the line full as well.

As far as sparging goes, I am going to try no stir batch sparging with my manual setup. It could be automated by putting a solenoid valve on the outlet of the MLT. It would be pretty easy to program fill-wait-dump, fill-wait-dump into the controller. I'd probably do 4 cycles and use less water than the normal 2 cycle batch sparge.
 
Hey, great work - I really like your UI! I built a little monitor console for my mash temp controller - it simply listens to the serial port and plots the data recieved. Definately not as sophisticated as yours.

I used LM34 and a PIC ADC to monitor the temp, but that's all on the controller side. If you're plotting serial data too, want to trade source code? Mine is in VB however. I still think the graphing on mine is a little weak so I need to revise it sometime soon.

mashmaster_screen_small.jpg
 
Do you plan on any re-circulation for clarification? or just hoping that without stiring, you won't disturb the grain bed too much...
 
If one wanted to control flow you could look for Belimo brand proportional damper actuator that takes a 0-10V control signal or look for the floating type control that uses up/down control inputs from relays and couple it to a ball valve. For the manual control folks look for Dwyer VFB type flow meters in the 6-60 GPH range for sparge in and wort out flows.
 
MadWeezel said:
Cool - I found some thermistors on their site yesterday as well. I figured for the price, I couldn't go wrong. This looks like a little bit better option...wonder why it didn't show up when I searched the keyword, "temperature."

Jameco is a great company - I ordered most of my stir plate components through them, and I was always happy with the service.
 
I don't remember where I got mine, I've had a bag of 30 of them for a while... They're NTC, so non-linear... I'm thinking about switching to the LM34 for ease of use and accuracy...

I've used Digikey for years for all my electronic stuff...
 
I just finished my brewery automation and I see this. My first thought was I NEED IT!! but now Im trying to figure out how helpful it really is.

How does it help on brew day or do you just use it as a reference afterwards?
 
Monster Mash said:
How does it help on brew day or do you just use it as a reference afterwards?
The software in the OP was simply a monitor with datalogging, such that one could accurately measure the temperature of the mash in real time while keeping a log of temperatures over time (to get a graphical representation of heat losses and/or save a very detailed mash profile).

The follow-on posts (mine included) suggest broadening the scope of the software to include electronic control of brew equipment.
 
Which of the software packages available would be the easiest to use to build an application with graphics that would enable one to use the opto 22 optomux hardware with serial communications. Last programming efforts were when 5.25" disks were common and borlands turbo pascal was new about 2 decades ago.
 
kladue said:
Which of the software packages available would be the easiest to use to build an application with graphics that would enable one to use the opto 22 optomux hardware with serial communications. Last programming efforts were when 5.25" disks were common and borlands turbo pascal was new about 2 decades ago.
I HIGHLY recommend Java. The development platform is free (JDK), and it even has a free Windows GUI builder (Netbeans). There's a serial comm library for Java that supposedly works well. I haven't used it yet, but I will be experimenting with it sometime soon.

The language itself is quite different from Pascal in that it is object oriented. A bit of reading on the Sun website and a look at the plentiful example code should straighten that out for you. The basic logic and conditional statements are much the same as you've experienced before. If you've ever used C, the curly bracket scheme will look familiar, but I think the language is a bit more intuitive to use.

The other advantage of Java is that it is cross-platform capable - you can develop your program in Windows and have it run sucessfully on Mac or Unix systems. The serial library might be more platform specific, though - only time will tell with that.

The disadvantage of Java is that it is compiled at runtime in the JRE (Java Runtime Environment), so it tends to be a little slow to start, and there is a bit more memory cost than would otherwise be associated with the same program as a straight executable. It's really not a concern with the simple tasks we're trying to perform here.
 
I HIGHLY recommend Java. The development platform is free (JDK), and it even has a free Windows GUI builder (Netbeans). There's a serial comm library for Java that supposedly works well. I haven't used it yet, but I will be experimenting with it sometime soon.

I highly recommend Java too ! Install Eclipse with the visual editor and writing Java is like writing Visual Basic code, only in Java. (www.eclipse.org)

I'm using Java and USB for another project and I've got all the bugs out of using libusbJava. The Arduino board uses USB, so its a natural fit.

I'm too busy to do anything with this now, but in a few months I'll get back to it.

My applications will be written using the SWT libary, btw. It has buttons and Windows and textboxes, etc. I did a chart on the weekend that works great.
 
Thank you both for the software recomendations, have downloaded and installed the Java software. Now comes the fun part, learning a new programming language, but it will give me something to do at night until this Intel job is finished and i can return to Oregon and assemble the new system. The only upside to being in arizona and managing another instrument install job, is the leftover tubing and fittings from both the instrument and tool install work.
 
brewman, how's libusb treating you? Are you able to connect to an Arduino board through it?

All of the reading I've done suggests that the Arduino USB board shows up as a serial comm port, so I've been working on serial communication in Java. Unfortunately, I only have a Windows machine at the moment, and Sun gave up on a Windows implementation of javax.comm at least 4 years ago, so I've downloaded the GNU comm library at http://www.rxtx.org. I've managed some very simple code with it, and it appears to work very well. My Arduino board should show up next week, and I'll have more info then.
 
brewman, how's libusb treating you? Are you able to connect to an Arduino board through it?

libusbJava works well. I haven't connected to the Arduino board. I am working with another board for another project and it works well for that. No problem.


All of the reading I've done suggests that the Arduino USB board shows up as a serial comm port, so I've been working on serial communication in Java. Unfortunately, I only have a Windows machine at the moment, and Sun gave up on a Windows implementation of javax.comm at least 4 years ago, so I've downloaded the GNU comm library at http://www.rxtx.org. I've managed some very simple code with it, and it appears to work very well. My Arduino board should show up next week, and I'll have more info then.

Yeah, I guess it is going to work that way, ie Widows (Linux) will automatically create a USB driver for a serial device. I used rxtx about 2 years ago with a USB serial device and there were bugs. Hopefully they have been fixed since then. It worked fine with a regular serial port, but not with a USB serial port. *fingers crossed*
 
Sweet! I've got Java/RxTx working with an IOGear USB/Serial adapter and a null modem cable between my desktop and laptop. It seems to work very well - no bugs noted, but I haven't transferred more than a few bytes at a time. I'll post some screen shots later.
 
Time to hook up to the Arduino board !

Just a note... if we are going to share code, we should all work with the same Java libraries. I'll be using SWT because I've used it for other projects and it works well. Its part of the eclipse.org project.

I'm brewing tonight, but if I get done early and I'm bored I'll hook onto my board and test it.
 
I've pretty much abandon the USB idea since the only benefit I see to it is that it would power the controller, but since it can only supply 500mA, that's not enough to drive the relays and solenoids, so I'll probably just stick with rs232...

Since I know nothing of Java, I'll probably continue with Boralnd C++ builder, but I'd be more than happy to share that code if anyone wants it... I haven't made much progress lately on the software though, trying to put together the 'water heater' but having trouble mounting the heating element....

Seems that if I have the free time, I end up brewing instead of working on this.. :)
 
Back
Top