Let me start this post by saying the response to my first post has been fantastic. I had 50.000 page views last week and was featured by RaspberryPi.org, Wired.com, Adafruit, Hackaday and Slashdot. There are now 64 registered forum users and 158 twitter followers. Looks like a lot of brewers can’t wait to start building. I hope this post will help with that.
I actually wanted to start my first brew with BrewPi today, but unfortunately my yeast died on me. The Wyeast (Weihenstephaner) 3068 smack pack had been sitting in the fridge since February, because I had been so busy with BrewPi and some other projects. I tried to make a starter anyway, but no luck. So “Raspbian Wheaty” “will have to wait until tomorrow.
I have also ordered some Better-Bottles all the way from Sweden (hard to get around here) and started adding sensors to them. I will post some brewing setup pictures later. This post is about soldering your own BrewPi Arduino Shield!
Do-It-Yourself or buy fully assembled.
I have started a thread on the forum to check for interest in a fully assembled Arduino shield. There seemed to be enough interest to do a small production run. So if you suck with a soldering iron or simply don’t have the time to build the shield yourself, you will be able to buy one soon. I think it will take at least 3 weeks, so if you want to get started right now, you will have to build one yourself.
You will be able to buy the shield with all components soldered or just the surface mount parts. The shield will also have a thermocouple interface and I will use a shift register for the LCD to free up some additional pins. So for the coffee roasters out there that would melt DS18B20’s, this would be better for you.
You can discuss the desired features for the Arduino shield in this forum topic. Eventually I would like to use an ARM processor, but that will probably take months. So to get you started soon, I’ll make some Arduino shields. All other components (sensors, SSR’s, display, rotary encoder) will stay the same. So if you want to upgrade later it will not be expensive.
The shopping list for the BrewPi shield can be found on the wiki. I want to keep it there, so all of you can add links to sellers.
BrewPi Shield layout for the Arduino Leonardo
I am using an Arduino Leonardo with my BrewPi shield and they layout I posted in the first blog post is only suitable for the Leonardo. The photo’s in this article will be for the Leonardo shield! If you are using an Arduino Uno, check the differences at the bottom of this article.
You can download the Arduino shield layout in a PDF document (schematic, top view, bottom view), or as Eagle files. This layout uses 0.1 inch pitch so you can translate it directly to a perf board layout. I think this document should be your guide when soldering, but below are some more pictures to clarify some details on how to do it.
As you can see in the photo above, the shield is mostly just connectors. If you are not planning to use JTAG (you need an AVR Dragon for that) you don’t need the bottom connector.
Here is a view from the bottom, but please use the PDF document to see what you should connect.
So lets talk about how to create tracks like this. I have used perf board with round connectors, because that was what I had lying around. Rectangular pads are easier to solder together to create tracks.
Now some basic notes on soldering:
- Don’t set the temperature too high and work as quick as you can. Solder contains flux to make it flow easily. The moment you start heating it, this flux will evaporate. With flux, the solder automatically flows to the copper. Without it it will get pointy and hard to handle. If your connections look dull, you worked too slow. So always first apply heat to both the pad and the pin and then add solder. Don’t add solder directly on the tip of your soldering iron: the flux will evaporate before you start.
- For short tracks, you can solder pads together. To do this, set your iron to a lower temperature. Then add a blob of solder to both pads. Next put a bit of solder on the tip and directly touch in between the pads. If you are lucky they will melt together. It takes some practice to get it right.
- For longer tracks (>3 pads) you should use a stripped piece of wire to make the connection. You can solder it to the board on the bottom side.
Dealing with the Arduino headers
The makers of the Arduino thought it was a good idea to give one of the headers a half pitch offset instead of aligning it to the grid. It probably prevents some wrong insertions, but it’s a bitch when you are using proto board. I dealt with that issue by using 90 degree angled headers. You can use some pliers to twist them just enough to bridge the half pitch offset.
To prevent a short circuit under the header pin, I removed the copper pad there. This is very easy to do by setting your soldering iron to 400 degrees and touching the pad. It will fall right off. That’s the only advantage of the often crappy quality of these boards.
For the other headers, you can use normal straight headers. You do have to solder them to the bottom, unlike all other components. Because you probably only have copper pads on the bottom, you will have to float them above the board a bit to be able to solder them to the bottom pads.
The display and rotary encoder
I used a 10 wire flat cable to connect my display. I removed one wire because I only needed 9. This OLED display has solder jumpers on the board to set it to maximum brightness. For other displays might need to connect pin 3 for the contrast adjustment.
I soldered the flatcable directly to the display and added a 100uF capacitor on the power supply.
For the rotary encoder I used a small board to connect it to a male header. I used a 4-pin MOLEX connector for the cable.
If you have to choose a rotary encoder, two things are important:
- Get one with a built in switch
- Get one with detents. Detents are clicks you can feel when turning the knob. It is easier to set a temperature with this feedback.
Note that the display and rotary encoder are optional. You can control BrewPi from just the web interface.
On the other hand you can also control BrewPi from just the display and rotary encoder. The basic functions (everything displayed on the menu) can be set with the rotary encoder. To configure your setup (PID parameters, all advanced settings) you send settings over the serial port.
Hacking your fridge
What I did to give the Arduino control of the fridge temperature is to cut one of the power wires to the compressor and to the light bulb. With a knife you can cut through the PCB track and get underneath the cut part to completely remove it. Next you can scrape of a bit of solder mask to be able to solder a wire to both sides of your newly created gap. These wires will be rerouted through a relay that is controlled by the Arduino.
I completely removed all connections from the door switch to the 230V fridge circuit. The door switch is now an Arduino input and the Arduino turns on the light when needed. I have done this to be able to see when the door is open and because for now I use the light bulb as a heater. I still have to find out whether the light of the incandescent light bulb skunks the beer. Some people say it does a little, other say it doesn’t. Fluorescent lighting is very bad, incandescent not so much. Of course you can always wrap your fermenter in a t-shirt, but I bought transparent better-bottles to be able to watch my beer ferment. I just bought a webcam for inside the fridge too
And here is a picture again of the DIN connectors I used to be able to disconnect the temperature sensors when I want. DIN connectors are very cheap and very robust, because they are an industry standard.
A shield for the Arduino Uno
There is a small difference between the Uno and the Leonardo that makes the Leonardo shield incompatible with the Arduino Uno.
The Leonardo has an Atmega32u4, which has USB built in. The Arduino Uno is based on the Atmega328 and uses an Atmega8u2 for the serial to USB conversion. But the serial pins of the Atmega328 are also connected to pin 0 and 1, so it is best to avoid using these pins when you are using the serial port. This means the rotary encoder has to move.
The Uno does not have JTAG, so the rotary encoder can move to the analog pins. I do have an Arduino Uno and will add a version of the rotary encoder source files that will work with the Uno. I have created a new branch in the GitHub brewpi-avr project for the Atmega328.
I can also do a quick reroute of the Eagle files for an Arduino Uno shield. I have not had the time to do it, but I will make sure to post it this week.
The assembled version of the Arduino shield will be compatible with both Arduino variants.
Good luck with your build!
So that’s about it for this update. I hope this somewhat more detailed build log will help you in building your own BrewPi fridge. If you have any questions, post them in the comments or on the forum.