The Story So Far…

ScreenUi
January 19, 2012 9:26 pm [No Comments]

ScreenUi is a user interface library designed for small character based LCDs like those that are commonly used with Arduinos. The purpose of the library is to make it easy to quickly build logical screen interfaces with common widgets. It’s written in C++ and installs as an Arduino library or can be used external to Arduino. All hardware access is done through a very short implementable interface. You just need to define a few methods for LCD output and a few methods for button or encoder input and the library does the rest.

Here is a short video showing the widgets that are currently written:

And here is the code for that demo:


void loop() {
  Screen screen(20, 4);

  Label titleLabel("RGB Settings");

  Label addressLabel("Address:");
  char *address2 = "moof moof";
  char *address = "0xffee";
  Input addressInput(address);

  Label colorLabel("Color:");
  List colorList(7);
  colorList.addItem("Red");
  colorList.addItem("Orange");
  colorList.addItem("Yellow");
  colorList.addItem("Green");
  colorList.addItem("Blue");
  colorList.addItem("Indigo");
  colorList.addItem("Violet");

  Label rgbEnabledLabel("RGB Enabled:");
  Checkbox rgbEnabledCheckbox;

  Label refroLabel("Refrobulate:");
  Checkbox refroCheckbox;

  Label discoLabel("Discombobulate:");
  Checkbox discoCheckbox;

  ScrollContainer scrollContainer(&screen, screen.width(), 2);
  scrollContainer.add(&addressLabel, 0, 0);
  scrollContainer.add(&addressInput, 8, 0);
  scrollContainer.add(&colorLabel, 0, 1);
  scrollContainer.add(&colorList, 6, 1);
  scrollContainer.add(&rgbEnabledLabel, 0, 2);
  scrollContainer.add(&rgbEnabledCheckbox, 12, 2);
  scrollContainer.add(&refroLabel, 0, 3);
  scrollContainer.add(&refroCheckbox, 12, 3);
  scrollContainer.add(&discoLabel, 0, 4);
  scrollContainer.add(&discoCheckbox, 15, 4);

  Button cancelButton("Cancel");

  Button okButton("Ok");

  screen.add(&titleLabel, 0, 0);
  screen.add(&scrollContainer, 0, 1);
  screen.add(&cancelButton, 0, 3);
  screen.add(&okButton, 16, 3);

  screen.setFocusHolder(&okButton);
  while (1) {
    screen.update();
    if (okButton.pressed()) {
      addressInput.setText(address2);
      Serial.println(rgbEnabledCheckbox.checked(), DEC);
      Serial.println(colorList.selectedItem());
    }
    else if (cancelButton.pressed()) {
      addressInput.setText(address);
    }
  }
}

You can see the bulk of the code is for setting up and laying out the screen. Processing of the screen all happens within the while (1) loop and is very simple. Buttons get their pressed() property set when they have been clicked, lists get their selectedItem() property updated, editable fields update their string in place, etc.

ScreenUi is Open Source and is available at http://code.google.com/p/screenui/. It’s not completely finished, but it’s already very usable. I’ll be adding some more widgets to it in the coming days.

Thanks for reading!


My Brewery is the 99%
November 30, 2011 12:09 am [3 Comments]

99% done that is!

My brewery has been about 99% done for a few months now. I’ve been brewing on it and until I have time to redo some fairly major things this is how it’s going to stay, so I thought it was finally time I took some pictures of it and showed it off a little.

The brewery has been a work in progress for about 2 years now. I set out to build a fairly simple “Brutus 10″ system and just kept adding and adding and adding. Along the way I learned a lot of new skills and worked my ass off, but it really turned out to be all worth it.

