Arduino Based Weight Scale
This Simple project explains how to build a digital weight scale with Arduino.
A loadcell + HX711 module is used to measure the weight.
Using the arduino code we have to set a zero point after assembling the load cell mechanism.
A 16x2 LCD module is used to display the measured value in grams(g).
To improve the mobility of the scale, a rechargeable battery is used as the power source.
According to the requirement a necessary loadcell must be used.(In this project a 1Kg loadcell is used)
This digital scale is ideal for using in domestic areas for small weight measurements.
Tools & Components
1 X Arduino Nano1 X Loadcell(1Kg) + HX711 Module
1 X 10K Ohm Potentiometer
1 X 16x2 LCD Module
1 X 5V Rechargeable battery pack
Suitable base arrangement for loadcell mounting
Breadboard
Connecting Wires
Connecting Components
HX711 DT Pin - Arduino Pin D02
HX711 SCK Pin - Arduino Pin D03
Loadcell Green wire - HX711 (A+) Pin
Loadcell White wire - HX711 (A-) Pin
LCD
Module RS Pin – Arduino Pin A0
LCD
Module EN Pin – Arduino Pin A1
LCD Module D4 Pin – Arduino Pin A2
LCD Module D5 Pin – Arduino Pin A3
LCD Module D6 Pin – Arduino Pin A4
LCD Module D7 Pin – Arduino Pin A5
LCD Module VEE Pin – Potentiometer Sig. Pin
Note : Assemble the loadcell in the correct direction(Up/Down).Readings will be incorrect if the loadcell mounted in upside down.
Mounting excessive load higher than the rated value of loadcell will damage the loadcell.Hence, always use a loadcell which rated higher value than the weight you intend to measure.(If you intend to measure small weights which will be in 1-1000g range , a 1Kg loadcell is suitable)
Arduino Code
//www.craftybin.blogspot.com//Author : Chathura H.
#include "HX711.h"
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;
HX711 scale;
#include <LiquidCrystal.h>
const int rs = A0, en = A1, d4 = A2, d5 = A3, d6 = A4, d7 = A5;
LiquidCrystal lcd(A0, A1, A2, A3, A4 ,A5);
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
delay(100);
Serial.println("Weight ");
Serial.println("Measuring...");
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(2280.f);
scale.tare();
lcd.print("Insert Weight");
delay(100);
lcd.clear();
}
void loop()
{
Serial.print("one reading:\t");
Serial.print(scale.get_units(), 1);
Serial.print("\t| average:\t");
Serial.println(scale.get_units(10), 1);
scale.power_down();
delay(100);
scale.power_up();
lcd.print("Weight :");
delay(100);
lcd.clear();
delay(1);
lcd.print(scale.get_units());
lcd.print("g");
delay(100);
lcd.clear();
delay(1);
}
Safety First !Always Connect the power supply if you are absolutely sure that the components are connected correctly without changing polarity and short circuited the wiring.Even if it seems nothing is wrong : DOUBLE CHECK EVERYTHING !!Your Feedback is very important to us.Please Leave a comment about how you feel about this project.
Post a Comment