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

Program

The document describes code for using two HX711 load cell amplifier modules to measure weight in grams connected to an Arduino. The code includes initializing the modules, setting calibration factors, getting readings from each module and printing the results in grams to the serial monitor.

Uploaded by

Fhadyl Mahendra
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)
20 views

Program

The document describes code for using two HX711 load cell amplifier modules to measure weight in grams connected to an Arduino. The code includes initializing the modules, setting calibration factors, getting readings from each module and printing the results in grams to the serial monitor.

Uploaded by

Fhadyl Mahendra
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/ 2

#include "HX711.

h" //memasukan library HX711

const int DOUT = 2;

const int CLK= 3;

HX711 scale (DOUT,CLK);

const int DOUTX = 3;

const int CLKX= 4;

HX711 scalex (DOUT,CLK);

float calibration_factor = 7050; //-7050 worked for my 440lb max scale setup

float calibration_factorx = 7050;

float units;

float ounces;

float unitsx;

float ouncesx;

void setup() {

Serial.begin(38400);

delay(100);

scale.set_scale();

scale.tare(); //Reset the scale to 0

scalex.set_scale();

scalex.tare();

void loop() {

scale.set_scale(calibration_factor); //Adjust to this calibration factor

Serial.print("Sensor 1: ");

units = scale.get_units(), 10;

units = units/18.4*143;//gram
Serial.print(units,3);

Serial.print(" grams ");

scalex.set_scale(calibration_factorx); //Adjust to this calibration factor

Serial.print("Sensor 2: ");

unitsx = scalex.get_units(), 10;

unitsx = unitsx/18.4*143;

Serial.print(unitsx,3);

Serial.print(" grams");

Serial.println();

You might also like