Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Nano Based Weight Scale with HX711 and I2C LCD Display

Image of Arduino Nano Based Weight Scale with HX711 and I2C LCD Display

Circuit Documentation

Summary

This circuit is designed to measure weight using a Load Cell and display the readings on a 16x2 I2C LCD. The Load Cell's signals are interfaced with an HX711 Bridge Sensor Interface, which is responsible for converting the analog signals into digital data that the Arduino Nano can process. The Arduino Nano serves as the central processing unit, running the embedded code to read the weight measurements, perform calculations, and control the LCD for output display. The circuit is powered by a 9V Battery, and the Arduino Nano regulates the voltage for other components.

Component List

HX711 - Bridge Sensor Interface

  • Description: A precision 24-bit analog-to-digital converter (ADC) designed for weigh scales and industrial control applications to interface directly with a bridge sensor.
  • Pins: E+, E-, A-, A+, B-, B+, GND - GROUND, DATA (OUT), SCK - CLOCK (IN), 3.3/3.5V Supply

Load Cell - Red/white/black/green

  • Description: A transducer that converts force into an electrical signal and is used here to measure weight.
  • Pins: E+, A-, E-, A+

16x2 I2C LCD

  • Description: A liquid crystal display capable of displaying 16 characters per line across 2 lines, with an I2C interface for communication.
  • Pins: GND, VCC, SDA, SCL

9V Battery

  • Description: A standard 9V battery used to provide power to the circuit.
  • Pins: -, +

Arduino Nano

  • Description: A small, complete, and breadboard-friendly board based on the ATmega328, offers the same connectivity and specs of the UNO board in a smaller form factor.
  • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK

Wiring Details

HX711 - Bridge Sensor Interface

  • DATA (OUT) connected to Arduino Nano D3
  • SCK - CLOCK (IN) connected to Arduino Nano D2
  • 3.3/3.5V Supply connected to Arduino Nano 5V
  • GND - GROUND connected to Arduino Nano GND
  • E+ connected to Load Cell E+
  • A+ connected to Load Cell A-
  • E- connected to Load Cell E-
  • A- connected to Load Cell A+

Load Cell - Red/white/black/green

  • E+ connected to HX711 E+
  • A- connected to HX711 A+
  • E- connected to HX711 E-
  • A+ connected to HX711 A-

16x2 I2C LCD

  • GND connected to Arduino Nano GND
  • VCC connected to Arduino Nano 5V
  • SDA connected to Arduino Nano A4
  • SCL connected to Arduino Nano A5

9V Battery

  • (-) connected to Arduino Nano GND
  • (+) connected to Arduino Nano VIN

Arduino Nano

  • A4 (SDA) connected to 16x2 I2C LCD SDA
  • A5 (SCL) connected to 16x2 I2C LCD SCL
  • D3 connected to HX711 DATA (OUT)
  • D2 connected to HX711 SCK - CLOCK (IN)
  • 5V connected to HX711 3.3/3.5V Supply and 16x2 I2C LCD VCC
  • GND connected to 9V Battery (-), 16x2 I2C LCD GND, and HX711 GND - GROUND
  • VIN connected to 9V Battery (+)

Documented Code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "HX711.h"

// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 3; // Arduino Nano D3
const int LOADCELL_SCK_PIN = 2;  // Arduino Nano D2

// Create LCD object
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Create HX711 object
HX711 scale;

// Replace this with your calibration factor
const float CALIBRATION_FACTOR = 420;

void setup() {
  // Initialize the LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Weight Scale");

  // Initialize the scale
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);

  // Set calibration factor
  scale.set_scale(CALIBRATION_FACTOR);

  // Tare the scale
  lcd.setCursor(0, 1);
  lcd.print("Taring...");
  scale.tare();
  lcd.clear();

  // Initialize Serial Monitor for debugging
  Serial.begin(9600);
}

void loop() {
  // Read weight value from the scale
  float weight = scale.get_units(10);

  // Display the weight on the LCD
  lcd.setCursor(0, 0);
  lcd.print("Weight: ");
  lcd.print(weight);
  lcd.print(" kg");
  lcd.setCursor(4, 1);
  lcd.print(weight * 1000);
  lcd.print(" gm");

  // Print the weight to the Serial Monitor for debugging
  Serial.print("Weight: ");
  Serial.print(weight);
  Serial.println(" kg");

  // Delay before the next reading
  delay(500);
}

This code is designed to run on the Arduino Nano. It initializes the HX711 and the LCD, performs taring of the scale, and continuously reads the weight measurements from the Load Cell, displaying the results on the LCD and the Serial Monitor. The CALIBRATION_FACTOR should be adjusted according to the specific Load Cell used to ensure accurate readings.