Boston Beer, Boston Strong

Boston-262-Brew-Logo

Boston Beer Company, brewer of Samuel Adams beers, recently filed a trademark application for “Boston Strong” 26.2 Brew.

The Sam Adams Boston 26.2 Brew was first brewed in 2012 in partnership with the Boston Athletic Association and originally could be found only at select establishments along the marathon route. The 26.2 Brew is a Gose style beer, an unfiltered German wheat beer made with 50-60% malted wheat, featuring notes of coriander and salt. A light-bodied, thirst-quenching beer, Gose is a perfect post-marathon refresher.

In light of the recent tragedy, Boston Beer Company, a longtime enthusiastic sponsor of the Boston marathon, has pledged to donate its profits from its 2013 and 2014 26.2 Brew to the Greg Hill Foundation to support the victims and their families. While the “Boston” element of the trademark will likely have to be disclaimed, the “Boston Strong” 26.2 Brew would allow for the annual “26.2 Brew” to be re-cast as supporter of the victims of the 2013 Boston Marathon.

In an interesting application of trademark law, which is meant to to exclude others from using and benefiting from one’s marks, Boston Beer said it will allow others in its trademark category to use the “Boston Strong” phrase – provided that 100 percent of profits are donated to charity. This proposal and donation of all profits separates Boston Beer company from Chowdaheadz and Meahuna Coffee, both local companies that have also submitted “Boston Strong” trademark applications, but have been criticized for capitalizing on the tragedy, despite promising to donate some percentage of profits to charity.

The United States Patent and Trademark Office has the next move. However, with or without the trademark, you can support victims of the 2013 Boston marathon by drinking 26.2 Brew. It might just be the refresher we all need.

Operation KEG Part 5: Dum spero spiro!

fet_level_shift

On Friday 5 April 2013 at 12:20 am, Tux the Polyester Penguin triumphantly declared: “Dum spero spiro!” after observing a string of valid temperature readings printed out in the debug console. Oddly, this Latin proclamation commonly attributed to Cicero happens to be the motto of the State of South Carolina. Although it translates literally to “while I breathe, I hope,” it makes more frequent appearances in modern English as “while there’s life, there’s hope.” As recounted in gory detail in Operation KEG Part 4: Houston, we have a problem, the BeagleBeer controller board, intended to play a pivotal role in the pimping of the Venture Café kegerator, had some design flaws. Tux and I burned the midnight oil in order to resurrect the temperature sensors, verify the proper operation of the beer flow sensors, and suss out the reason why the BeagleBone embedded computer fails to boot with the BeagleBeer board attached.

temp_sensors_3p3_readout

The Adafruit bi-directional level shifter, introduced at the end of the previous post, a tiny breakout board built from Fairchild Semiconductor BSS138 N-channel MOSFETs with 10K ohm pull-up resistors, enabled us to measure temperature on both the BeagleBeer and Coaster boards using the +3.3V BeagleBone one-wire interface.

ID757_MED

I discerned why this MOSFET approach succeeds in interfacing the +3.3V BeagleBone I/O line to the +5V one-wire data line on the temperature sensors without negative consequences by reading an application note from Philips Semiconductors. Arcane technical details aside, this retrofit works like a charm. As shown in the schematic snapshot below, I adopted a MOSFET level translation scheme for the one-wire sensors in BeagleBeer Version 2. All of the temperature sensors are connected in series to ONEWIRE_A. Although currently unused, the BeagleBeer also supports a second one-wire bus, ONEWIRE_B.

one_wire_lt

After learning of our success, Amy commented: “Wow, I don’t see any smoke or flames, or even any charring on Tux! Amazing.” Indeed.

Not ones to rest on our laurels, we soon redirected our attention to the other key component controlled by the BeagleBeer, the flow sensors that measure dispensed beer volume. The Swissflow SF800 flow sensors have a 3-wire readout (+5-24 VDC power, ground, and data output line that requires a 2.2K ohm pullup resistor):

swissflow_setup