Before I can really show off the system, it will make a lot more sense if you know how beer is made. So, in short, this is how beer is made:

  1. Malted barley is mixed with hot water to create the Mash in the Mash Lauter Tun.
  2. The Mash is allowed to steep for about an hour. This causes the starch in the barley to turn into sugar.
  3. The liquid from the Mash, which we now call Mash Liquor, is drained through a filter from the Mash Liquor Tun into the Boil Kettle. This process is called Lautering.
  4. Hot water from the Hot Liquor Tank is rinsed over the remaining barley in the Mash Lauter Tun to capture any remaining sugar. This process is called Sparging. This water is also collected into the Boil Kettle.
  5. The sweet liquid in the Boil Kettle is brought to a boil and hops are added. We now call the boiling liquid Wort. The process of boiling extracts bitterness from the hops to temper the sweetness of the Wort.
  6. The boiled Wort is cooled down, moved into a Fermenter tank and Yeast is added.
  7. The Yeast work their biological miracle and turn the sugar in the Wort into alcohol and CO2. The CO2 goes out the top and the alcohol stays in. We now have Beer!
  8. The Beer is enjoyed.

The system is an E-HERMS with a ton of automation. E-HERMS stands for Electric Heat Exchanger Recirculating Mash System. What that means is that liquids are heated with electricity (instead of gas, which is more common), and the Mash Liquor recirculates through a heat exchanger to change it’s temperature. More on that in a bit.

The automation comes in the way of temperature sensors, a BrewTroller brewing control computer, motorized ball valves and solenoid valves, a very large control panel and lots of wires. There’s also two brewing pumps to move all the liquids around.

The point of all this is that I can brew without ever having to deal with lifting heavy buckets of hot liquids or disconnecting and reconnecting a bunch of hoses as I go. And, of course, to be super geeky while making beer :)

So, now for the tour. First is the brewery from afar…

From right to left is the Hot Liquor Tank (HLT), the Mash Lauter Tun (MLT) and the Boil Kettle (BK). The HLT is basically a glorified water heater with a twist. It’s goal in life is to keep a bunch of water at a set temperature. Usually around 180 °F.

The twist is that inside the kettle is a coil of stainless steel tubing. This tubing is the heat exchanger. I pump Mash Liquor from the MLT through the heat exchanger and back into the MLT to heat it up. This allows me to control the temperature of the Mash without directly heating it, which can be bad for the grain.

The next set of pictures shows the three kettles from the inside.

The Boil Kettle contains a heating element which is used to heat up and boil the Wort. The Mash Lauter Tun contains a filter called a False Bottom which is used to drain the Mash Liquor without getting grains. The False Bottom has a series of slots cut into that are too small for the grain to pass through. And finally, the Hot Liquor Tank contains a heating element for heating water and the heat exchanger coil for passing Mash Liquor through.

Next we have some pictures showing the pumps and plumbing of the brewery.

The brewery is plumbed using all 1/2″ OD stainless steel tubing. I custom bent every piece to get it just how I wanted it. There are two March magnetic drive pumps for moving liquids around, 11 motorized ball valves for controlling liquid flow and direction and 2 solenoid valves for controlling fresh water input to the system.

The plumbing system is designed so that I can move liquid from any tank to any other tank by opening the right configuration of valves and turning on the right pumps.

There is also a plate chiller (the thing that looks like a set of stacked metal plates) which is used for quickly cooling the Wort down from boiling to 68 °F, which what the yeast like. The chiller has channels that allow the Wort to pass in one direction and cold water in the other direction. The metal of the channels transmits heat effectively between the hot Wort and cold water without letting the two mix.

Next up are the electrical systems.

The control panel is responsible for controlling the motorized ball valves, solenoids, heating elements, pumps and temperature sensors. It shows me the temperature of each tank, along with some auxiliary temperatures and lets me control the other components either manually or automatically. The knob in the middle is an iPod style control that lets me scroll through menus on the LCD and select options.

You can also see a breakout box I made which allows me to hook the 5 temperature sensors together to connect to the control panel.

That pretty much covers the brewery itself, but there is more to the process. Next we have fermentation equipment.

Here we have 2 BrewHemoth 22 gallon Fermenters and their associated bits. Each Fermenter is wrapped with heating tape which allows me to raise the temperature of the Fermenter and each has an integrated chiller inside it which allows me to cool it. Managing the temperature of fermenting beer is very important in determining how it turns out. The Fermenters also each have a temperature sensor which is locked into the top at an angle. This is used to monitor the temperature of the fermenting beer.

