Devices & Components
Arduino Uno Rev3
Standard LCD - 16x2 White on Blue
I2C LCD Module
3Kg Load Cell
Software & Tools
Arduino IDE
Project description
Code
Code
c_cpp
1/* 2 * https://facebook/nissiembeddedlab 3 * 2018 September 4 4 * 3 Kg Load Cell HX711 Module Interface with Arduino to measure weight in Kgs 5 Arduino pin 2 -> HX711 CLK 3 -> DOUT 5V -> VCC GND -> GND 6*/ 7 8#include "HX711.h" 9#define DOUT 3 10#define CLK 2 11 12HX711 scale(DOUT, CLK); 13#include <Wire.h> 14#include <LiquidCrystal_PCF8574.h> 15 16LiquidCrystal_PCF8574 lcd(0x3F); 17float calibration_factor = -96650; 18const int SW = 7; 19void setup() 20{ 21 Wire.begin(); 22 Wire.beginTransmission(0x3F); 23 pinMode(SW, INPUT_PULLUP); 24 lcd.setBacklight(255); 25 lcd.begin(16, 2); 26 lcd.setCursor(0,0); 27 lcd.print("Nissi 3kgLoadCell"); 28 lcd.setCursor(0,1); 29 lcd.print("Press Sw to tare"); 30 scale.set_scale(-849650); 31 scale.tare(); 32} 33void loop() 34{ 35 lcd.setCursor(0,1); 36 lcd.print("W = "); 37 lcd.setCursor(6,1); 38 lcd.print(scale.get_units(),3); 39 lcd.println(" kg "); 40 int x = digitalRead(SW); 41 if(x == LOW) 42 { 43 scale.tare(); 44 } 45} 46
Downloadable files
Circuit
Circuit

Circuit
Circuit

Comments
Only logged in users can leave comments