In the final configuration, the BeagleBone will count pulses on the flow sensor data line in order to compute volume, but our initial experiment involved simply verifying that the sensor in fact measured fluid flow. I hooked up the Coaster to the BeagleBone merely as a convenient platform for power and ground connections. I “borrowed” an old-school 2K ohm resistor from the lab at Analog Devices Lyric Labs that has long leads. The Cat5E Ethernet cable with the connector hacked off at one end again came in handy to interface the Kegbot Coaster and associated flow sensor to the BeagleBone and the Salae Logic 16 USB logic analyzer (the black box in the photo and a Christmas present from my brother). We made use of only one of the 16 available logic analyzer test lines to monitor to the output of the flow sensor. Tux inspects the data acquisition configuration:

pullup_flow_sensor_to_3p3Vold_school_resistor

A stunning statement of the obvious– in order to measure fluid flow, we needed a mechanism to pour fluid through the flow sensor. Tapping into my inner MacGyver, I assembled a test setup using a measuring cup, water, duct tape, a Venture Café pint glass, and the flow sensor connected to a Kegbot Coaster board:

flow_test_setup

We conducted two experiments: 1) power the flow sensor at +5V and pull up the readout line to +5V, the manufacturer’s recommended configuration and 2) power the sensor at +5V and pull up the readout line to +3.3V, a BeagleBone-safe voltage level. [My homebrewing co-worker Sebastian Patulea suggested this simple, elegant readout scheme.]

After powering up the BeagleBone, it was time for the moment of truth…

flow_testing

Experiment #1 [+5V Logic Analyzer Output of Flow Sensor]:

flow_sensor_output_5V

Experiment #2 [+3.3V Logic Analyzer Output of Flow Sensor]:

flow_sensor_output_3p3V

Success! We proved that we can power the SF800 Flow Sensor at +5VDC and pull-up the flow sensor output with a 2.2K ohm resistor to either +5VDC or +3.3VDC. The +3.3V configuration obviates the need for more complicated level shifting schemes, a change that I immediately propagated to the BeagleBeer Version 2 schematic:

flow_sensor_pullup

Before sending out the BeagleBeer Version 2 printed circuit board design for fabrication, we had to resolve one outstanding glitch. As mentioned in Operation Keg Part 4, the BeagleBone computer fails to boot when mated with a BeagleBeer board. Consequently, I had to power on the BeagleBone and then hot-plug the BeagleBeer. Although I repeated this step several times without incident, it is not a workable solution in the long term. As it turns out, had I RTFM (Read the F***ing Manual) at the outset, this problem could have been prevented. Behold page 72:

bb_boot_config

Leaving these 16 system boot I/O lines unconnected at power up should resolve the problem. In the BeagleBeer Version 1 schematic, pin UART5_RXD is mysteriously connected to ground, and pins GPIO2_11 and GPIO2_13 are connected to flow sensor status LEDs. In Revision 2, I assigned these signals to other pins on the BeagleBone header connectors.

I’ve completed the modifications to the schematic and layout (available on Github) and am on the verge of placing the order for BeagleBeer Controller Version 2 printed circuit boards from Sunstone Circuits. Sebastian has kindly offered to assemble the new BeagleBeer, sparing it the indignity of my mediocre soldering skills and saving the Venture Café Foundation several hundred dollars in outsourced manufacturing costs. Next, I intend to write some code for the BeagleBone to count pulses output by the sensor using GPIO interrupts. One liter of beer corresponds to 5600 pulses. A packetizer function will bundle these pulse per unit time readings with temperature measurements and periodically send the data to the Kegbot Android app over a UART to USB interface. Tux has decreed that we will perform our first live test with beer at Venture Café on or before Thursday 2 May 2013. Watch this space for updates!

The delicious sting of collaboration

This week, our retailer Downtown Wine and Spirits hooked us up with an amazing beer that reflects the spirit of exchange and collaboration so revered by our entrepreneurial community. The beer is called Stingo Collaboration No. 3, and it is brewed by Cambridge’s own Pretty Things in close collaboration with Boulevard Brewing Co. of Kansas City, MO.

