Hello,
In this tutorial-based article, you will learn how to make your Weighing machine at home using Arduino.
Hardware Required
Software Required
Working of a Load cell
- The load cell used in this project works on the principle of piezoresistance. This means that different amounts of force applied to the load cell will change the resistance in proportion. This will lead to either change in voltage or current which will generate an electrical signal.
- Load cell contains a group of electrical resistance and a metal core that transform when a force is applied to it. They return to their original shape once the force has been lifted off the load cell.
The structure and wiring of the load cell is shown below
Hx711 Analog to digital converter
-
Hx711 is an analog to digital converter module, especially used with a load cell. By using this module with Arduino, you can easily read the resistance changes in the load cell. It also consists of an in-built low noise programmable amplifier with a gain of 32, 64, and 128. The main purpose of this module is to amplify the digital signal and provide it to the microcontroller. It also comes with a regulated power supply. It also has other useful features which lead to fast response time and strong anti-interference.
Arduino Uno
-
Arduino Uno is an open-source microcontroller board based on the processor ATmega328P. Arduino Uno has 14 digital input/output pins, 6 analog inputs, a USB connection, a power jack, an ICSP header, and a reset button. It contains all the necessary modules needed to support the microcontroller. Just plug it into a computer with a USB cable or power it with an adapter to get started. You can experiment with your Arduino without worrying too much about it. In the event of a worst-case scenario, you could buy a new one as the Uno is very economical
Li-ion Battery
- 18650 is a single cell, compact and powerful cell with a 2200 mAh capacity. It is very convenient to install in your project to fulfill the 3.7 Volt requirement with high capacity. The battery terminals can use in any compatible battery adapter/holder or they can be permanently soldered to your application's power source wires.
Frame
- For this project, we used a custom-designed frame that can be designed in any 2D or 3D modeling software like AutoCAD, Solidworks, etc. The design is laser cut on an acrylic sheet and then assembled with the load cell.
Circuit Connections
Between Load cell, Hx711, and Arduino Uno
Load Cell |
Hx711 |
Hx711 |
Arduino Uno |
Red |
E+ |
VCC |
3.3V |
Black |
E- |
DT |
2 |
White |
A- |
SCK |
3 |
Green |
A+ |
GND |
GND |
Between Arduino Uno and I2C LCD Display
I2C LCD Display |
Arduino Uno |
GND |
GND |
VCC |
5V |
SDA |
SDA |
SCL |
SCL |
The complete circuit diagram has been shown below
The working concept of weighing machine
-
The load cell of the weighing machine does not measure the weight of an object. It measures the force exerted by it in newtons. The measuring is done in two parts:
-
Firstly, the load cell generates an electrical signal based on the force it has measured.
-
The signal is then converted into digital form with the help of an analog to digital converter. The digital signal is then sent to the display to show the measured weight.
Programming of the Load cell
#include "HX711.h" #define DOUT 3 #define CLK 2 HX711 scale(DOUT, CLK); #include#include LiquidCrystal_PCF8574 lcd(0x3F); float calibration_factor = -96650; const int SW = 7; void setup() { Wire.begin(); Wire.beginTransmission(0x3F); pinMode(SW, INPUT_PULLUP); lcd.setBacklight(255); lcd.begin(16, 2); lcd.setCursor(0,0); lcd.print("Nissi 3kgLoadCell"); lcd.setCursor(0,1); lcd.print("Press Sw to tare"); scale.set_scale(-849650); scale.tare(); } void loop() { lcd.setCursor(0,1); lcd.print("W = "); lcd.setCursor(6,1); lcd.print(scale.get_units(),3); lcd.println(" kg "); int x = digitalRead(SW); if(x == LOW) { scale.tare(); } }
-
Upload the code using Arduino IDE.
Leave a Comment