To manage all that stuff, we have a FermTroller. This is a miniature version of the system in the brewery. All this one does is monitor temperatures and either turn on heating or cooling. It is responsible for turning on and off the heating tape and turning on and off the chiller pumps and valves.

The chilling system is not yet complete. I had intended to use this freezer to recirculate cold glycol solution through the chillers but it turned out that the glycol needed to be much colder than I wanted the freezer to be. I want to also be able to use the freezer to store beer, and beer needs to be around 45 °F. Unfortunately, the glycol needs to be around -20 °F. So, the chiller system is still being worked on.

And finally, we have some kegs. These kegs are how I store and serve the beer I make. Each one holds 5 gallons and they go into the kegerator in my kitchen. All the kegs with open lids are currently dirty and need to be cleaned. The one that is closed and is hooked up to the CO2 tank contains fresh beer that is carbonating.


Brewery: Finally, a brew!
August 21, 2011 10:53 pm [No Comments]

I finally managed to crank out a brew this weekend. I started on Saturday and ended up aborting due to process problems. Got it all figured out Saturday evening and got back to it Sunday. Ended up being a very, very long day but beer was made!

First, some pictures, and then my notes from the session…

And now the notes. Beware, madness lie ahead:

Recipe: Basic Pale
Style: 10A-American Ale-American Pale Ale

Recipe Overview

Wort Volume Before Boil: 12.00 US gals
Wort Volume After Boil: 11.00 US gals
Volume Transferred: 11.00 US gals
Water Added: 0.00 US gals
Volume At Pitching: 11.00 US gals
Final Batch Volume: 11.00 US gals
Expected Pre-Boil Gravity: 1.051 SG
Expected OG: 1.056 SG
Expected FG: 1.013 SG
Expected ABV: 5.6 %
Expected ABW: 4.4 %
Expected IBU (using Tinseth): 31.4
Expected Color: 7.1 SRM
Apparent Attenuation: 75.0 %
Mash Efficiency: 75.0 %
Boil Duration: 60.0 mins
Fermentation Temperature: 64 degF

Fermentables
US 2-Row Malt 20.00 lb (89.9 %) In Mash/Steeped
US Caramel 20L Malt 2.00 lb (9.0 %) In Mash/Steeped
US Caramel 120L Malt 0.25 lb (1.1 %) In Mash/Steeped

Hops
US Columbus(Tomahawk) (15.5 % alpha) 1.00 oz Bagged Pellet Hops used 60 Min From End
US Cascade (4.5 % alpha) 2.00 oz Bagged Pellet Hops used 15 Min From End
US Cascade (4.5 % alpha) 1.00 oz Bagged Pellet Hops used 1 Min From End

Other Ingredients

Yeast: DCL US-05 (formerly US-56) SafAle

Mash Schedule
Mash Type: Full Mash
Schedule Name:Single Step Infusion (69C-156F)
Step: Rest at 156 degF for 60 mins

Recipe Notes

2:19pm
Started filling BK to do a PBW flush on the chiller
10 gallons to cover temp sensor

2:45pm
BrewTroller problems

5:35pm
Gave the fuck up

The next day…

12:06pm
Filled BK to 10.25 gallons and started heating and recirc

12:11pm
Started to pour some PBW into the water but it made the whole thing sound like a jet engine. Heating element doesn’t like it? Holding off itll the water is up to temp.

12:20pm
Started recirculating PBW through the chiller a few minutes ago
Running the element at 5% @ 4 second cycle to keep the solution around 120F

12:30pm
It has pulled some hop bits and gunk out of the chiller. Temp is holding very well with no additional heat input.

12:40pm
Filled HLT to 16 gallons and started heating to 180F. Should have done this from the start so it would be ready to flush the chiller.

1:10pm
Finished draining PBW, gotta flush with clean water now

1:17pm
Ran clean water through chiller and drain and into BK
PBW was left between 2 and G I guess, pumped back into BK a bit.
Could probably drain that using the prime dump next time

Probably should remove kettle manual valves. Serve no purpose and can store baddies.

1:28pm
Continued heating HLT, had to stop while moving water
Had to cycle clean water through BK 2X before it felt not slippery