The two are an odd match: Pretty Things employs four people and tenant brews on a 50-barrel system, while Boulevard is one of the largest craft beermakers in the US, boasting a state-of-the-art 150-barrel brewery, and employing over one hundred people. The brewers met at the American Craft Beer Fest in June 2011. During the Belgian Beer Festival in Fall 2011, Boulevard brewmaster Steven Pauwels suggested a collaboration between the breweries as they imbibed at Lord Hobo in Cambridge. Pretty Things’ Martha Holley-Paquette, a native of Yorkshire, offered the idea of the historical sour English ale (or is it the original Flanders Red?). The collaboration would push the envelope for both breweries: Pretty Things had never done a collaboration beer before, and Pauwels, a native Belgian, had not brewed an English-style beer, or considered English ingredients, since arriving at Boulevard over 10 years ago.

Together, over a series of emails, Pretty Things and Boulevard developed a recipe that combined English beer ingredients and brewing history with current Belgian beer brewing styles. The recipe called for 100% Yorkshire malts, a Yorkshire ale yeast, and a few different English hop varieties. Pauwels remarked that his brewery once threw out some of these hops due their extremely odd aroma.

In April 2012, the Pretty Things brewers traveled to Kansas City to brew Stingo: “We milled in, blended the preliminary batches, tweaked the ageing and ingredients, and most importantly ate more barbecue than any four people should ever eat.” Since Boulevard at the time did not work with foeders – very large wooden tuns used in Belgian brewing – the team created the beer’s “sting” with bacterial fermentation in the brewhouse, adding dry ice to the brew kettle to lower the temperature, thus encouraging bacteria to flourish, producing the “souring” lactic acid. Over the next few months, the brewers experimented from afar with different blends of Stingo batches to arrive at the final product.

Stingo tastes like a dry, brown ale, with a subtle sour “sting” upon sipping, followed by a dry and balanced finish. Pauwels describes Boulevard’s Collaboration No. 3 as “bold and full-bodied, with a big malty nose, hints of dark malt, chocolate, licorice, and black fruits, and just the right amount of tartness in the finish. It pairs exceptionally well with wild game, smoked meats, strong cheeses, and heavily seasoned dishes.”

Allow these brewers to entice you to venture beyond your own venture, and visit the Café this Thursday for a taste of collaboration.

Operation KEG Part 4: Houston, we have a problem

Debugging electronics requires resilience in the face of calamity. But unlike brain surgery, the consequences of errors are not paralysis or death, merely time, money, and small emissions of noxious fumes from melting solder and burning plastic. Upon recognition of a mistake that seems patently obvious in the harsh light of 20/20 hindsight, the designer finds herself holding her head in her hands, shaking her fist, and uttering strings of obscenities (abbreviated henceforth as “doh!”). In this post, I shall attempt to recast abject failure as an educational experience (not to mention a source of amusement for the beer blog reading public).

Before launching into a tragic tale of woe, let’s rewind. During the blizzard on Friday 8 March, I made the questionable decision to drive up to Proxy Manufacturing in Methuen to retrieve the assembled Kegboat Coaster and the BeagleBeer controller boards, first introduced in Operation KEG Part 3. Eager to accelerate the pace of kegerator innovation, I discovered in short order that the Kegbot Coaster boards work perfectly. Each Coaster board has a Maxim DS18B20 one-wire temperature sensor, a green LED, an RJ-45 connector to transfer power and data to the BeagleBeer interface controller, and 3 rows of header connectors. In addition to the on-board temperature sensor attached to One-Wire A, the Coaster serves as a connection point for 2 flow sensors, two miscellaneous GPIO lines, and a second one-wire device. (The four tap kegerator at Venture Café will require two Coaster boards.) For initial tests, I hacked off the connector on one end of a Cat5E Ethernet cable in order to expose the +5V, ground, Flow Sensor A, and One-Wire A wires.

