Wie wil meedoen met de solarbike zelfbouw club?
Who wants to join the solarbike DIY club?

Digital kitchen weighing scale interface for Arduino

Published: 20 December 2011
Last updated: 29 September 2018
Content [Show/Hide]

Intro

For a hub motor test stand, I needed a weighing scale which can be read out by a computer. Therefore I developed an interface program for the Arduino to read out the scale. There is no additional electronics needed, just two wires between the internal scale electronics and the Arduino.

Kitchen scale with interface cable

Tare . done
0
0
118
118
118
0

Kitchen weighing scale electronics

A digital scale consists of a load-cell, an analog-to-digital converter (ADC), a processor and a LCD display. The scale electronics will be left intact. The electronics of the scale that I used has a dual-slope integrating ADC that has been built with some integrated circuits. This dual slope ADC has a 5V digital PWM output signal that can easily be converted by the Arduino to the weight in grams. The PWM signal is taken from pin PA2, see the image.

Digital kitchen weighing scale electronics

Kitchen scale dual slope ADC signal

Kitchen scale output PWM signal 5V 20ms

Interface hardware

I have not investigated if any scale can be used, because we need a PWM output signal. We use an Arduino with USB connection, such as the Arduino Uno or a Nano. Connect the digital scale PWM signal with the Arduino interrupt pin d3. It is wise to have a 10kΩ resistor in series with the PWM signal.

Scale interface hardware

Calibration

The interface must first be calibrated. Take the gain = 1 and offset = 0. Measure different weights and load the values in Excel. Now the conversion value (gain) can be read from the chart formula, see the example. The gain is 0.0378, which has to be filled into the library.

Scale interface calibration with Excel

Taring

After switch on, the Arduino automatically determines the offset, this is called taring.

Auto zero

Because of electronic drift, scales will fluctuate slightly from zero when nothing is on the tray. In order to correct this, an auto-zero function keeps the scale display at zero if the weight is between about -2 and 2 grams.

A drawback is that no weight can be measured of a few grams, but a kitchen scale is not meant for this too. Since the scale does not know the difference between electronic drift or a real weight of 2 gram, a weight of 2 gram will be displayed as 0 grams. See the links below for common scale accuracy problems. The drift nulling function can be disabled: scale.getWeight(0);

 inline void Scale::calcDrift() { if(nonzeroed > -3 & nonzeroed < 3)   { if(gram < -0.5) drift -= 0.2; // correct drift slowly     if(gram > +0.5) drift += 0.2;    } }

Customizing the scale

The Arduino scale interface has the advantage that the software can be customized. This creates interesting possibilities. You can for instance disable the auto zero function, perform automatic statistical analysis or try to improve the scale accuracy.

Software

For the latest software you can ask me. The scale interface uses the library FreqPeriodCounter, see HERE. For troubleshooting see HERE.

Digital kitchen scale calibration

A kitchen scale can easily be calibrated by weighing for example 3 pounds of oranges in a grocery store. Assuming the shop scale is calibrated well, you can calibrate the kitchen scale with the oranges. You need to adjust the value const float gain in scale.cpp. The accuracy then becomes about 0.2%. My Arduino interface follows the scale over the entire range from 0 to 3000 grams with a maximum deviation of about 2 grams.

Suitable weighing scales

Not all digital weighing scales may be suitable, it is important that the electronic is not completely sealed. My scale is no longer available, who has recently purchased a suitable scale?

Scale interface main program

 #include #include   #include   const byte scalePin = 3; const byte scaleInterrupt = 1; // is pin 3 too #define LCDupdate_ms 500    Scale scale(scalePin);   void setup()  { Serial.begin(9600);   attachInterrupt(scaleInterrupt, scaleISR, CHANGE);   Serial << "Push scale tare button ";   while(!scale.tare()) Serial << ".";   Serial << " done"; }   void loop(void)  { static unsigned long lastLCDms;   if(millis() - lastLCDms > LCDupdate_ms)   { lastLCDms = millis();     Serial << endl << _FLOAT(scale.gram, 0); // todo -0 -> 0   } }   void scaleISR() { scale.getWeight(1); }