LowBrau morphs into a Raspberry Pi brewbot

October 7, 2013

It’s been 4 months since I last wrote about my automated brewing project.  LowBrau was meant to be a low cost single-vessel automated step mash and boiling system.  But, although the controller box was mostly complete, I ran into problems when I fried my Arduino.  That and the hellishly cramped nature of my project box (which was designed to sit neatly under the boiling vessel) really put the brakes on mentally for me – I just wasn’t super motivated to push forward.

Although I may have been silent on this one, I have been working on the next iteration of the project for the last couple of months.  It was always my intention to not simply clone the commercially available systems, but to better them where I see a feature that is clunky or limited.  As a result this hiatus seemed like the perfect opportunity to rethink the core technologies of the project.

The biggest change is that I have now decided to ditch the Arduino and base the control box off a Raspberry Pi.  At $35 this little embedded linux computer is vastly more powerful than an Arduino, yet it really isn’t much more expensive than a name-brand Arduino.  It will allow profoundly enhanced functionality.

I also bought a far bigger project box.  Rather than living under the boiling vessel this one will be fully detachable, with all inputs and outputs connected via sockets.  It can happily live on the bench next to the brewbot.  I divided it into two physical sections with an off-cut of PVC square-section drainpipe to separate the high and low voltage components.

I’ll write a bit of commentary about each main component pictured in the photo below…

PiNT control box

As I wanted the control box fully detachable the AC power comes in and the pump and element connect via IEC sockets.  I went with snap in mountings rather than ones that require bolts/rivets, so all that was needed was an accurately sized rectangular hole to push them through.

The element and pump are switched by solid state relays.  Mine are Fotek 25DA.  I neither recommend or warn you off them – other than to say that they cost less than $4 each including postage and one of them came dead-on-arrival.  They’re mounted onto the heatsink used in the previous edition of the controller box.

Lastly in the high voltage area there’s the 5V 2A power supply module.  Everything else in the box gets powered off this 5V supply.  The RPi requires 1A, so there’s an additional 1A overhead for all the rest of the bits.

Down the left hand side is the Raspberry Pi (RPi).  The 26 pin general purpose input/output (GPIO) connector is connected to my breakout board via some grey ribbon cable.  I have thrown a very cheap $4 USB wifi (rtl8188cus chipset) on the RPi which will allow the advanced interface opportunities.

The temperature probe attaches via a 4 pin socket on the right.  The probe uses the DS18B20 chipset which is read natively by the RPi using the 1-Wire connector on the GPIO.  In linux the output of this probe appears as a text file for easy reading.  Couldn’t be simpler.

Along with wifi control, I also want to keep the option to control everything through the control box as usual.  I have selected a 20×4 LCD ($5), which provides more screen space than the Braumeister’s 16×2.  This in turn will allow me to implement a more sensible user interface that doesn’t require so many nested menus and laborious button pressing.  The LCD is a standard HD44780 chipset, however I do not connect it straight to the GPIO.  I have soldered to the back an i2c conversion board ($3) which further shrinks the number of IO lines to 2.  It also conveniently takes care of all the contrast potentiometer wiring.  Between this board and the RPi is a level shifter board ($2).  This is necessary because the RPi GPIO all works off 3.3V levels, not the 5V standard.  This board is bi-directional so it pumps 3.3V signals to 5V in one direction and 5V back down to 3.3 in the other.

On a related note, all the other outputs (SSR signals and LED indicators) are passed through a Darlington array (60c).  The 3.3V supply internal to the RPi only has a total capacity of 50mA – so even 3 LEDs would take it beyond its capacity!

The buttons are set with both pull-up resistors and current limiting resistors.  The pull-ups (10k) are required to stop the inputs from floating.  The current limiting resistors (1k) are often left out by people, but they’re a pretty good idea to do it correctly.  If your GPIO is always set up correctly as inputs then you’d never need them, but in the case that they get set erroneously as outputs they prevent them from creating a short circuit between the RPi output and ground.  I have also installed 100nF ceramic capacitors across the terminals of the buttons to hardware debounce them.  A quick circuit diagram is below.