kegbot_coaster_test

The rows of black header connectors along the long edges of the BeagleBone single-board computer include +5 and +3.3 V DC power rails, ground connections, and input/output interfaces to the ARM Cortex-A8 microprocessor. After connecting the ground and power lines of the Cat5E cable to BeagleBone connector P9 pins 1 and 3, respectively, the BeagleBone sources +3.3 VDC power to the Coaster. The one-wire temperature sensor was plugged into connector P8 pin 3 (GPIO1_6), designated ONE_WIRE_A on the BeagleBeer schematic.

beaglebone_headers

The BeagleBone ships with the Angstrom Distribution of Linux pre-installed. Although the BeagleBone has a myriad of on-board peripherals, it only sports 66 input/output pins. Pin functions can be assigned by software at run time. The supported configurations are documented in exhaustive detail in the BeagleBone Reference manual. A one-wire Linux driver, w1-gpio, is associated with connector P8 pin 6 (GPIO1_3) at power-up. Convincing the BeagleBone to treat P8 pin 3 as a one-wire I/O line required a Linux kernel patch, a diversion that I will not discuss in detail except to say that it was thoroughly dorktastic. After rebuilding the patched kernel and connecting the one-wire line from the Coaster to P8 pin 3, the green LED illuminated (hallelujah!). Eventually, a C, Python, or Javascript program will periodically poll the sensor and output a temperature. However, reading the temperature directly from the w1-gpio driver also did the trick (ignore the bizarre command line syntax):

temp_sensor

The DS18B20 temperature sensor can operate at either +3.3 or +5V. In the original Kegbot project, the Coaster board was designed for +5V, the minimum operating voltage for the Swissflow SF800 flow sensors. Furthermore, the Arduino microcontroller used in most Kegbots has +5V-compliant I/O lines. Unfortunately, applying +5V to a BeagleBone +3.3V input pin will fry the board. As we shall see, this seemingly minor detail complicates things quite a bit.

Satisfied with the Coasters, I plugged the BeagleBeer board into the BeagleBone and flipped on a +5V lab supply powering the two boards. Suffice it to say that things did not go according to plan.
The board failed the dreaded Smoke Test. As soon as I turned on the power, I smelled something burning. I immediately switched off the power supply and inspected the board, only to discover that the EEPROM had heated up so much that it had melted all of the solder joints and detached itself from the BeagleBeer printed circuit board. Doh!

The EEPROM stores the name and ID code of the BeagleBeer board in non-volatile memory (values persist in the absence of power) and can be programmed and read back by the BeagleBone. For all practical purposes, removing the EEPROM should not affect the other functions of the BeagleBeer board. The cause of this unfortunate occurrence did not take long to track down—reversed power and ground pins on the schematic symbol.

oops
Temporary fix: remove the EEPROM.

Power on Take 2! No more smoke, thank the gods in these unforgiving times. After a quick temperature check of all of the major components on the board with the tip of my index finger, I measured the voltages on all of the power rails on the BeagleBeer board with a multimeter. The +3.3V connections passed with flying colors. The VDD_5V and SYS_5V lines, connected to BeagleBone connector P9 pins 5, 6, 7, and 8, registered 5.0 V as expected. But all of the +5V lines on the rest of the board appeared to be at 0 V. Doh!

I verified that the 5V power lines and GND were, in fact, not shorted together using the handy continuity test mode on the multimeter. The instrument emits a loud beeping noise when the two test probes are connected.

contuinity-test-multimeter

After poring through the BeagleBeer circuit schematic, I failed to identify any obvious knuckleheaded mistakes. A quick glance at the board layout in the Eagle CAD tool, however, revealed the awful truth– nets called 5V (the BeagleBone power pins) and 5.0V (the 5V power rails everywhere else) were, tragically, not connected to each other. Out came the soldering iron for a minor surgical procedure that involved connecting two orange wires from the BeagleBone 5V power pin to the 5.0V nets. I added another GND connection between the two BeagleBone connectors for good measure. Tux the Polyester Penguin inspects the result:

