DIGITAL WEIGHT SCALE USING ARDUINO

0
182

In this project, we’ll be “interfacing the HX711 load cell amplifier with Arduino” and using a 16×2 LCD to make a “Weighing Machine using Arduino Load Cell and HX711 Module.” This “Arduino Weight Measurement project” is simple.

The electronic weighing machine uses a load cell to measure the weight of the load. Most load cells use a strain gauge, which turns pressure (force) into an electrical signal. These load cells have four strain gauges that are connected by a Wheatstone bridge.

List of What You Need

We use the following parts to make Arduino Weighing Machine using Load Cell and HX711 Module. Each part is talked about in more detail below.

  1. Arduino Uno
  2. 16×2 LCD Display
  3. Load Cell
  4. Load cell amplifier HX711
  5. I2C LCD Display Adapter
  6. Push Switch
  7. Load Cell Base
  8. Female to Female jumper wires

So, what exactly is a load cell?

A load cell is a type of transducer that is used to make an electrical signal whose strength is directly related to the force being measured. It is basically a device that measures strain and then turns force into electric energy. Scientists and workers can use this as a measurement tool. Load cells measure strain, which helps keep the unit’s integrity when it’s under pressure and keeps people and equipment nearby safe.

HX711 Load Cell Amplifier

In order to conveniently read load cells for measuring weight, a compact breakout board for the HX711 IC is required, and this is where the Load Cell Amplifier comes in. You can acquire very precise weight readings by hooking up the amplifier to your microcontroller and reading the load cell’s resistance as it changes.

The HX711 communicates with other devices via a simple two-wire interface (Clock and Data). The HX711 can be read using the GPIO pins of just about any microcontroller, and there are a tonne of libraries available to make doing so a breeze. The HX711 communicates with load cells via a four-wire Wheatstone bridge arrangement. Most of the time, you’ll see these in E+, E-, A-, A+, B-, B+.

Design & Connections

  • Load Cell and HX711 Connection:

– RED Wire is connected to E+

BLACK Wire is connected to E

WHITE Wire is connected to A

GREEN Wire is connected to A+

  • Interfacing HX711 Load Cell with Arduino. 

– Vcc  to Arduino 5V

– GND to Arduino GND

– SCK to Arduino Pin 2

– DT to Arduino Pin 3

  • Interfacing Zero Setting Switch to Arduino.

– Switch one end Connect to Adruino A0

– Switch other end Connect to Arduino GND

  • Interfacing I2C LCD to Arduino.

– 5V to Arduino 5V

– GND to Arduino GND

– SDA to Arduino Pin A4

– SCL to Arduino Pin A5

LIBRARIES To DOWNLOAD

Softwares to Download

Coding

#include <HX711_ADC.h> 
#include <Wire.h>
#include <LiquidCrystal_I2C.h> // LiquidCrystal_I2C library
HX711_ADC LoadCell(3, 2); // dt pin, sck pin
LiquidCrystal_I2C lcd(0x27, 16, 2); // LCD HEX address 0x27
int taree = A0;
int a = 0;
float b = 0;
void setup() {
  pinMode (taree, INPUT_PULLUP);
  LoadCell.begin(); // start connection to HX711
  LoadCell.start(1000); // load cells gets 1000ms of time to stabilize
  /////////////////////////////////////
  LoadCell.setCalFactor(228); // Calibarate your LOAD CELL with 100g weight, and change the value according to readings
  /////////////////////////////////////
  lcd.begin(); // begins connection to the LCD module
  lcd.backlight(); // turns on the backlight
  lcd.setCursor(1, 0); // set cursor to first row
  lcd.print("Digital Scale "); // print out to LCD
  lcd.setCursor(0, 1); // set cursor to first row
  lcd.print(" 5KG MAX LOAD "); // print out to LCD
delay(3000);
lcd.clear();
}
void loop() { 
  lcd.setCursor(1, 0); // set cursor to first row
  lcd.print("Weight Scale "); // print out to LCD 
  LoadCell.update(); // retrieves data from the load cell
  float i = LoadCell.getData(); // get output value
 if (i<0)
 {
  i = i * (-1);
  lcd.setCursor(0, 1);
  lcd.print("-");
   lcd.setCursor(8, 1);
  lcd.print("-");
 }
 else
 {
   lcd.setCursor(0, 1);
  lcd.print(" ");
   lcd.setCursor(8, 1);
  lcd.print(" ");
 }
  lcd.setCursor(1, 1); // set cursor to secon row
  lcd.print(i, 1); // print out the retrieved value to the second row
  lcd.print("g ");
  float z = i/28.3495;
  lcd.setCursor(9, 1);
  lcd.print(z, 2);
  lcd.print("oz ");
  if (i>=5000)
  {
    i=0;
  lcd.setCursor(0, 0); // set cursor to secon row
  lcd.print("  Over Loaded   "); 
  delay(200);
  }
  if (digitalRead (taree) == LOW)
  {
    lcd.setCursor(0, 1); // set cursor to secon row
    lcd.print("   Taring...    ");
    LoadCell.start(1000);
    lcd.setCursor(0, 1);
    lcd.print("                ");
  }
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here