The project is based around the Arduino and uses a LM35 sensor for temperature measurement, a solid state relay for turning on/off the refrigerator, and a serial LCD panel for displaying the temperature inside the fridge and a handy-dandy button to turn the back-light on for reading beer temperature in the dark! WoW!! .
I consider this v1.0 and plan to update this instructable as I add new and fun things that make beer drinking more pleasurable... as if that can really happen!
Special thanks to Brutus @ brutusweb.com from his proof of concept work, Sean Coates for his advanced work with beer brewing and Arduinos, and an Extra Special thanks to Mikal Hart @ the Arduino Forums who helped me through my coding nightmares!...( I owe him a few beers).
Remove these ads by
Signing UpStep 1Getting the Goods.....
PARTS
-An Arduino or a variant of ...
I used a spare Freeduino SB that I had, I like the miniUSB port.
-A serial LCD panel.
I used a SLCD162 MeLabs
Serial LCD is important since it uses only 1 pin on the Arduino!!
-A Solid State Relay:
I used a NTE RS1-1D4-21,( 15 bucks a piece..) it is circuit board mounted type and I designed my own circuit board to support it.
You can use any similar relay but it must have a trigger voltage of at least 5 volts on the DC side, and can handle around 3 amps or what ever amperage your refrigerator or freeze draws plus extra for head room. You will have to use a bread board or design your own circuit board if you use any other type.
-A LM35DZ temperature sensor.
I bought a few off of Ebay from Thailand for super super cheap, like 5 bucks including shipping... did I mention they were from Thailand? crazy! www.thaishopetc.com
-A couple of resistors:
10k and 100k, 1/4 or 1/2 watt will work fine.
-Project Box:
if you want to protect your circuits from the elements (or drunks) Mine is a standard Radio Shack box, but you can be more creative.
-22 Gauge stranded wire:
The more colors the better. Makes it easy to know what goes where.
-Plex-glass
if you want to make a cool LCD stand like me
-Magnets:
for the cool LCD stand and project box
-Header Pins and Connectors:
for easily connecting the wires to the Arduino, not necessary but makes things look nice.
-Momentary Push Button:
for the LCD backlight function. This is a "normally off" button and is only "ON" when it is held down
-Terminal blocks , 2 position type, PCB mounting
-Heavy gauge extension cord (14 gauge or so)
-Cat5 cable for LCD connection + Cat5 jack
SUPPLIES
Soldering iron
Solder
Beer
Heat gun
PCB board and etchant
Dremal
Gerber Multi-tool
wire-stripper
....more Beer
Circuit_Board.pdf(286x227) 262 KB| « Previous Step | Download PDFView All Steps | Next Step » |










