soldering_irontux_beaglebeer_1

Power woes behind us, Tux and I decided to attempt to read out the temperature sensor on the Coaster through the BeagleBeer controller. Using a Cat5E cable with both ends intact, I plugged the Coaster in to the RJ-45 receptacle on the BeagleBeer. For some as yet to be determined reason, the BeagleBone does not boot when powered on with the BeagleBeer board connected. So, after Linux had booted, the BeagleBeer board was hot-swapped onto the BeagleBone, which, admittedly, was probably not most sensible thing to do.

The power LED on the BeagleBeer illuminated and all seemed well until I attempted to read out the temperature sensor. Linux acted as if no one-wire slave devices were present. I double-checked that the sensor worked standalone. After some head scratching and consultation of data sheets, I zeroed in on the Texas Instruments TXB0108 level translator chips. Because the BeagleBone can only handle digital inputs and outputs up to +3.3V, the +5V inputs from the Coaster board must have the high voltage (corresponding to a binary ‘1’) stepped down to avoid frying the ARM core. To make a long story short, this particular level translator chip will not work for open drain applications like one-wire temperature sensors. Doh!

Texas Instruments helpfully suggests replacing the offending TXB0108s with pin-compatible TXS0108s, which include internal pull-up resistors and will play nicely with one-wire devices. The new chips arrived from Digikey within 48 hours. Replacing surface-mount integrated circuits, however, is more easily said than done. Chip removal required The Sketchy Chinese Heat Gun. Tux looks slightly horrified on the photo, and rightly so. The temperature control on this particular unit, acquired several years ago on eBay from a dubious supplier in the Far East, is non-existent. It has two settings—fire of 1000 suns and OFF. (If and when I have more working capital at my disposal, I’ll invest a few thousand dollars in a much more reliable Hakko heat gun from Japan.) To add insult to injury, my soldering skills are mediocre at best. This surgical procedure was considerably more complicated than the +5V power line fix:

1) Melt the old chip off. Easy enough. I somehow managed to prevent surface-mount components that I did not intend to desolder from skittering off the board, never to be seen again.
2) Clean up the solder pads, apply solder flux, and place the replacement chip on the pads. Getting the two TXS0108s in the proper position literally drove me to drink, but I eventually succeeded.
3) Tack down opposite pins of the chip with the soldering iron, then flow a big blob of solder over the remaining pins. The pins were too close together for a mere mortal like me to solder them down one by one.
4) Remove the short circuits between pins with desoldering wick and a tool that looks like a dental instrument.
5) Remove the pullup resistors on the BeagleBeer board with desoldering tweezers.
6) Attempt to clean up the mess with solder flux remover.

tux_horrified

heat_gunafter_the_fix2
Although in principle this fix should have worked, it didn’t. Linux still acts blissfully ignorant of the presence of a temperature sensor. Doh!

The root cause of failure is still under investigation. I have a few more tricks up my sleeve:

1) Ask my co-worker at Analog Devices Lyric Labs, Vlad Kvartenko (a.k.a. master of electronics rework), to replace the TXB0108 chips on BeagleBeer serial number 2 with TXS0108s.
2) Bypass the TXS0108 on BeagleBeer serial number 1 and wire an alternative, the Adafruit Level Shifter module. between the RJ-45 connector and the BeagleBone ONE_WIRE_A line.

ID757_MED

The next challenge that must be overcome before the BeagleBeer plus Coaster system can be beta tested with actual beer in the Venture Café kegerator will be to sort out level translation for the flow sensors. Feel free to offer a ritual sacrifice to the Fickle Gods of Electronics Debugging on my behalf and keep an eye out for the next installment, Operation KEG Part 5: It’s Alive!

Random factoid: NASA astronaut Jack Swigert actually said: “Houston, we’ve had a problem here,” after the oxygen tank exploded on Apollo 13 on 13 April 1970.