PullUp-SwitchProtected-DebouncedAnd finally, there’s a speaker and amplifier.  One of the annoyances I find with the Braumeister is the incessant beeping that seems to accompany almost every step of the process.  Yet despite this it can also be surprisingly unapparent when everything has stopped waiting for you to press a button.  I have decided to solve these problems by replacing the buzzer in favour of voice prompts driven off the RPi audio output.  While a flashing status LED will give clear indication that a user input is needed.  The amp is a 5V D-class 3W audio amplifier ($3), which is commonly used in USB speakers and for that reason conveniently runs off my 5V supply and is plenty loud enough.


LowBrau – Setbacks and Delay

May 27, 2013

Anyone who has been following the progress on the LowBrau project would have seen a whole flurry of activity followed by a long period of silence.  Within 4 days of starting I had got to the stage where the case was drilled and filed for all components; the screen, buttons, LED indicators, temperature probe socket, buzzer, arduino and wiring shield were wired and mounted; the screen protector made and adhered with waterproof silicone caulk; and the SSRs and heatsink mated, mounted and wired up.

Pretty much everything was complete and ready for a test run.  And indeed I did, uploading my control software to the arduino, powering it off USB and everything ran as it should from menus to button presses, etc.  Excellent – all that remains is to remove the USB power and power it stand-alone off its own power supply.

This is where my cheap ebay power supply vendor threw a spanner in the works.  In a break from character I didn’t power it up and throw my multimeter over it before installing it in the LowBrau controller.  Unfortunately for me I was unaware that this power supply has been incorrectly labelled (the sticker placed upside-down).

lowbrau - ebaypowersupply_reversepolarity

I am also quite surprised that arduinos (especially being aimed at the hobbyist market) do not feature a diode to protect against a reverse polarity situation.  Incorrect supply wiring will instantly destroy an arduino, which is exactly what happened to mine.

Annoyingly the arduino cost far more than the power supply that took it out.  And without a spare I had to wait for a replacement and in the intervening time I lost momentum with it all.  But I still have plans to get back onto it in the future.

So if there was ever an encouragement to embrace the inner-pedant and check everything yourself, irrespective of what the manufacturer has written, then this is it!


TASCAM US-200 Audio Interface

April 3, 2013

Earlier I posted a guide to using a Real Tone cable (which comes with the game Rocksmith) to connect to Guitar Rig 5.  With the success of that experiment I went ahead and bought a proper audio interface.  In this post I will give a rundown of the rationale behind my decisions and highlight the differences between the two approaches.

tascam-us200

The unit that I chose was the TASCAM US-200.  This USB audio interface has 2 microphone-in (one of which can be instrument); gain knobs for each mic input; selectable 48V phantom power for professional microphones; 4 line-out channels (channel assignment software configurable); 1 independent headphone-out (with dedicated volume control); MIDI in and MIDI out.  This cost about $100.

The benefits of running this unit over the Real Tone are:

  • the Real Tone cable is only an audio input device so you need to use ASIO4ALL to bridge the sound output to your motherboard’s sound chip which can be annoying to configure (your settings don’t always ‘stick’)
  • the software bridging performed by ASIO4ALL, combined with the fact that the Real Tone is a budget item, means that latency is high (eminently playable, but clearly noticeable)
  • the TASCAM takes care of both audio input and output so configuration is super easy and reliable
  • the TASCAM has knobs for input gains and output volume so adjustments don’t require driving a mouse around the screen (which gets old pretty quick while you’re trying to play an instrument)