A word of warning to anyone who tries to replicate the push button portion based on the picture. Is that a mistake with the pull resistor for the push button? This looks like pushing the button would short '5v' to 'gnd', which wouldn't be great. Instead of the the switch connecting to the 5V side of the resistor, instead connect it to the digital_pin3 side of the resistor. That way, it will pull the digital pin3 to gnd when pushed, and the resistor will pull D3 up to 5V when button is released.
I'm sure the real design is correct, and the focus of the attention isn't on the pushbutton, but hope no one shorts out their arduino's 5V to gnd with this. :)
I'll investigate your observations more closely,as it was a few years ago I made this project and haven't had any issues during this time. Pulling a pin high or low can be done on either leg of the switch.. the current flowing to Dig_pin3 is 5volts which is not a problem for the pin to handle... the amperage is only .0005 through the 10k resistor. If the resistor was on the Grd side of the switch and the button was pushed, then the same amount of current (5v) will still flow to the pin 3. The Arduino chip is designed to read data in the form of 0v -5v on the digital and analog pins... so I'm not sure what your concern is?
Thanks for the comment, I love feedback as it helps me to continue to learn and grow!
I'm talking about the pic in Step 1.
It looks like the backlight button is connected to 5V and Gnd.
That doesn't threaten Dig_pin3, but if it shorts 5V and Gnd together when pushed, that sounds bad for the 5V power. A short-circuit to gnd will pull as much current from 5V as the possible (assuming the wires & pushed-switch are all quite low resistance).
Well, I'm also assuming this switch works like mine... open circuit normally, and short circuit when pushed.
So, no concern about arduino data pins. Concern is that pushing switch will connect the red & green wires (5v & gnd) together.
DC current flows from + to - ... what you would refer to as "shorting out".... (that is more of an AC term). Think of this... as a kid I would wrap a big nail in a length of wire and then attach one end of the wire to each side of a battery (+ & -), thus creating a homemade electromagnet. The wire connects the + and - sides together, straight through... and because Electrons flow from high concentrations to low concentrations we have current!
If you cross AC wires then you can get a big mess! (15A's of power compared to 50Ma's with DC) ... DC only works when you cross the wires because current has to flow to be useful!!
But back to the Aurduino... if I had the same circuit with 12V's instead of 5V then I would blow out the pins of the aurduino and short the board out... other than that its okay! I hope this helps...
Cheers!
But, this stuff is actually my profession, so I'm just trying to help since you took the time to make a good instructable, and so I want to pay back since I've been too lazy to make instructables myself (yet). Plus, I'm a fellow new homebrewer! :)
First, don't take my word for it.
Ask a friend you trust, or check out the web, like:
http://en.wikipedia.org/wiki/Pull-up_resistor
Thanks again for the good instructable & cool responses. -Brian
PS: BTW, if you are planning to revisit, I'd recommend referring to Figures 3 & 7 in the LM35.pdf spec.
Figure 7 shows how to get accurate measurements under 2 deg C without a V- (negative voltage) available, and
Figure 3 is good insurance since you're putting the LM35 at the end of a longish wire or cable.
PPS: if you want to know more about what is probably happening in your ckt, or the magnet you describe, or other circuit equations, I can explain more. But perhaps you'd like to see for yourself first.
If so, start by using a volt meter and measuring the voltage of your 5V while pushing the switch. Arduino would like it's 5V to stay 5V, but I'd bet the voltage drops, a lot, but it depends on how much current/power your 5V supply can produce, and how much resistance your particular switch has when pushed.
(I wondered if maybe you have a switch with a relatively large resistance when pushed, but as you describe, in order for the dig_pin3 to see a 'low' voltage, the 5V attached to it's resistor must go 'low'. So that 5V supply wants to take the easy route, thru your switch, instead of going thru the arduino & other ckts. The switch draws SO much current from the source that your source can't keep up the 5V, and droops to a lower voltage.
If it didn't, then something is probably getting hot (the switch?) and providing enough resistance to keep things from actually going worse.) Another way to describe that you don't have a (normal & safe) pullup ckt... the dig_pin3 never has current going thru it, so current never goes thru the R attached in your ckt, so the R has no effect (ignoring transient effects). i.e. it's not acting as a pullup resistor.
PPPS: Check out http://www.dorkbotpdx.org/wiki/pcb_order . It's a sweet (& cheap!) way to make real boards with finer geometries, vias, etc, without having to etch blanks yourself.
You can use eagle design software (free) for smallish 2-layer boards. There's a lot of tutorials & etc for the Eagle (like on sparkfun.com), but the dorkbotpdx dude running the board program is doing something awesome. I've got a lot of 50 5V relays (10A at 125V) that I'm planning to make a simple board for. Just enough for screw-connections (for the AC), the switch, and a transistor so that the arduino digital out isn't trying to drive the relay by itself (the relay coil needs a lot of current to switch on). If I find a cheap optocoupler, might use that too, for extra safety. Hope to use these like you did, but use 2: 1 for heating pad (now that winter's coming) and 1 for the freezer I found that I can fit my fermenter in.
Happy brewing! Cheers!
I've been considering ditching the LM35 in favor of either the LM36(TMP36) because of its -50 to 125 C range or maybe even the Dallas DS18B20 1 wire version. Adafruit.com has both, but has a waterproof version of the DS18B20 that might hold up better in an environment that has condensation and possible beer spills.
Thanks again for all the comments... this isn't my profession, just a long time hobby built out of love for electricity.
One of my friends designs and builds temp controllers which he sells as kits. I've thought about scraping my project and picking up one of his kits since they are so simple to program and use.... and best of all.. they just work!
http://screwdecaf.cx/yatc.html
temp = lm35_val;
to:
temp = (lm35_val*1.8)+32;
I recently pulled out this project and started rewriting the code for better temp sampling and stability. I started home brewing recently and have need to have my beer fermenting at precise temperatures....I hope to have the updated code posted soon.
that would give me the actual temp of the beer.
I built a functionally near-identical (but messier) fridge unit using a chest freezer, PIC, SSR and an I2C thermometer chip.
I tried to figure out for ages why the compressor would periodically lock up and fail to start. I thought the $0 freezer was just a piece of junk.
One day I had a chat with a fridge guy and he said I needed a time delay for the pressure to dissipate in the compressor.
He said it needs a wait of at least 15 minutes to be safe. Unfortunately, I lazily didn't socket the PIC, and can't update the code, so what I do is slowly ramp the temperature down by hand after adding a new keg.
However I'm going to build a new setup soon using some one-wire sensors to track the temperature of the fridge as well as both kegs of beer. I had a few issues with beer freezing on the bottoms of the kegs, so I'm going to add a "beer about to freeze override" system, as well as a compressor start delay.
Also maybe some strain gauges from a dead scale to measure the weight of the remaining beer? 1L beer = ~1kg...
I got 2 5-gallon kegs of local stout in there right now, yum! Enjoy your fridge, silverhalo!