The project aims to design and build a digital weight measurement system using a Nextion Touch LCD, Arduino microcontroller, and a 200KG load cell. This weight machine provides real-time weight measurements with a user-friendly interface, displaying the data on a touch screen. The system integrates sensors and displays to create an accurate, interactive, and easy-to-use weighing solution suitable for various applications, such as personal fitness, industrial weighing, or commercial use.
Components used in the Project:
Arduino Board (Uno, Mega, or any compatible version):
- Acts as the main microcontroller to process the data from the load cell and communicate with the Nextion LCD.
Nextion Touch LCD Display:
- A user-friendly touch interface to display weight data and other relevant information. It allows users to interact with the system, such as resetting the scale, calibrating, or switching units.
Load Cell (200KG capacity):
- A strain gauge-based sensor that measures the weight placed on it by converting force into an electrical signal.
HX711 Load Cell Amplifier:
- A precision 24-bit analog-to-digital converter (ADC) used to amplify and convert the small signals from the load cell into readable data for the Arduino.
Power Supply:
- A 5V DC power supply to power the Arduino and associated components.
Miscellaneous Components:
- Jumper wires, resistors, connectors, and a suitable base for mounting the load cell.
Working Principle:
Load Cell Operation:
- The load cell works on the principle of strain gauges that measure the deformation caused by weight. When weight is applied, the load cell’s deformation changes its resistance, creating an electrical signal proportional to the weight.
Signal Amplification with HX711:
- The HX711 module amplifies the small signals from the load cell and converts them into digital data, which the Arduino reads.
Arduino Processing:
- The Arduino receives the digital data from HX711, processes the weight information, and calibrates it according to predefined settings. It also handles communication with the Nextion Touch LCD for display purposes.
Display on Nextion Touch LCD:
- The Nextion LCD displays the weight data in real-time. Users can interact with the display to reset, calibrate, or select different units of measurement. The interface can be customized to show additional information, such as battery status, tare weight, or error messages.
Calibration of Load Cell:
The Arduino is programmed using the Arduino IDE, utilizing libraries such as the HX711 library for data processing and the Nextion library for interfacing with the touch display.Calibration involves setting up the scale to read zero weight (tare function) and setting the correct weight scaling factors. This step ensures accurate readings across the load cell’s range.
Circuit Diagram:
Code:
#include "HX711.h" // HX711 library
#include "Nextion.h" // Nextion display library
#include <SoftwareSerial.h> // SoftwareSerial for Nextion
// Define pins for HX711
#define LOADCELL_DOUT_PIN 3
#define LOADCELL_SCK_PIN 2
// Initialize HX711
HX711 scale;
// Define SoftwareSerial pins for Nextion communication
SoftwareSerial nextion(10, 11); // RX, TX
// Initialize Nextion display with the correct baud rate
NexText tWeight = NexText(0, 1, "t0"); // t0 is the object name on Nextion for displaying weight
NexButton bCalibrate = NexButton(0, 2, "b0"); // b0 is the button for calibration
NexButton bTare = NexButton(0, 3, "b1"); // b1 is the button for tare
// Array of pointers for event listening
NexTouch *nex_listen_list[] = {
&bCalibrate,
&bTare,
NULL
};
// Variables
float calibration_factor = 2280.0; // Calibration factor, adjust based on your load cell
float current_weight = 0.0;
// Function prototypes
void tareScale();
void calibrateScale();
void updateDisplay(float weight);
// Event handling for buttons
void bCalibratePopCallback(void *ptr) {
calibrateScale();
}
void bTarePopCallback(void *ptr) {
tareScale();
}
void setup() {
// Initialize Serial
Serial.begin(9600);
nextion.begin(9600); // Nextion default baud rate
// Attach button callbacks
bCalibrate.attachPop(bCalibratePopCallback, &bCalibrate);
bTare.attachPop(bTarePopCallback, &bTare);
// Initialize HX711
scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
scale.set_scale(calibration_factor); // Set initial calibration factor
scale.tare(); // Zero the scale
}
Applications:
Fitness and Personal Health: Monitoring body weight in a user-friendly manner.
Industrial Weighing: Measuring materials in warehouses or production lines.
Commercial Use: Weight measurement in retail settings, such as groceries or hardware stores.
Benefits of this System:
Real-Time Weight Measurement:
- Provides instant feedback with real-time weight data displayed on the screen.
Interactive Touch Screen Interface:
- Allows users to interact with the system, making it easy to operate with features like reset, tare, calibration, and unit selection.
High Accuracy and Precision:
- The 24-bit HX711 ADC ensures high precision, making the system suitable for high-capacity weighing.
Easy Calibration:
- The system can be easily calibrated using predefined procedures accessible through the touch screen.
Compact and Versatile Design:
- Suitable for a wide range of applications, including personal use, fitness centers, warehouses, and industrial settings.
Conclusion:
This project successfully demonstrates the integration of modern touch display technology with Arduino-based weight measurement systems. The result is a versatile and highly accurate weighing machine that provides an interactive and user-friendly experience, making it suitable for various applications in personal, commercial, and industrial environments. The scalability and adaptability of the design allow for future enhancements, such as data logging, wireless connectivity, or integration with other smart systems.