To calibrate the output offset, connect your multimeter positive probe to the Vo output pin of the amplifier and the negative probe to ground. Apply power to the hardware and observe the voltage on the output pin when no weight is applied to the scale. Slowly turn the trim potentiometer connected to the IAref pin until the voltage on the output pin is around 0.5 volts.
Next you must calibrate the gain of the amplifier. The easiest way to do this is to place a maximum amount of weight on the scale and adjust the gain trim potentometer until the output of the amplifier is 5 volts (the maximum voltage for the Arduino analog input). A good maximum weight for this project is a cocktail shaker or heavy glass filled completely with water (since this is likely the largest amount of weight to expect in a mixed drink). With the multimeter still connected to Vo and ground, place a glass that is full of water on the scale. Adjust the trim potentiometer connected to the Rg pins until the voltage on the output pin is around 5 volts.
Note: If you see the voltage drop on the output when weight is applied to the scale, swap the V+in and V-in wires (load cell signal wires) and try the calibration again.
After adjusting the gain, double check the output offset with no weight applied is still around 0.5 volts. Readjust both the output offset and gain as necessary to get them near the 0.5 and 5 volt values with no weight and maximum weight.
Below is a summary of the calibration on my hardware:
Download the software for this project at the following link and unzip the archive to a folder.
Note: If you have a Bluefruit EZ-link hooked up but are uploading over USB, disconnect the power and ground of the EZ-link temporarily so it does not interfere with the upload of the sketch. Also on an Arduino Nano I found it was necessary to remove the Arduino's Vin power pin while communicating over USB (this might not be necessary for other Arduinos).
Open the Arduino serial monitor and change the baud rate to 9600. You should see a message like the following:
Scale Calibration Sketch
Type OK and press enter to start.
If you don't see the message, try resetting the Arduino.
Follow the prompts on the serial monitor and type OK and enter to start.
The calibration will tell you to remove all weight from the scale and type OK and enter to continue.
Next the calibration will tell you to place something on the scale and enter its weight in grams. For example if I had an object that was 120.5 grams I would place it on the scale and type 120.5 and enter to continue.
Finally the calibration will output two values you need to save for use later. For example I saw these values with my calibration:
Calibration finished! Write down the following calibration values:
ZERO_OFFSET = 103.00000
GRAMS_PER_MEASUREMENT = 1.00061
If you type OK and press enter the sketch will enter a loop where it prints the weight (in grams) of whatever is on the scale. Try placing items of various known weights on the scale to confirm it is reasonably accurate. Based on the Arduino's 10-bit ADC and a full glass of water as maximum weight, the scale will only have around 1 gram resolution.
Now load the SmartCocktailShakerSketch in Arduino and adjust the ZERO_OFFSET and GRAMS_PER_MEASUREMENT #define values with the values you found from calibration. Also adjust the ADC_PIN value for your hardware if necessary. Upload the sketch to your Arduino, open the serial monitor at 9600 baud, and confirm if you type ? (a single question mark) and press enter the hardware responds with the weight on the scale in grams.
At this point the hardware is setup and ready to use with the Android application. Continue on to learn how to use the Android application with a USB connection.