0% found this document useful (0 votes)
2 views

Callibration Code

The document contains an Arduino sketch for interfacing an HX711 load cell with an LCD display. It initializes the load cell and LCD, retrieves weight data in grams, converts it to kilograms, and displays the weight on the LCD. The code includes necessary libraries and sets up the load cell with a calibration factor and a stabilization period.

Uploaded by

kipchumbadenis22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Callibration Code

The document contains an Arduino sketch for interfacing an HX711 load cell with an LCD display. It initializes the load cell and LCD, retrieves weight data in grams, converts it to kilograms, and displays the weight on the LCD. The code includes necessary libraries and sets up the load cell with a calibration factor and a stabilization period.

Uploaded by

kipchumbadenis22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <HX711_ADC.

h> // need to install

#include <Wire.h>

#include <LiquidCrystal_I2C.h> // need to install

HX711_ADC LoadCell(6, 7); // parameters: dt pin 6, sck pin 7;

LiquidCrystal_I2C lcd(0x27, 20, 4); // 0x27 is the i2c address

void setup()

LoadCell.begin(); // start connection to HX711

LoadCell.start(2000); // allow 2 seconds to stabilize

LoadCell.setCalFactor(200.0); // calibration factor (adjust as per your


setup)

lcd.init();

lcd.backlight();

void loop() {

LoadCell.update(); // retrieve data

float weight_grams = LoadCell.getData(); // read value

float weight_kg = weight_grams / 1000.0; // convert to kilograms

lcd.setCursor(0, 0);

lcd.print("Weight [kg]: "); // clear extra chars with spaces

lcd.setCursor(0, 1);

lcd.print(weight_kg, 3); // print with 3 decimal places

You might also like