So what have I thought of it so far? Well latency is significantly lower!  I also found the Real Tone cable prone to noise – both clicks from artefacts and analog cable noise.  There are no artefacts with the TASCAM and any cable noise is virtually eliminated (probably in part due to the fact that I can use my better quality instrument cables than what the Real Tone is made from).  Any residual noise, where it may exist, is ruthlessly gobbled up by noise gate settings in GR5.

I also am a huge fan of the ability to set my external speakers and amplifier to a direct line-out and be able to adjust my headphones with the volume control (ie independent of the speakers).  This is a far better outcome than trying to get the single motherboard output to do everything.

The MIDI interface is also a nice bonus.  Although I don’t actually own any MIDI devices I can see the appeal of, say, a simple MIDI foot switch array to mimic the functionality of a traditional pedal board (and to do tap-tempos, etc).  Indeed that might be an excellent project for a future post!

But it isn’t all good news… (the update after 2 months use)

While from a hardware perspective the US-200 is a great bit of kit, the drivers are truly horrendous.  There are a number of pretty big issues with the driver but the greatest is its inability to cope with an operating system that implements suspend or sleep modes.  This little gem is buried away on page 11 of the manual – and I would have thought that this limitation is pretty important information for a buyer to know before they make their purchase.  Windows users have had sleep/suspend for EIGHTEEN YEARS, and yet the plebs at Tascam still cannot wrap their puny minds around writing a driver that can cope.  The result is that any time my PC goes to sleep I lose all sound both in and out.  The only remedy is a full reboot!  Totally unacceptable.

Next, the line out connectors are software-configurable.  Yet the driver is incapable of retaining my choices for more than a couple of hours.  So on a very regular basis I get put into an audio black-hole until I work out that the output routing has changed itself (again!).

And lastly, the drivers periodically just totally crap out and require a complete uninstall and reinstall.  I have had occasions where I’ve wanted to play and then had to restart my computer no less than SIX TIMES to actually return everything to correct working order.  If you want reliability this product is definitely not the one for you.

I have contacted Tascam about all these issues and they don’t even reply to support requests (I’ve waited over a month).  This is not a new product and clearly no new firmware or driver updates are going to come out for it.

Would I recommend this purchase to anyone else? Absolutely not.  Would I buy again?  Absolutely not.  Would I buy another Tascam product after this experience?  No, I wouldn’t – I really can’t think of a more substandard buying experience.

And I have to say this is all such a shame, because when it all works properly it’s a good unit.  Clearly the hardware is sound.  But, my goodness, what a terrible software implementation!  Definitely get an external audio interface (they’re great), but don’t buy a Tascam and don’t buy this one!


Using Rocksmith Real Tone cable with Guitar Rig 5

March 21, 2013

This christmas I picked up a copy of the game Rocksmith.  This half-game/half-tutor allows you to connect a real guitar to a console or PC and is basically Guitar Hero with a proper instrument.  Unlike Hero all the time you invest in getting better at the game actually builds real musical skills, rather than just coming away from it a highly talented coloured button masher.

real tone cable

You supply your own guitar and the connection is made by the Real Tone cable which is supplied with the game.  Inside it is a Hercules board which converts the analog signal from the guitar into a USB digital stream.

But not only can this game provide a leg-up getting the motivation to learn, but the Real Tone cable also allows amp modelling sims to be used outside of the game.  This is not something that is advertised by the game manufacturers but with a free driver, a little fiddling and a copy of Guitar Rig or Amplitube this is pretty easy to do.  And a standard interface for connecting guitar to PC will cost around $100, so Rocksmith really is giving you some excellent value beyond what is already a great game.

The driver that is needed is called ASIO4ALL.  This is because a standard audio interface has both input and output, but the Real Tone cable is input only.  In order to keep latencies low amp modelling software take exclusive control of the audio interface and they expect to only have to use one for both the incoming and outgoing sounds.  ASIO4ALL is needed to work as a ‘bridge’ so that the Real Tone can be selected as the input but a different device selected as the output (for example your motherboard sound chip).  I didn’t find ASIO4ALL super intuitive to use, so I will devote the rest of this post to explaining how mine is configured to get the sound working properly in Guitar Rig 5.

