Load Cell Kitchen Scale

Load Cell Kitchen Scale

Using a 1kg load cell, HX711 amplifier chip and an ATmega328P I created the following battery operated kitchen scale. While some DIY projects help save money, this is not one of them. Cheap kitchen scales can be found for approximately $15 (CAD) and the individual parts for this project total about $50 (CAD). Nonetheless for those tinkerers who enjoy making stuff for the sake of making it the following video tutorial may be useful along with the wiring diagram and programs, down below. Link to GitHub repo.

Wiring Diagram

Wiring Diagram

Calibration Code

#include "HX711.h"
HX711 scale;

#define CLK  A0
#define DOUT  A1

int calibration_factor = 1000; 

void setup() {
  Serial.begin(9600);
  Serial.println("Kitchen scale calibration");
  Serial.println("Remove all weight from scale");

  scale.begin(DOUT, CLK);
  scale.set_scale();
  scale.tare(); //Reset the scale to 0
  
  Serial.println("Place an object of known weight on the load cell");
  Serial.println("Adjust calibration factor using the following keys");
  Serial.println("'a' or 'z' to increase or decrease by 100, respectively");
  Serial.println("'s' or 'x' to increase or decrease by 10, respectively");
  Serial.println("'d' or 'c' to increase or decrease by 1, respectively");
}

void loop() {
  scale.set_scale(calibration_factor); //Adjust to this calibration factor
  Serial.print("Reading: ");
  Serial.print(scale.get_units(), 2);
  Serial.print(" grams"); 
  Serial.print(" calibration_factor: ");
  Serial.print(calibration_factor);
  Serial.println();
  
  if(Serial.available()){
    char input = Serial.read();
    if(input == 'a'){ calibration_factor += 100; }
    else if(input == 'z'){  calibration_factor -= 100; }
    else if(input == 's'){  calibration_factor += 10; }
    else if(input == 'x'){  calibration_factor -= 10; }
    else if(input == 'd'){  calibration_factor += 1; }
    else if(input == 'c'){  calibration_factor -= 1; }
  }
}

Kitchen Scale Program

#include "HX711.h"
#include <LiquidCrystal.h>

#define CLK A0
#define DOUT A1
#define calibration_factor 2153.0
HX711 scale;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int resetPin = 10;
float weight;

void setup() {
  lcd.begin(16, 2);
  lcd.print("Initializing...");
  delay(100);
  
  pinMode(resetPin, INPUT);

  scale.begin(DOUT, CLK);
  scale.set_scale(calibration_factor);
  scale.tare();                           // reset weight on scale to 0 grams

  lcd.clear();
}

void loop() {
  weight = scale.get_units();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Weight:");
  lcd.setCursor(0, 1);
  lcd.print(weight);
  lcd.print("  grams");

  if(digitalRead(resetPin) == 0){
    scale.tare();     // reset weight on scale to 0 grams
  }
  scale.power_down();             // put the ADC in sleep mode
  delay(10);
  
  scale.power_up(); 
}

Show Comments