1:35pm
Started moving HLT water to BK for chiller sterilization

1:39pm
Moved 10 gallons 130F water to BK, will continue heating and sanitize chiller with it
This represents the start of a normal brew day. Previous work was all stuff that will normally be done at the end of the brew day.

1:51pm
Last minute configuration stuff
Starting the brew!

1:58pm
BT says to fill mash to 7.8, HLT to 10.8. Already have 14 in HLT so keeping it.
7.8 is too low for temp sensor in MLT. Hmm. This wouldn’t matter as much if I had the HEX return sensor.
Going to add 2 gallons and then dump it before mashing in.

2:05pm
Just realized that if I continue the program right now I won’t have a chance to run the chiller sanitize, so going back to that for now.

Seem to be having some BTPD problems. Or possibly power supply. Getting a lot of flicker from LCD in certain modes. Lots of BTPD resets. Did I ever adjust the brownout on my units? Might be time to dump the BTPD v1 units.

2:22pm
Started recirc on chiller at 185F
Also heating HLT to 170 to get ahead of that
Manually adjusting BK heat to keep the temp around 185F

2:38pm
Finished sanitizing chiller, draining BK to sink
HLT at 130F

Chill water out does not have an adjustable valve on it, so it’s gonna be full bore. Maybe replace E with proportional eventually.

2:50pm
Uploaded new code w/out BTPD support. They keep resetting like crazy. Don’t know if they are the problem or not but that’s the first step in finding out. Unplugged BTPDs completely.
2:52pm
Really for real starting the brew
Really need to replace that alarm. It’s terrifying.
LCD still flickering a lot, don’t think the problem is the BTPDs. Maybe power supply. Need to stick a big ass cap on the 12v lines.
HLT 135F, MLT 85F

3:05pm
Just noticed I never turned the HLT heater on. Sweet! Water will heat faster with it on.
HLT 118F, MLT 111F

3:17pm
Crushed one campden tab and added half to MLT and half to HLT
Cleaned scrubby and put it under diptube in BK

MLT is trailing the HLT by almost exactly 10 degrees. Not sure if that is relevant right now.

3:30pm
HLT 149F, MLT 139F

3:53pm
Screwing around with serial logging a bit to get some data out. Almost up to temp on kettles.

4:05pm
Done screwing around, resuming brew
169F, 160F

4:08pm
172F, 163F

4:15pm
MLT now coming up to temp very slowly. Might be seeing the HEX inefficiency here.
171, 166

4:24pm
Fucking BT locked up and I didn’t notice. Everything kept running.
182, 173

4:33pm
Took off lids and stirred to lower temp, 179/170
Doughing in
Strike 156F after dough in and stirring, probably due to the grain being warmer than I programmed @ 69F
4:47pm
Mash running well
Heating seems to overshoot by as much as 5F. Gotta get the PID going on that.
Wort is now beautiful and clear running through the sight glass

5:30pm
Mash almost finished
Overshoot is about 6 degrees. Goes from 154 to 160 and then slowly drops back down.

5:40pm
Started sparge
Need a way to judge flow better

5:54pm
Bug in sparge in valve profile! Wasn’t actually pumping any water in :)

Need to pay more attention to volume of sparge water. Going to end up with 4 gallons of liquid in mash that should not be there.

6:08pm
Turned on BK element to start heating up the wort
9 gallons collected so far

6:27
Finished sparge
Got about 12.5G in kettle. Will determine why when grains are scooped out
Starting boil
Lost a taste by leaving dump valve open. Woops.
Original Gravity was 1.038 @ 150F by hydrometer
12.2P
Expected original gravity was 1.051, and we’re looking at 1.048

6:53pm
Wort boil hit

6:58pm
Started boil timer
Dropped first hops
70% @ 4S is giving a nice hard boil

There was a lot of wort trapped in the HEX, probably the missing wort. Flush it next time.

Boil temp is 209F
Refilled HLT to 10G and started heating to 180F

7:54pm
Added Irish Moss, should have done @15 instead of @5
Cleaning water up to temp

8:00pm
Added the last minute hops directly to wort at 7:59pm
Remove hop bags
Started recirc for whirlpool

