Ok, first thing is a list of items.
1. Arduino Board
2. AD620 In-Amp
3. WH-B05 Scale from Amazon
4. ICL7660 Voltage Converter
5. Misc Electrolytic Caps
6. Misc Resistors
7. Hook-up Wire
8. XBee Modules (Needed for wireless Communication, but not required)
9. Normaly Open Push Button (For taring, or zeroing out the scale)
I want to stay away from a wire by wire description of all of the connections. I will go into a bunch of detail and explain some of the less obvious connections. Feel free to contact me if you have any specific questions. I'd be happy to answer them. Ok, here we go...
Lets start left to right on the circuit board. For a bigger image, go to the pics page. The first chip is the AD620. Across pins one and eight are two 56 ohm resistors in parallel, giving us 28 ohms. If you look at the data sheet, that gives us close to a gain of 10,000. Seems to work for me, you may need to vary a bit. Pin 4 is -5V coming from the ICL7660. Look at the data sheet for cap values (10uF) and get your V(in) from the regulated 5V from the Arduino. Pin 7 of the AD620 is +5V. Pin 6, the output, the all IMPORTANT output! Notice the resistor and cap? This is our RC filter that smoothes the output. Without it the values jump all over the place. I you put the wire to the Arduino analog input in between the resistor and the cap, we get an ALMOST perfectly steady value. I used a 1K resistor and a 100uF cap. I played with the cap value a lot and 100uF seemed to work the best. If you find something better, please let me know. Now this only gave me a number. I needed to change that number into something meaningful, weight in ounces. To do this I weighed a bunch of things with my wifes postal scale and also weighed them with my scale. After doing the math, I discovered that dividing the analog reading by 10.65 gave me almost perfect results. I was happy. The tie wrapped blue wire in the middle goes to the Arduino. We'll get to those. The green LED is very important. It tells me when the current measurement is done. Very important. So also is the blue pushbutton. Here's why.
As of this version, the procedure for getting the weight of beer is as follows:
1. Press the blue button. This tares or zeros out the scale. Everytime a digital scale is turned on it takes a moment before it reads. It has to compensate for the load cell because temperature affects its readings. We do the same. It doesn't send a zero to the arduino. Mine is a value of about 120. I take 100 readings of the output once the button is pressed and the average of those become my "zero". When the green LED lights up, taring is done.
2 . Set the container, empty or partially full, on the scale and wait until the green LED comes on. This gets that weight of the container so we can subtract that from the weight of the container and the beer for a beer only value.
3. Pour your beer and set it on the scale. I programmed a 500ms delay before weighing to compensate for the jostling of the beer. Wait for the green LED to come on and there you have it, a weight of only beer sent directly to your PC. If your PC is next to your keg, you don't need XBee. If not, you do or we could work on a WiFi version too!
Ok, back to the circuit. the green LED has its cathode going to a 220 ohm resistor and then to ground. The anode is the white wire going to the Arduino, pin 12. The push button has one point connected to 5V, and the other with a resistor (10k) going to ground. In between the resistor and the button is the red wire going to the Arduino, pin 8. The red and black wires leaving the bottom of the pic go to a 9VDC wall wort that powers the entire system including the Arduino. When I was experimenting with the load cell, I found that it worked best with 3.3V. The scale out ot the box used two AA bateries in series which is approximately 3.0V, so this made sense. This load cell had four wires, which is pretty common. It had +/- excitation and +/- signal. The negative excitation goes to ground. The black wire coming from the left is the negative excitation voltage. The green wire goes to the positive excitation, and is the 3.3V from the Arduino. The red and white wires coming from the left are + signal for red and - signal for white. What was cool about the scale that I bought and had no idea of beforehand, was that all four wires were labeled on the circuit board that the load cell was connected to! Red and black to the +/- voltage, and the blue to + signal and white to - signal. I'm not sure what the "I" stands for, but it ended up being signal. Also, I'm not sure why I didn't use red and black for voltage on my board, I just didn't. Feel free to change it on yours.
The Arduino board is pretty simple. Moving from left to right. The blue wire which connects to the green wire is the analog input. Even though it is hard to see, the next wire, red, is the regulated 5V that feeds the breadboard. The next wire, also red, comes from the 3.3V on the Arduino and goes to the Aref and the white wire (again, hard to see, sorry!) back to the breadboard to power the load cell. The next wire, black, is ground. It is very important to "common" your grounds when using multiple power supplies and/or devices. Last, but not least, is the feed from the wall wort to power up the Arduino. That is it for connections! Shall we talk about code?
Serial Output Arduino Board