Once ASIO4ALL is installed fire up the amp modelling suite and select ASIO4ALL as the audio device.

realtone_asio1

Whenever a program starts using ASIO4ALL a little green triangle symbol appears in your system tray.  Clicking this brings up the ASIO4ALL configuration menu.  Here you should see your standard PC sound card (probably with a highlighted green symbol next to it indicating that it is the active selection) and your Rocksmith USB Guitar Adapter (which will probably not be selected).  Expand your PC sound card entry by hitting the + and exposing the inputs and outputs.  What you want to do is arrange it so that it looks like mine below, with your PC sound card output selected, your PC sound card input deselected and the Rocksmith USB guitar selected.

realtone_asio3_asiosettings

This might take a little bit of fiddling to select them in the right order – ASIO4ALL has a habit of going all-or-nothing, but trust me it is possible to do it if you find the correct order of operations.

Once this is achieved go back into Guitar Rig and make your input and output selections.  These can be found under the Routing tab.  You want USB Guitar Adapter as input and your PC soundcard as output.

realtone_asio2_routing_in

realtone_asio2_routing_out

While all this is going on I like to have the metronome going, because that way it’s really easy to tell when the output is correctly configured.  If you can hear the metronome and when you strum your guitar you get sound then all is good!

If you strum your guitar and you see the input VU meter move then you know that output is a problem.  If you can hear the metronome but when you strum the input VU does not move then you know that input is a problem.

Lastly, sometimes I have experienced some clicking and clipping using the Real Tone cable in this way.  Often just opening up the ASIO4ALL config menu makes this go away.  Certainly I don’t experience this problem all the time.

This is a different issue to simply interference on the analog side of the cable – which this set up can suffer from (like any guitar setup).  Running the cable too close to your PC, power cables and other electrical devices can impart a hum.  Either have a go at moving the cables around, or do as I do and simply slap a virtual Noise Reduction pedal into your onscreen setup!

Happy shredding…

(UPDATE: here’s a look at a proper dedicated audio interface)


LowBrau – Screen Protector

March 8, 2013

I am trying to keep the controller box as water-tight as possible.  Although I don’t expect it to be hosed down, I can see that with an inherently liquid-based enterprise it is entirely foreseeable that it’s likely to get the odd splash.  At the moment the LCD module simply pokes through a hole in the box, so it needs some sort of cover to seal it all up (as well as provide some knock protection).

All I really want is a rectangle of thin clear plastic.  So I went looking for some trash that could be repurposed.  My first attempt was using an old CD cover.  This proved too flimsy – once the edges were removed it was quite floppy.  In the end I used the plastic from a box of ex-Christmas Ferrero Roche.  I’m sure that an old iPod/iPhone box would work even better (not that I have many of them lying around).

The best way to work the material is to rough cut the sides off to leave a single flat sheet of plastic.  A hacksaw or Dremel cutting wheel works well for this.  To actually cut the final edges of the rectangle (ie the fine work) the best approach is one similar to glass cutting.  Score your line a few times with a craft knife and straight-edge.  The bend to snap along the score line with some flat-nosed pliers.

lowbrau - screen protector cutting

This way the rough stock can be made properly square (as in, given proper 90 degree corners) and the results are quite accurate, straight sides.  Any jagged edges can be knocked back to smooth with a light sanding.

Then all is needed are a few holes for mounting screws and (later) a little silicone sealant.

lowbrau - screen protector installed

As you can see in the photo above, my box has a little dot imperfection where the injection molding has taken place.  I may end up sourcing a better piece of stock and remake using this one as a template.  If that were to happen this would actually be a very quick operation to duplicate the two (this one took about 5 minutes to make).  Or I may just live with what I have…