BrewPi Arduino Shield: Ready for approval!
  • Hi Guys,

    It took a bit longer than expected, but I have finally finished routing a shield for BrewPi.
    I have tried to make the shield compatible with both the Uno and Leonardo, while maintaining expandability.
    The Arduino shield has a 10 pin connector to the LCD board and the LCD board has a 4 pin connector to the rotary encoder board.

    On the LCD board is a shift register to save some Arduino pins. 7 pins of the shift register are in use, the 8th is routed to a header. There is also one free pin on the 10 pin connector. This pin is also available on the LCD board, together with GND and 5V.

    I have settled on the following pin mapping:


    As you can see, the Leonardo pin mapping is way different from the UNO, which makes backwards compatibility a bitch. I tried my best to make the shield compatible with both, without sacrificing expandability and hackability.

    This mapping results in:
    - RX/TX free
    - HEAT/COOL and BUZZER on a PWM port
    - JTAG available on the Leonardo
    - I2C (SCL/SDA) is available on the Leonardo by moving two 0 OHM jumper resistors.

    There is a big proto pad in the middle to enable hackers to use the free pins.
    All Arduino pins have a double header row. One is for the shield connectors, the other makes it easy create connections to the proto pad.

    The HEAT and COOL output are compatible with relays and SSR's. There is a schottky diode between 5V and the + pin of the outputs. This allows you to use a higher voltage for relays. The - pin is an open drain pin, about 300mA.

    The output pins of the shift registers are: RS, E, Backlight, free (header), D4, D5, D6, D7. Reading from the LCD has been sacrificed. The latest version of brewpi-avr already keeps a copy of the LCD contents in avr memory, so reading is only used to check the busy pin. This will be replaced by a simple delay.
    The backlight has a 10 ohm resistor, which can be bridged by a solder jumper.

    Enough explanation, here is the schematic:


    And the board layout:


    Please comment on anything and everything. I don't want more delays, so I will probably order these in bulk right away.

    I plan to make them available as bare PCB, with SMT components soldered and fully soldered.
    I will start sourcing parts now, to be able to offer a complete kit.

  • 61 Comments sorted by
  • Yep, in the end I put in all your requests ;)

    You shouldn't underestimate the role the Pi is playing. It runs python scripts, not just a web interface.
    If you want to change settings remotely or want to be able to use profile mode, you need the Pi.

    Boards are ordered by the way :)

  • Goddamnit palitu, you scared me!

    I was playing cards with my friends and got a notification e-mail of your message, but could not properly check the files. Pin 9 is not connected to anything, pin 8 is connected to the ground plane.

  • Elco,

    Thanks for taking on this work. I haven't had a chance to do a through review however two points, one is probably quibbling. Typically I pad out the gates of MOSFETS with some series resistance to prevent ringing that can occur with the trace inductance interacting with the gate capacitance; I believe in general it's a good practice.

    The second thing and correct me if I'm wrong. Did you experience issues with the NewHaven OLED display which required tacking on a fairly sizable amount of capacitance to stabilize the input voltage? I see a couple of your de-facto sort of 100nF ceramic bypass but nothing on the order of 10uF or whatever it was seen soldered directly to the pins of the display. Did you find this wasn't necessary at some point down the line?


    James R.

  • Hi Elco,

    Thanks for this, it looks like a very intelligent design, I like the way you are creating compatibility for Uno and Leonardo and also scrimping on pins and offering proto space and other outputs, its very nice...

    Its obviously incompatible with the previous shield design and current AVR software

    so i guess you'll make a new branch of the software to support this design...

  • @James
    The input capacitance of the 2N7002 is 30 pF, so in this case I think a series resistor is just an additional component that is really not needed.

    About the capacitor: I choose 100nF, because it is the only value on the board so far. I changed some of the initialization code of the display, so it might not be needed. If I ran into problems, I can always put a 10uF cap on the 0805 footprint.

    The displays have pretty big capacitors on their board themselves, so actually an external capacitor should not be needed.

    Yes, I will make a new branch for the shield. Well, likely this will become the master branch and I l'll branch the old DIY shield code.

  • Some small updates, LCD connector pin numbers, moved to bottom for clarity.
    Changed 0805 jumpers to solder jumpers from the SparkFun library.


  • Added indicator LED's for heat and cool:

    Had to move a lot of things to fit that in, but really helpful when debugging.

    New schematic:

  • I could swap the molex connectors for flat ones, so they connect to the side, just like the screw terminals.
    Goes for the rotary encoder connector as well. Opinions?

    Another thing I was wondering: is the turn direction of the contrast pot ok? I have relabeled it constrast btw.

  • Elco

    looking good , on the board layout is the ground plane a bit bumpy (ie protruding ends of fill in tracks) and too close to the track that comes from 3 (d2?)  round under the display connector mounting hole ?
    Richard P
  • ah those are just rendering issues. Here is a higher resolution:
    It still doesn't appear straight, but it is.

  • Alternative layout, with 90 degree flat connectors for onewire.
    I kinda like this one, because all fridge connections will exit on the same edge in the same direction.

  • well i am excited.  My Leonardo just arrived today (never DX again).  so looking forward to starting up my foray into micro controllers and beer.

  • My Leonardo is also waiting to do some work! It looks really nice!

  • I have printed out the layout and checked alignment with some of the components.
    Some points of concern:

    • The 10 pin connector with lever is huge! It is 2,7 cm high. I can image a lot of people want a lower profile connector to be able to fit this in a box.
    • The USB connector of the Arduino Uno is high. It will touch the underside of the PCB at the screw terminals. Arduino Uno users probably need to stack some extra headers in between. I don't see how I can move the screw terminals to prevent this.

    @palitu: I stopped ordering for dealextreme a long time ago. You can get the same stuff on eBay and it ships immediately. DX is not what it used to be.


  • Now with fancy logo:

  • Looks fantastic. I'm most of the way through making my own DIY shield, but I'll definitely get one of these once they're available. I don't suppose you have any idea of what the cost and shipping will be?

  • Not yet, I will find that out after this weekend.
    Shipping, by regular mail will be cheap, 3-5 dollar probably.

  • I'm all for the lower profile connector without the lever, too. I don't think the added security for the cable is worth the added height or cost. Even if it is only a few cents.

  • Elco,

    I would ditch the lever locks they're massive. The only real benefit is their ability to easily eject the cable; the whole notion of positive retention on a stationary device is a bit silly. They're not going to shake loose and assume they did; there's really no consequence. There are shrouded headers which will receive clip that snaps over the top if you absolutely need retention that badly and the clips are dirt cheap. That or you can just use a little glue, that's actually what we do in production for most of our products.

    As for the screw down terminals, not a huge fan of them...they're so bulky. I like the addition of the LED's Blue for cold and Red for heat? Inside the same LED? :-)


    James R.

  • The screw terminals are just an easy, solder free way of connecting things. Could be two pin headers, too, but screw terminals are a bit more sturdy. The SSR's often have kinda big screw clamps, which makes it easier to use a thicker wire. A screw terminal on the board makes that possible.

    I could even use mini screw terminals for the temperature sensors, so you don't have to solder a connector to the sensors. These are expensive though and require a mini screw driver.

    I will use a red and blue LED.

    I have swapped the big connectors for smaller, normal ones. This allowed me to give the JTAG header a bit more space. It also made space for a screw hole on the LCD board.
    The screw holes on the LCD board probably will not be used, because it is a backpack, but its nice to have them. The rotary encoder will be mounted through a panel, so it does not need the holes.

    Here is the new layout. If I get enough feedback, I could send them to the fab house on Monday.


  • @Elco: I'm curous how or if all of these boards and shields (excluding the pi) might stack up together (e.g.

    @James: FYI, I was targeting the vacant exterior area of the chest freezer just above the control dial for the pi display and knob.  The interior of the compressor compartment is spacious, and I was hoping to stack the boards (again, excluding the pi) right behind the display to keep things tidy.  Just an idea for an "enclosure"...

  • Elco,
    Great work!
    a.) LCD module back light current
    The spec for my chosen 4x40 blue LCD back light current is:- 150mA max with forward voltage 3.2 volts
    For power dissipation reasons change R2 for two 33R 0805 resistors in parallel. (use 1206's if room)
    b.) IC1 pull up resistors
    Consider adding 10K pull up resistors to the IC1  LCD_CLK  and  LCD_CLK  signal inputs.
    This will help with longer 10 way cables. (>1m)
    c.) LCD board decoupling caps
    1 x 10uF and 2 x 100nF ceramic suggested.

    Pleased to see the Q2 and Q3 Fet's are now 2N7002.

  • Thanks for your excellent suggestions.

    a. You are right about the power dissipation. It will be about 300 mW. Replaced with 2 1206 resistors in parallel. Why 33? For your specs it should be 24, maybe 27 to be safe.

    b. Added pullup on CLK and DATA. Changed Latch pull down to pull up too.

    c. Why use 100nF AND 10uF when using MLCC's? Having a big and small cap is from the electrolyte days I believe. The 100nF and 10uF are also so close to each other that I basically already have a small and big cap. I changed the LCD cap to 1206 too.



  • By the way, I am also looking into selling complete kits:

    This board + LCD + SSR's + cables + DIN connectors + DS18B20 sensors. You just have to get the fridge and thermowell yourself.

  • If it helps to gauge interest, I would would prefer to purchase a complete kit.


  • Hey Guys,

    Hopefully this will be the latest update.

    It kept bugging me that the HEAT and COOL outputs did not have a proper ground connection.
    I still rather had a GND and 0/5V pin, so I decided last minute to change circuit to a P-Channel MOSFET equivalent.

    The open drain setup with NFET's wasn't really suitable for use with higher voltages, because when you are not using the 5V line, what is your reference voltage?

    This P-Channel MOSFET setup is easier to understand and can source 180mA at 5V. So it is able to drive relays and can be used as a true digital output. If you want to use actuators with a higher voltage, just add a transistor circuit yourself after these outputs, using GND as a reference.

    I changed the backlight setup to use the same P-Channel MOSFET. Any comments on the resistance for the backlight?


    Holes at the top are to align the solder paste stencil.

  • Hi there,

    I did two things today that I thought I should share as they might have a bearing on the board design.

    1) I started hacking a fridge.  This one does not have much space to get a wire inside it, and there are 3 things that need to go inside the fridge : power to 'heater' (light), sensor one and sensor two. This made me think - perhaps the things going into the fridge proper could all be in one cable - even if they are being split into seperate connections within the fridge (e.g. 2xDIN connectors for sensors) - this *could* mean putting, or having the option to put, both sensors, and also perhaps the heater circuit into a SINGLE connection leading a single cable into the fridge (5/6 core) ....

    2) I've started playing with (used to be pachube) - an online service for capturing data from sensors (I thought an idea place to 'push' temperature data from brewpi.   Then it occurred to me, if the shield was compatible with the ethernet version of arduino (i.e. no pin conflicts, and no conflict with connectors etc.) then it could potentially run without the Rasbberry PI and push its data feeds direct to  it seems pins 10,11,12 and 13 are needed for the on-board ethernet controller...
    would also need to look at physical size to make sure it doesnt clash with the ethernet socket...
  • <style type="text/css">p { margin-bottom: 0.21cm; }tt.cjk { font-family: "DejaVu Sans",monospace; }</style>

    Hi Elco,
    1.) I would have kept Q4 and Q5 as 2N7002, but no real objection to
    you using the P-Channel BSS84 Fets. (I will use SSR's)
    Are pull up resistors required on the Gate pins of Q4 and Q5? During
    Power On Reset (Or Reset) of the Arduino Leonardo ATmega32U4 the PC6 and
    PD7 pins (Or Uno ATmega328P PD5 and PD6) go tri-state, according to the
    data sheet. Without pull ups Q4 and Q5 might randomly turn on during a
    processor reset. Not ideal. I have not previously used ATmega processors
    before - so this may not be an issue.
    2.) I will probably change the values of R4 and R5 to suit the chosen
    LCD display optimum back light level. 33R just seemed a good 'middle of
    the road' starting value.

    3.) Decoupling Caps. Yes your choice of decoupling caps look OK.
    4.) R14 value. Changing R14 to 4K7 is a good idea. Making R14 1K - better still?
    I hope this helps.

  • Hey Elco, do you ahve a timeframe for when this will be done?  I am trying to work out whether i build one, then get the kit, or wait for this to come out.

  • @JohnCass
    1. With the current layout it is possible to connect a 6 strand cable to the connectors. This is easier to use and to understand for most people I think. You can have just one ground wire, which you split when in the fridge, but for most people this will only make it harder.

    2. This is also something that would not be used that much probably.
    To keep SPI usable, I would only have to relocate pin 10. A SPI device only communicates when SS is active. But there are no pins to move to, while maintaining compatibility with both the UNO and the Leonardo. 1-2: keep free on the UNO to not mess with serial communication, 2: SDA on the Leonardo. A0-A3: JTAG on the Leonardo.
    The best candidate would be 2, so I would have to swap 10 and 2. This would free the default SS pin. I used it because it makes sense to use it, but so does everybody else.

    1. If there is room, I'll add them. Especially with the Leonardo, which is in bootload mode for 6 seconds, it makes sense.
    2. Ok, I'll play it safe and use 33. The visible difference between 100 and 150 will be small.
    4. With 4K7 the current will be 1mA. I think increasing it further is not needed. Some fridge door switches conduct when the door is closed, so this current will flow continuously.

    I want to order the boards this week, but I am going snowboarding in 12 days. I don't think it is realistic to promise assembled boards before Christmas. But I think the first week of January I can ship them.

  • Done.

    • I chose to keep pin 10 as the SS pin. If the SS pin is set to input, the SPI will go into slave mode. By using it as latch pin, I avoid problems for me to solve when people start using it as input. The Arduino Ethernet is as expensive as a Leonardo + Pi, while sacrificing features.
    • Added pull up resistors on gates (backlight fet doesn't need one)
    • 2x33 Ohm for LCD backlight
    • Changed pull down resistor on heat/cool outputs to 1k

    Want a fancy board color? Green, red, blue, yellow, black or white?




  • Hey Elco, 

    (I just realized this is probably not the best place for this post, hopefully it is OK as it related to the board design you are working on)

    Just joined the forum.  Awesome project.  I am new to the rpi, but have some experience with the arduino, looking forward to getting involved with this project.  I have a chest freezer just waiting to brew some beer :)

    I was wondering if you have ever considered kicking off some sort of campaign to bootstrap this project?  We all know how successful has become, I also just stumbled across this today: .  

    I am thinking that a funding platform could get the word out even further about this project, and help set up a supply chain for the modules.

    Anyways, just a thought, great work!  My rpi is on backorder and should be ready to ship mid January, then I will be all over this.

  • Hi Mike,

    For this shield, I don't really need  external funding.
    For the next board, which will include SG sensing and a beefier Cortex ARM, I will use KickStarter.

    This board is to help you guys get started soon, so I will fund it myself to not cause delays.


  • How about a nice hoppy green??

  • I can only get default PCB green. So if you want to stick to beer related colors, its yellow with black silkscreen.

    Here is how that will look:

  • Elco,

    Looks good man. I don't think you really needed to switch over to P-Channel FET's but it matters not to me as I'll be using SSR's that really don't care that much about the drive voltage and such, it'll work fine either way.

    An idea I was kicking around was maybe you could put a pattern within the pattern of the screw terminals that allows for those lower profile right angle connectors. I do that a lot in layouts, co-location of alternate component styles. I also do things with build options like putting parts under parts such that it's physically impossible to co-mingle build options. For instance if you're say bypassing some buffers you put the zero ohm resistors under the package of the buffer on the same side such that the two can never be installed at the same time, i.e. a weird illegal configuration. I've worked at a fair number of places that did small hand stuffed run, obviously with PnP machines such things aren't a valid concern.

    Anyhow the reason I bring up low profile is because I'm contemplating putting the SSR's, bulky outlets and power cords etc into a remote power box to sit on the floor behind the freezer. The display, RPi, Arduino and all of that will go inside of either a pre-bought deep picture frame or one that I make myself. The two boxes will just attach through an umbilical cord.

    The benefit is this. I think all the high power electronics should be in a durable flame proof enclosure for safety reasons and so that the housing can be properly grounded. That isn't terribly compatible with for instance having a WiFi dongle in there. So stuffing it all into a picture frame type thing gets me a few things. The frame can be wood which is RF friendly relatively speaking. The front, "glass" can be Perspex/Acrylic which we can all handle cutting cleanly enough to look nice in a frame. Finally making your own bezel for a display is hard. I own a professional Mat cutter for framing pics which means I can make a very nice, closely trimmed opening in a good looking mat to have the display peek through. The front, "glass" being acrylic the encoder can come through's too hard to drill glass reliably.

    The lower the profile of the connectors the less deep this whole frame needs to be!

    How much do you expect you're going to want for the boards?



  • @James,
    I don't understand what you mean by the alternative connectors. If you have an example of the low profile connecters I might understand it. I plan to something like this:
    I could put a 7 pin header under the onewire connectors.

    But if you order the board without the through hole components soldered, you can also just solder wires to the pads.

  • Will you be making the eagle files public? :)


  • I have postponed that decision so far Carl, make your argument ;)

    New requests for the shield layout keep coming in. Thanks! But it does make it difficult to wrap this up!..

    So new layout:
    - 8 pin connector as alternative to screw terminals and molex KK.
    - Pin 10 can now be freed, for possible SPI compatibility with an Ethernet shield (still don't think an Ethernet shield is a good idea, but adding this possibility is free)




  • Elco,

    All I meant is you could put inside of the Cool, Heat and Door patterns provisions for connectors more like the Onewire1 and 2 connectors but in 2 pin versions. If someone buys the shield unpopulated they can just solder in whichever type of connector they prefer. Possibly the screw terminals aren't substantially taller than the right angle molex? If that's the case it's all moot really...

    I would be careful of the constantly moving goal posts, I think this is a really solid first pass...gets some boards printed and expand the base! Honestly I think your project deserves way more focus than it's getting now, the sooner the whole thing is more plug and play the sooner less techy types of people can start adopting this system. Having to assemble ones own shield may be too much for some, having turn-key pre-assembled ones is a good idea.


    James R.

  • James, the screw terminals just have a 5.08mm pitch, so they are really standard footprints.
    The are not that big.

    Anyway, this should be the final version then. I am getting sick of this work too ;)

    I gave the diodes a wider footprint and sacrificed the screw hole. It isn't usable anyway, because of the header, but that is how it is spaced on the original Arduino board.


  • Elco, with all your work on this project - don't make the eagle free: you deserve to make a few bucks off these boards.  i am donating  what I can tonight, and will buy you plenty more beers in the future. when you get these made I will defiantly buy one !!!

    best regards,

  • Not much for making good arguments but:

    I would like to make a Raspberry Pi shield with an arduino Pro Micro (also uses the ATmega32U4 like the leonard) plugin-card. I see no reason to change your LCD or rotary boards. The shield would not be changed all that much. I would need to ad a CD3040 to convert the 5v tx/rx to 3,3v and change pins for the onewire.

    Smaller package and no need for USB between the Pi and the arduino :)  One box with the Pi and SSRs on top of the fridge and another small one on the front of the fridge with LCD and encoder.

    You already posted the circuit but it would save some time if I did not have to copy ;)

    Of course I would post my work and the result. I have no interest in making money. I just want it small and no USB :)


  • @Elco - would a 6 pin socket fit across both 3 pin headers for the sensors? (looks like spacing between them is slightly > 2.54mm) - this would help for putting both sensors onto a single cable for taking into the fridge.

    @Carl - a "shield" for the PI sounds interesting but seems like it would require a very different design from this shield, you'll basically be starting from scratch I think...
  • @elco - thanks for freeing pin 10! 

    I agree that ethernet shield may be less interesting for most but has some benefits; cheaper (40euro), lower power, less connections and the possibility to have the UI reside in the cloud...
    of course you lose the benefit of calling it 'pi' though ;-(, "Brewduino" ?
    only concern now is that the shield may conflict with the ethernet connector, but I guess I can use extra long headers!
  • I wonder if one could fit 2x small 5v relays on the prototyping pads area....

    (e.g., I think 2x would fit...)

    just thinking it could be nice to be able to use the screw terminals to connect directly to the power cables of the compressor/light.... (i.e. no external ssd..)

    Appreciate it may be too late for this version of the idea for the future...(or I can try it on my board and see what happens....)

  • @elco - oh! I hadnt event noticed the 8 pin header you put for single cable to fridge - awesome, thanks!

  • great elco, cant wait to see the boards for real!

    I'm thinking that an ethernet arduino can be controlled remotely from a server via a secret key - this is exactly what platforms like are designed for....arduino publishes sensor readings periodically, you get real-time graphs etc. -  and you can build an app on top of cosm which can send commands back to the arduino...

  • John,  if you have a server running regardless than cool,  but the pi would be a lot cheaper - most likely less hassle to maintain than having a server back-end, don't you think? The pi can sit quietly in a closet or basement and you'll never see it on your electric bill. IMO. Also, having the data stored local verses in the cloud seems to be the way to go - what if the cloud or your internet connection goes down?

  • Just in time before my snowboarding holiday: check out the blog for pictures of the new PCB's!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google

In this Discussion