In this article we will learn how to Interface Arduino with HX711 Load cell. In the last post we will learn how to Interface Arduino with LCD and Keys simulation in proteus. You can visit our website, I hope you appreciate my work, let’s discuss about today’s project.
Components:1. Arduino
2. HX711
3. O Led
4. Load cell
5. Jumper wires
Construction…· Connect Green wire of Load cell with A+ pin of HX711
· Connect Red wire of Load cell with E+ pin of HX711
· Connect Black wire of Load cell with E- pin of HX711
· Connect White wire of Load cell with A- pin of HX711
· Connect GND pin of HX711 with GND pin of Arduino
· Connect DT pin of HX711 with D3 pin of Arduino
· Connect SCK pin of HX711 with D2 pin of Arduino
· Connect 5V pin of HX711 with Vin pin of Arduino
· Connect GND pin of O Led with GND pin of Arduino
· Connect VDD pin of O Led with 3V pin of Arduino
· Connect SCK pin of O Led with A5 pin of Arduino
· Connect SDA pin of O Led with A4 pin of Arduino
The HX711 is a popular and commonly used load cell amplifier and analog-to-digital converter (ADC) that allows you to interface load cells with microcontrollers like Arduino. It is widely used in applications such as weighing scales and force measurement systems.
click here for arduino in proteus
Applications…1. Weight Measurement
2. Kitchen Scales
3. Industrial Scales
4. Force and Tension Measurement
5. Load Testing
Advantages…1. High Precision
2. Load Cell Compatibility
3. Easy to Use
4. Low Noise
5. Cost-Effective
Program code…#include "HX711.h"
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DOUT 3
#define CLK 2
HX711 scale;
float weight;
float calibration_factor = 419640; // Calibration factor
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
void setup() {
Serial.begin(9600);
Serial.println("HX711 calibration sketch");
Serial.println("Remove all weight from scale");
Serial.println("After readings begin, place known weight on scale");
Serial.println("Press + or a to increase calibration factor");
Serial.println("Press - or z to decrease calibration factor");
scale.begin(DOUT, CLK);
scale.set_scale();
scale.tare(); // Reset the scale to 0
long zero_factor = scale.read_average(); // Get a baseline reading
Serial.print("Zero factor: ");
Serial.println(zero_factor);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
delay(2000);
display.clearDisplay();
display.setTextColor(WHITE);
}
void loop() {
scale.set_scale(calibration_factor); // Adjust to this calibration factor
Serial.print("Reading: ");
weight = scale.get_units(5);
if (weight < 0) {
weight = 0.00;
}
Serial.print("Kilogram:");
Serial.print(weight);
Serial.print(" Kg");
Serial.print(" calibration_factor: ");
Serial.print(calibration_factor);
Serial.println();
display.clearDisplay();
display.setTextSize(3);
display.setCursor(0, 0);
display.print("Weight:");
display.setTextSize(3);
display.setCursor(0, 35);
display.print(weight);
display.setTextSize(3);
display.setCursor(75, 35);
display.print("Kg");
display.display();
delay(100);
}
Comments