8:06pm
Stopped whirlpool, starting settle, will allow to settle for 10 mins
Wort is 194F
Kettle lid should go on at 176F
Wort has a really nice spicy note, kinda like cinnamon or nutmeg

8:14pm
Decided to stir the BK a little to check for temp hotspots. I’m retarded. There goes my nice hop pile.

8:17pm
Started chilling
Removed whirlpool return, need to be able to see if beer is flowing
Really need sightglass and flow meter

9:00pm
Sanitized the fermenter by putting 5 gallons of sanitizer in and spraying the heck out of the top part. Hope that does the trick.

9:11pm
Last few degrees taking forever. Wasting a lot of water. Need to rethink this quite a bit. Ice in the MLT might be good.

9:36pm
Transferring to fermenter via bucket :(
Think I ended up with about 10.5G, failed to look before moving some
Maybe more like 10.0G
Evaporation rate was too low, I think, and we lost some in the HEX.

9:57pm
SG 13*P 1.054 by hydrometer @ 68F

11:00pm
Finally done, finished cleaning up
Beer is in the fermenter with a hose to a bucket of sanitizer for blow off
Pitched two packets of Safale US-05, direct to fermenter. They stuck on the foam at the top so I shook it up a bit to mix them in.
Oxygenated full open for 60 seconds from bottom

Final notes:
The whole hops I threw in at the last clogged things up a bit. The scrubby actually worked really well, but it definitely slowed down the flow. I pulled the scrubby out during clean up and the whole hops instantly clogged the drain. Those things will probably get fully stuck in ½” tubing, I bet.

The scrubby was FULL of gunk when I rinsed it out. I think it caught every last drop of break.

I think pellet would have flowed fine, but then they would have been stuck in the chiller. Gotta think about filtering more.

Cleanup went pretty smooth. I kept the HLT full of 180F and used it at the very end to flush the chiller. Used fresh water to flush everything else. On reflection, should have used the 180F to flush at least the HEX too.

Shop Vac is the business for cleaning up the hop mess in the BK and the last bits of grain in the MLT. Gotta get one specifically for brewing. A bucket one would be good. Easier to dump.


Brewery: Getting Close
August 2, 2011 9:43 pm [No Comments]

Well, I think I am starting to see the finish line on the brewery. It’s getting very close to done. I’ve been out in the garage bending tube and plumbing every spare hour I have. This past weekend I finally finished the final version of the manifold pieces and I mounted them on the stand. I ended up using some split ring conduit hangers from Lowes. They are galvanized, and I would prefer stainless, but the only source for stainless ones I can find are 10 times the price. I can live with galvanized for now.

Last night I finished the lines that go from the pumps to the manifold and tonight I finished the HLT return, HEX input and MLT return. These three we going to be the most difficult and I had only planned to finish one of them tonight but it actually went pretty quick thanks to some Swagelok 90 degree elbows I bought a few weeks back so I just pushed through and did all three. I’m really happy with how it turned out.

Only things left to do are the BK return and the plumbing for the chiller. I am still short a few parts for the chiller, so that will have to wait till Thursday probably, but I hope to do the BK return tomorrow night. With any luck all the major work will be done by this weekend and I can spend the weekend doing wet testing and tuning. Doubt I will be able to fit a brew in, but you never know. Here’s hoping!


Brewery: Finally Some Progress!
July 17, 2011 9:09 pm [No Comments]

Well, it’s been months and months since I have made any progress on the brewery, but this weekend I finally got out of my funk and got some shit done! I’ve really been struggling with the next step of the build, which has been to convert all the plumbing to hard, stainless steel tubing. I’ve been trying to figure out how to make it all perfect and I finally realized that I just won’t be able to, so I started bending.

So far things are coming along okay. I will probably need to add some Swagelok elbows to get things really set right and I might end up using some short pieces of reinforced nylon tubing as jumpers, but it’s coming along.

This weekend I got the HLT fully plumbed and the MLT half plumbed. I also got the HEX plumbed and pump 1 bolted down. I fully expect that I will end up redoing parts of this, but it feels good to actually make some progress.