0% found this document useful (0 votes)
344 views45 pages

Final Year Project

This document describes a final year project to develop a weighing machine based on a microcontroller. It was completed by two students, Mirindi Damien and Murhandikire Fanuel, at ULK Polytechnic Institute in Rwanda. The machine uses a load cell, Hx711 load cell amplifier, Arduino Uno microcontroller, and LCD display. The load cell measures weight and sends signals to the Hx711 amplifier. The amplified signals are sent to the Arduino, which calibrates the signals before displaying the digital reading on the LCD. The project aimed to convert analog weight readings to digital format for high precision measurements.

Uploaded by

MIRINDI Damien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
344 views45 pages

Final Year Project

This document describes a final year project to develop a weighing machine based on a microcontroller. It was completed by two students, Mirindi Damien and Murhandikire Fanuel, at ULK Polytechnic Institute in Rwanda. The machine uses a load cell, Hx711 load cell amplifier, Arduino Uno microcontroller, and LCD display. The load cell measures weight and sends signals to the Hx711 amplifier. The amplified signals are sent to the Arduino, which calibrates the signals before displaying the digital reading on the LCD. The project aimed to convert analog weight readings to digital format for high precision measurements.

Uploaded by

MIRINDI Damien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

REPUBLIC OF RWANDA

ULK POLYTECHNIC INSTITUTE

P.O BOX 2280 Kigali


Website: //www.ulkpolytechnic.ac.rw
E-mail : [email protected]

EEE DEPARTEMENT

Year3/ETT/Day

Final year project

Subject: “weighing machine based on microcontroller”

Done by: 201750098 and 201750202

Academic year: 2019 – 2020


11
DECLARATION

I declare that this work titled weighing machine based on microcontroller is

my own work, that it has not been submitted for any degree or examination in any

other higher learning institution, and that all the sources I have used or quoted have

been indicated and acknowledged by complete references.

MIRINDI Damien MURHANDIKIRE Fanuel

Signature …………………………

…………………………………

Date : ……January,

2021 11
CERTIFICATION

This is to certify that this work titled weighing machine based on

microcontroller is a study carried out by MIRINDI Damien and MURHANDIKIRE

Fanuel under my guidance and supervision.

Supervisor: KAYIJAMAHYE Patrick

Date……… January, 2021

Signature………………………………….
11
DEDICATION

To our respective families MIRINDI and MURANDIKIRE, for showing us the value
of hard work, patience and pride in a job well done.
11
ACKNOWLEDGMENT
11
Thanks are due to the almighty lord, who is the master of time and circumstances;

Gratitude also goes to ours parents, families, and friends for their endless support,
A special thank you is extended to university authorities, different lecturers and colleagues.

11
ABSTRACT

This dissertation presents the development of an electronic weighing indicator for


digital measurement. The objectives of the system were to read weight measured in the
conventional analog form to digital form, achieve high precision in measurement and
calibration. The components used for this research are Load Cell, Hx711 Load Cell
amplifier, Arduino Uno Microcontroller, and an LCD module. In this research, a 40kg
load cell is used. The load cell sends output signals of the mechanical weights
measured to the Hx711 module which amplifies and sends the output to the Arduino
microcontroller. The microcontroller calibrates the output signal with the aid of the
load cell amplifier module before sending the signal which is already converted to
digital form to the LCD module for display. The system developed has proved that a
digital electronic weighing system can be low cost, miniaturized, detached and can

take accurate readings devoid of errors.


11
KEY WORD

11
TABLE OF CONTENTS

DECLARATION.........................................................................................................................................ii
CERTIFICATION......................................................................................................................................iii
DEDICATION......................................................................................................................................iv
ACKNOWLEDGMENT........................................................................................................................v
ABSTRACT..............................................................................................................................................vi
KEY WORD............................................................................................................................................vii
11
TABLE OF CONTENTS...........................................................................................................................viii
LIST OF FIGURES.....................................................................................................................................xi
I. GENERAL INTRODUCTION......................................................................................................1
A. Background................................................................................................................................1
B. Problem statement and justification............................................................................................2
C. Objectives...................................................................................................................................2
D. Significance and Anticipated Output..........................................................................................3
II. LITERATURE REVIEW...............................................................................................................4
A. Electronic Weighing Balance.....................................................................................................4
B. Microcontroller...........................................................................................................................7
III. RESEACH METHODOLOGY..................................................................................................9
A. materials and methods................................................................................................................9
B. System analysis........................................................................................................................10
1. Arduino Uno.........................................................................................................................10
2. Load cell...............................................................................................................................10
3. Hx711 Load Cell Amplifier Module.....................................................................................11
4. LCD DISPLAY....................................................................................................................11
C. Load Cell Assembly on Base....................................................................................................13
D. Circuit Explanation...................................................................................................................14
E. Working Explanation................................................................................................................15
F. Software used in this weight machine.......................................................................................16
IV. RESULTS AND DISCUSSIONS.............................................................................................17
A. Experimental results and analysis.............................................................................................17
B. System evaluation.....................................................................................................................17
1. Comparison of the developed system and a commercial one................................................19
V. CONCLUSION AND RECOMMENDATION............................................................................24
A. Conclusion................................................................................................................................24
B. Recommendations....................................................................................................................25
APPANDIX 1..........................................................................................................................................26
APPANDIX 2: References/Bibliography.................................................................................................27
Bibliography.....................................................................................................................................27
References........................................................................................................................................27
APPANDIX 3: Necessary code uploaded in the system.........................................................................28
11
LIST OF ABBREVIATIONS, ACRONYMS AND SIGNS

ADC: Analog to Digital Converter

LCD: Liquid Crystal Display

M-IDE:

MCS:

PCB: Printed Circuit Board


11
BCD: Binary-Coded Decimal

PGA: Pin Grid Array

ROM: Read-Only Memory

RAM: Read-Write Memory

PIC:

RISC: Reduced Instruction Set Computer

EEPROM: Electrically-Erasable Programmable Read-Only Memory

GPR:

SFR:

UV:

SPI: Serial Programmable Interface

MCS-51:

PM-51:

MCBEWB: Microcontroller Based Electronic Weighing Balance

BEWB: Butchery Electronic Weighing Balance

SRLEWB: Science Research Laboratory Electronic Weighing Balance.

LIST OF FIGURES

Figure 1:System Architecture................................................................................................................7

Figure 2: System flowchart for the developed system........................................................................7

Figure 3: Diagram for the load cell.......................................................................................................8

Figure 4:Diagram of the Hx711 Load Cell Amplifier Module..............................................................9

Figure 5: wheat stone bridge and load cell connections...................................................................10

Figure 6: Schematic Diagram..............................................................................................................11


11
11
I. GENERAL INTRODUCTION

A. Background

Demands of digital weighing machines are on the increase for businesses that deal on
measuring items because it gives the precise and exact measurements of weights of
objects. The digital weighing machine gives a high accuracy and efficiency in
measuring weights of items and this brings about satisfaction to the producer/seller and
the buyer. Sensing devices such as transducer load cells are employed in analog weight
scales. These weight scales do not utilize digital processors and they are read in an
analog manner. These analog weight scales utilize a rotating pointer which rotates.
There are disadvantages to the analog weighing indicator which are high power
consumption because the actuators are electro-mechanical in nature. The actuator
works with high current, low resolution which is caused by the fact that there are little
differences in the weight of various objects which are not easily detected and the
efficiency of the analog weight scale is low due to the rotating pointer which always
shakes or moves.

Electronic weighing systems are used in industries and business establishments for
weighing and segregating materials accurately for process sales. The main advantages
of an electronic weighing system when compared with mechanical weighing systems
are:

 Compactness and small size independent of capacity.

 Ruggedness and high dependability.

 High speed of response and rapid weighing.

 Good accuracy.

 Excellent flexibility to monitor multiple loads.

 Analog and digital with print-out facility remote indication and parallel display.
The electronic weighing system comprises the basic load cell, suitable signal
conditioners and output indicators giving both the analog and digital output for further
processing. The signals from the load cell are amplified and fed to analog/digital
converter, which provide an output in the digital format for display processing etc. The
strain gauge-based load cell is the most popular weight transducer used in the
electronic weighing system.

B. Problem statement and justification

Most of the existing electronic weighing balances use customized chips and are
therefore not flexible. They only perform certain designated tasks. Those that use
microprocessors do not have in-built memory modules, hence the need for external
support chips. They come with price tags. In most microprocessor-based weighing
balances, there is a compromise between range and resolution. On system
reprogramming is not easily done in the case of microprocessor-based systems. 14 The
use of a microcontroller in this research work offers greater flexibility, since bits in
memories replace wired connections. Reprogramming the system attains any
modification in the hardware design to improve the system.

C. Objectives

The general objective of this research work is to design and construct a


Microcontroller based electronic weighing balance. The specific objectives are:

 Mount the encapsulated single point load cell.

 Design and build a signal conditioning circuitry for the load cell output.

 Develop a program for interfacing the 10-bit ADC to the 8-bit microcontroller
and for implementing the analog-to-digital conversion.

 Develop a program for the LCD display control.

 Develop a program for the system using M-IDE Studio for MCS-51 and load
it, from a PC, into the micro controller via the PM51 programmer.

 Design schematic, then PCB using Express PCB and finally mount the
components.
 Calibrate the system.

 Take measurements using the balance.

D. Significance and Anticipated Output

The 8051 micro controller based electronic weighing balance, in this research work, is
for measuring and displaying mass on an LCD display. This research work utilizes the
technique of interfacing a 10-bit ADC to an 8-bit microcontroller. The system is able
to sense, measure and display mass ranging from 0 to 19 kg with a sensitivity of 40 g
per every volt of excitation voltage.
II. LITERATURE REVIEW

A. Electronic Weighing Balance.

The electronic weighing balance circuit is centered on the three–chip minimum-


component 8085A microprocessor system. Two I/O ports on 8355/8755A are used for
the A/D hand shaking. The signal conditioning circuitry, which receives the bridge
output analogue signal from the load cell, drives the 8-bit ADC. By choosing an
appropriate reference voltage; the binary output of the ADC will increase in linear
steps numerically equal to the mass placed on the load cell.

In order to display the mass as a decimal number, the 8-bit binary output has to be
converted to binary-coded decimal (BCD) digits and output them to the digital
display. The 8–bit port A on the 8156 is used to drive the digital display. The
decoder/driver circuitry accepts BCD data, converts them to seven-segment code, and
turns on the appropriate segments. The binary data that the microprocessor receives
from the ADC are not in a form that can be used by the display. For example, if the
mass is 20 kg, the ADC will output 000101002. This has to be converted to
00100000BCD before being output to the display. This conversion could be done with
MSI ICs specifically designed for binary to BCD conversion. Another way is to write
a software sub routine to perform the conversion.

A third way is to use a look-up table. The table look-up technique is very useful for
nonlinear and other complex data conversion. Its disadvantage is that it uses a lot of
very valuable memory to hold the table entries. In this application, since the results are
linear and have a one-to-one correlation, a simple software algorithm can be written to
do the conversion.

Microprocessor based electronic weighing balances have been observed to have


drawbacks such as the low resolution, a lot of space for the many hardware
components used, low range, high cost and limited I/O

Load cell is used to sense weights of objects by

 the load cells worked as sensors. When load was applied on the load column,
it was compressed while its length changed. The column acted like a primary
transducer because the force applied was converted to change in length. The length
change, was not directly measured while the strain gauge connected to the column for
the load got compressed. While the load column acted as a primary transducer, the
strain gauge acted as a secondary transducer because it recorded the displacement of
the load column. While the strain gauge got compressed, its length changed depending
on the magnitude of force applied to the top of the load cell. The resistance of the
strain gauge changed when there was a change in its length. Resistance change was
measured in terms of output voltage change and could be amplified using a differential
amplifier. When the voltage became negative, it was made positive by the inverter
therefore, the load cell gave a voltage level which was equivalent to the applied
weight.

 Discussed on load cell development based on a static weighing system which

focused on the use of digital filtering techniques which was used to remove low
frequency noise during measurement from the static weighing system. This design had
a high-resolution measurement. A PGA was also included in the analog to digital
converter coupled with the high resolution; this eliminated the need for a signal
conditioning circuit. The analog to digital converter was interfaced directly with a
precision sensor and was accessed by the microcontroller which enhanced
measurement. This designed system had an accurate and high precision in output.

 Presented the design of an efficient and inexpensive microcontroller-based

weighing scale. The load cell/resistive strain gauge were used to measure weight.
Pressure was converted into various voltage levels. The voltage levels in this design
were converted into digital data in the PIC16F690 microcontroller. This digital data
was then displayed on a 16*2 liquid crystal display. The aim of this design was to give
room for low cost, high precision user friendly functionalities which were all achieved.

 Described the design and implementation of a digital electronic weighing

system which is high resolution, portable and low cost. The designed system could be
used in laboratory, for commercial and domestic purposes. This system has
miniaturized circuits which made use of a microcontroller. It is made up of an 8-bit
8051 microcontroller which had a memory module for storing data from analog to
digital converter. A program was designed to interface the serial 10-bit ADC to the 8-
bit microcontroller thus achieving High resolution without compromising range. The
developed weighing system displayed the mass placed on the single point load cell on
the LCD, senses and measures.
 Got analogue weighing machine and converted it to a digital weighing

machine. This was achieved using the spring extension in the analog weighing
machine was converted by a voltage divider circuit (transducer) into voltage. The
transducer (voltage divider) output was fed to the microcontroller which was
responsible for converting analog voltages to its digital equivalent using the analog-
digital converter embedded into the microcontroller. The microcontroller was
programmed to display the mass and the corresponding measured weight on the LCD
simultaneously. The readings of the weighing system produced were compared to that
of a standard weighing system. The result showed a mean deviation of 1.44Kg
between the readings of the modified scale and the analogue scale which served as the
control. A simple product moment correlation coefficient was used to compare the two
readings and the result obtained showed that there was a near perfect correlation of
0.9998 between the readings taken from both scales.

 Developed an automatic digital weighing system that operated with solar

energy. The advantages of this system are the implementation of efficient energy,
miniaturized parts, great accuracy and efficiency, low cost. The system operates on AC
and DC supply. This system developed measures weights ranging from 0-40kg.

 Developed a hybrid digital weighing scale which is energy efficient and can be

used for weight measurements. The system detects minute weights placed over it,
accurately reads and measures it kilograms and displays it on the LCD module. The
system developed converted pressure into appropriate voltage levels. The voltage level
was filtered and converted into digital data in the microcontroller which was displayed
on an LCD.
B. Microcontroller

A microcontroller is a type of microprocessor furnished in a single integrated circuit


and needing minimum support chips. Its principle nature is maximum efficiency at
minimum cost. A microcontroller is an intelligent core for a specialized dedicated
system. It is a complete computer system with input-output lines, timers, Read-Only
Memory (ROM), Read-Write Memory (RAM) and some peripherals such as counters
and timers, analog to digital converters, comparators and serial ports. The PIC
microcontroller is mostly built on the Harvard architecture and has characteristics
which include RISC processor design, single word instructions, machine and data
memory configuration and characteristic instruction formats.

The Reduced Instruction Set Computer (RISC) has 35 instructions and each instruction
performs more elementary operations. Consequences of this are a smaller silion area,
faster execution and reduced program size with fewer accesses to main memory. In the
Harvard architecture the data and instructions use different path and storage areas. This
type of machine can read and write instructions to and from memory at the same time
and results in a faster machine. Since the device has separate buses for instructions and
data it is possible for instructions to be sized differently than data items. Being able to
vary the number of bits in each instruction op-code makes possible the optimization of
program memory and the use of single-word instructions that can be fetched in one bus
cycle. The PIC architecture has a two-stage instruction pipeline, since the fetch and
current instruction and execution of the previous one can overlap in time, one
complete instruction is fetched and executed at every machine cycle (pipelining).

The PIC clocking system is designed so that an instruction is fetched, decoded, and
executed every four clock cycles where the clock is either internal or external. In this
manner a PIC equipped with a 4MHz oscillator clock beats at a rate of 0.25 micro
seconds. Since each instruction executes at every four clock cycles, each instruction
takes 1 us when the pre-scalar is not used.

In the PIC16F690 microchip controller there 18 general purpose I/O pins are available
where one pin is only input that is the master clear pin, 3 ports which include port A
which is 6 pins wide, port B which is 4 pins wide and port C which is 8 pins wide
making the device have 18 pins and 2 pins for powering the device.

This microcontroller has three types of memory- ROM, RAM and EEPROM.ROM
memory is used to permanently save program being executed that is why it is often
referred to as program memory. Since ROM is made of FLASH technology, its
contents can be changed by providing special programming voltage. Similar to
program memory, the contents of EEPROM are permanently saved even after the
power going off. The third memory is the RAM which consists of two parts: the
general-purpose registers (GPR) and the special function registers (SFR).

Peripheral devices in the pic16f690 microchip controller include the timer which is
used as timers or counters. The asynchronous receiver transmitter contains all the
clock generators, shift registers and data buffers necessary to perform an input or
output serial data transfer independent of device program execution.
III. DESIGN AND IMPLEMENTATION

A. materials and methods


The materials used in the development of this design are listed as follows:

 An Arduino Uno microcontroller


 A 40kg Load cell
 An HX711 Load Cell Amplifier Module
 A 16x2 LCD

The architecture and program flowchart of the system is shown in figures below.

Figure 1:System Architecture

START

INITIALIZATION

CHECK WEIGHT LIMIT

DISPLAY ON LCD

YES

NO
IS THE LIMIT

EXCEEDED?

SWITCH OFF LED


YES

Figure 2: System flowchart for the developed system


B. System analysis
A cheap electronic Digital weighing indicator for digital measurement was developed
which was designed for a maximum weight of 40kg. The components acquired for the
development of this project are an Arduino Uno microcontroller, a 40kg load cell, an
Hx711 load cell amplifier module and a 16x2 LCD Module. Figure 3 shows the circuit
diagram of the developed system.

1. Arduino Uno
The Arduino Uno was used control center for the project. The Arduino was
programmed in Arduino c++. All activities for the developed system are carried out in
the Arduino Uno. These activities include the activities carried out by the load cell,
Hx711 load cell amplifier and the display on the 16x2 LCD.

2. Load cell
The load cell which is also known as a transducer converts mechanical energy (weight)
to an electrical output. The magnitude of the electrical output is directly proportion to
applied force. The strain gauge in the Load cells deforms when pressure is applied on
it. Strain gauge generates electrical signal during deformation because its effective
resistance changes during deformation. The load cell weighs up to 40kg of load. The
load cell is shown in figure 4 below.

Figure 3: Diagram for the load cell

a) Mathematical analysis for the load cell


Rated capacity--------------40kg
Rated output----------------1mv/v
Excitation voltage----------5v
(Load) 40kg→5mv (output voltage)

If 40kg (40000g) →5mv


1g→X
40,000X→5
X→

X→125*
X→125µm
1g→125µm

Maximum weight→40kg

Therefore, Minimum Volt for 1g→125µm


Minimum Volt for 40kg→

3. Hx711 Load Cell Amplifier Module

Hx711 Load cell amplifier module is a 24 high precision analog to digital converter
which amplifies low electric output from the load cells, amplifies and converts the low
electric output of the load cell gotten from the mechanical energy (weight) and
converts it to a digital form. The digital form is transmitted into the Arduino Uno to
generate the weight. When the load cell amplifier is connected to the microcontroller,
changes in the resistance of the load cell will be read by the microcontroller with some
calibrations. This causes very accurate weight measurements. The diagram for the load
cell amplifier module used is shown in figure 5 below.

Figure 4:Diagram of the Hx711 Load Cell Amplifier Module

4. LCD DISPLAY

The LCD display is an electronic display module used to display the output of the
scale result of the developed system.

The LCD discussed in this section has 16-Pins.The function of each pin is
given in Table below.
Table 1: Summary of the 16X2 LCD pin-outs
PIN SYMBOL I/O DESCRIPTION

1 Vss -- Ground

2 Vcc -- +5V Supply

3 Vee -- Contrast

4 RS I 0=Command Register, 1=data Register

5 R/W I 0=Write, 1=Read

6 E I Enable

7 DB0 I/O Data bus

8 DB1 I/O Data bus

9 DB2 I/O Data bus

10 DB3 I/O Data bus

11 DB4 I/O Data bus

12 DB5 I/O Data bus

13 DB6 I/O Data bus

14 DB7 I/O Data bus

15 BL+ -- Back Light +Supply

16 BL- -- Back Light –Supply

a) Vss, Vcc and Vee


While Vss and Vcc are used for ground and +5V supply respectively, Vee is
used for controlling the contrast of the display.
b) Register Select- RS
There are two important registers within the LCD. The RS pin is used for
their selection as follows. If RS = 0, then the instruction command mode is
selected, allowing the user to send a command such as clearing the display,
cursor at home, etc. If RS = 1, then the data register is selected, allowing the
user to send data to be displayed on the screen.
c) Read/Write- R/(W)’
The R/(W)΄ input allows the user to write information to the LCD or read
information from it. R/(W)΄ = 1 when reading; R/(W)΄ = 0 when writing.
d) Enable- E
The enable pin is used by the LCD to latch information presented to its data
pins. When data is supplied to data pins, a high-to-low pulse must be
applied to this pin in order for the LCD to latch in the data presented at the
data pins. This pulse must be a minimum of 450 ns wide.
e) Data lines-D0–D7
The 8- data pins are used to send information to the LCD or read the
contents of the LCD‟s internal registers. To display characters, ASCII codes
are sent to these pins while making RS = 1.

C. Load Cell Assembly on Base

A base is also required to fix the load cell over it by using nuts and bolts. Here we
have used a hard ply board for the frame for placing things over it and a light wooden
board as Base. This is required as load cell bends slightly when some weight is placed
over it.

Figure 5: wheat stone bridge and load cell connections

That is a typical load cell arranged in a wheat stone bridge format. The output is
clubbed into 4 wires. The load is applied at the free end. The strain gauges are applied
on all 3 sides to pick up compression and expansions which is nothing but load signal
which is processed and measured for weight measurements. The color code of the 4
wires that comes of it has uniform meaning – Red, white, black & green.

RED = + Excitation : This will go to +5Volt or E+ of the HX711 board


BLACK = – Excitation : This will go to ground or E- of the HX711 board
WHITE = – Signal : This will go to A- of the HX711 board
GREEN = + Signal : This will go to A+ of the HX711 board
The HX711 has another channel left unused or if you have one more load cell to take
average, you can connect it to the other channel: B- & B+

D. Circuit Explanation

Connections for this project are easy and the schematic is given below. 16x2 LCD pins
RS, EN, d4, d5, d6, and d7 are connected with pin numbers 8, 9, 10, 11, 12, and 13 of
Arduino respectively. HX711 Module’s DT and SCK pins are directly connected with
Arduino's pins A0 and A1. Load cell connections with the HX711 module are already
explained earlier and also shown in the below circuit diagram.
Figure 6: Schematic Diagram

E. Working Explanation

The working principle of this Arduino Weight Measurement project is easy. Before


going into details, first, we have to calibrate this system for measuring the correct
weight. When the user will power it up the system will automatically start calibrating.
And if the user wants to calibrate it manually then press the push button. We have
created a function void calibrate () for calibration purposes, check the code in
appendix.
For calibration, wait for LCD indication for putting 100 grams over the load cell as
shown in the below picture. When LCD will show “put 100g” then put the 100g
weight over the load cell and wait. After some seconds the calibration process will be
finished. After calibration user may put any weight (max 40kg) over the load cell and
can get the value over LCD in gram.

However, to change the zero-set reading, like weighing milk (in a container) you
would not be interested to measure the container weight and then deduct it etc. So, you
put the container on the scale and press the push-button. The container weight will be
added to the zero-set reading and then a new zero reading will be shown. Now just
pour milk and read the weigh reading. To remove the container from the zero-set
reading just remove the container and press the push button one more time.

In this project, we have used Arduino to control whole the process. Load cell senses


the weight and supplies an electrical analog voltage to HX711 Load Amplifier
Module. HX711 is a 24bit ADC, which amplifies and digitally converts the Load cell
output. Then this amplified value is fed to the Arduino. Now Arduino calculates the
output of HX711 and converts that into the weight values in grams and shows it on
LCD. A push-button is used for calibrating the system.

F. Software used in this weight machine


The software consists of HX711 header files and the Arduino sketch. First add the
library files to the Arduino IDE and then run the sketch. To calibrate the probe, press
the push button once.
G. RESULTS AND DISCUSSIONS

1. Experimental results and analysis

Table 4.1 below shows simulated results when the design was run on proteus. It shows
the variation of the displayed value of the weight as the voltage is varied from 0 to 5
volts as well as the resistance drops consequently.

Table 2- Table of simulated results.


VOLTAGE RESISTANC VOLTAGE DISPLAYED
% E KΩ V VALUE in gm
0 10 0 0.0
1 9.9 0.05 9.775
2 9.8 0.1 19.55
3 9.7 0.15 28.348
4 9.6 0.2 37.145
5 9.5 0.25 45.943
6 9.4 0.3 53.763
7 9.3 0.35 61.583
8 9.2 0.4 69.404
9 9.1 0.45 77.224
10 9.0 0.5 85.044
11 8.9 0.55 91.886
12 8.8 0.6 98.729
13 8.7 0.65 105.571
14 8.6 0.7 112.414
15 8.5 0.75 119.256

When the voltage to the microcontroller input was at zero, the displayed value was
also at zero while the visual alarm was ON to show that the weight was within the
specified limit. Behold 100 gm the visual alarm goes off indicating that the weight
level is behold the specified minimum limit.

2. System evaluation
• Number of main ICs. In terms of the number of components, the developed
PIC16F690 Microcontroller Based Electronic Weighing Balance (MCBEWB)
uses the least. The microcontroller chip has adequate in-built Flash Memory,
EEPROM, RAM and I/O ports. Any microprocessor based electronic weighing
balance would require an external RAM, an external EPROM and an I/O
device among other support chips. This renders the latter extremely expensive.

• Portability. From the portability perspective, the developed system has


unlimited range as all that is needed is a single external power supply. It has
been designed to make it as compact as possible. The Butchery Electronic
Weighing Balance (BEWB) is bulky and therefore has limited portability.

• Space. In terms of space, the developed system required least space for both
the digital circuitry and the analog circuitry. This is attributed to the fact that
minimal number of chips was used and to crown it all, the system was
implemented on PCB boards. Owing to the many external chips used, in
BEWBs and SRLEWBs, a lot of space is required for circuit implementation.

• Flexibility. The developed system is considered the most flexible, as in-system


reprogramming is possible. This is courtesy of the built-in Serial
Programmable Interface (SPI) of the PIC16F690 microcontroller. Program can
be written or erased up to 1000 times. Some BEWBs and SRLEWBs use
dedicated chips like those in DMMs. They only perform specific tasks and
cannot be changed or modified to do otherwise. For those that are
microprocessor based, in-system reprogramming is not possible.
Microprocessor based related Control/Data Acquisition Applications use
external EPROM for program storage. To change the program, it is erased by
exposing it to UV, a tedious process indeed.

• Range and Resolution. The developed electronic weighing balance has tried
to address both resolution and range. It is the best in as far as striking a balance
between range and resolution goes. This is a modest system with a reasonable
range while at the same time being sensitive enough. This is quite rare in
virtually all-electronic weighing systems.
• Display Capability. In as far as display capability is concerned; the developed
system enjoys the widest capability. Using the ASCII code, it can display all
alphanumeric data/information. It can display special characters. BEWBs and
SRLEWBs can only display numeric data/information. Information in letters or
symbols is usually engraved alongside the LCD display.

3. Comparison of the developed system and a commercial one


The developed electronic weighing balance is intended for the measurement
of mass in kilograms. Standard masses were weighed using the two
balances and results entered in table below.
Comparison of the commercial and the developed electronic balance
Mass (kg) by commercial balance Mass (kg) by the developed balance % Error

1.000 1.042 4.2

1.500 1.562 4.1

5.000 5.200 4.0

10.000 10.360 3.6

15.000 15.525 3.5

17.000 17.510 3.0

19.000 19.456 2.4

a) Some of the factors contributing to error


The quality of measurement of the developed system so much depends on
the
ADC‟s accuracy and resolution. The accuracy of an ADC suffers as the
input voltage is decreased. This is so because Vcc-to-digital ground lines are
inherently noisy due to the switching transients of the digital signals. Using
separate analogue and digital grounds is not mandatory, but when used it
ensures that the analogue voltage comparator will not switch falsely due to
electrical noise and jitter.
The TLC 1549 ADC has two reference inputs. These values establish the
upper and lower limits of the analog input to produce a full-scale and zero
reading respectively. These values of REF+, REF-, and the analog input
should not exceed the positive supply or be lower than the GND consistent
with the specified absolute maximum ratings. The digital output is at full
scale when the input signal is equal to or higher than REF+ and at zero
when the input signal is equal to or lower than REF-. Every ADC
measurement contains a variety of unavoidable, independent errors that
influence its accuracy. When σi represents each independent error, the total
error can be expressed as total=√(Σiσi2).

This equation includes of a variety of errors such as sensor anomalies,


noise, amplifier gain and offset, ADC quantization (resolution error), and
other factors. In a theoretically perfect ADC, any particular analogue
voltage measured should be represented by a unique digital code, accurate
to an infinite number of digits. But in a real ADC, small but finite gaps exist
between one digital number and a consecutive digital number, and the
amount depends on the smallest quantum value that the
ADC can resolve.
b) ADC Accuracy versus System Accuracy
Accuracy of a data acquisition (DA) device e.g. an ADC is defined as the
sum of three components stated in terms of the reading, range, and the least
significant bit (LSB). It is a measure of the extend to which the device is
error-free. Generally, accuracy is not constant over an entire measurement
range; it varies with the reading magnitude. On the other hand, resolution is
defined as the smallest incremental change the ADC can recognize. For
example, a 10-bit ADC has a
resolution of 1 part in 1024.
c) Calibration
ADCs may be calibrated with hardware, software, or a combination of the
two. Calibration in this case means adjusting the gain and offset of an ADC
channel to obtain the specified input-to-output transfer function. In a
hardware configuration, for example, the instrumentation amplifier driving
the ADC has its offset and gain adjusted with trim pots, and changing the
ADC‟s reference voltage changes its gain. In hardware/software
calibrations, the software instructs DACs to null offsets and set full-scale
voltages. Lastly, in a software calibration, correction factors are stored in
nonvolatile memory in the data acquisition system or in the computer and
are used to calculate the correct digital value based on the readings from the
ADC. ADCs are factory calibrated before being shipped, but time and
operating temperature can change the settings. ADCs need to be recalibrated
usually after six months to a year, and possibly more often for ADCs with
resolutions of 16 bits or more. Calibration procedures vary, but all usually
require a stable reference source and an indicating meter of (at least three
times) greater accuracy than the device being calibrated.
Offset is typically set to zero with zero input, and the gain is set to full scale
with the precise, full-scale voltage applied to the input.
d) Linearity
When the input voltage and the ADC output readings deviate from the
theoretical diagonal line (representing infinite resolution) more than the
ideal step function, the ADC error is nearly impossible to eliminate by
calibration. The diagonal line represents an ideal, infinite-resolution
relationship between input and output. This type of ADC error is called a
nonlinearity error. Nonlinearities in a calibrated ADC produce the largest
errors near the middle of the input range. As a rule of thumb, nonlinearity in
a good ADC should be one LSB or less.

e) Missing Codes
A quality ADC should generate an accurate output for any input voltage
within its resolution, that is, it should not skip any successive digital codes.
But some ADCs cannot produce an accurate digital output for a specific
analog input. For example, a particular 3-bit ADC does not provide an
output representing the number four for any input voltage. This type of error
affects both the accuracy and the resolution of the ADC.

f) Noise
An ADC can compromise accuracy when excessive electrical noise
interferes with the measured signal, whether that signal is in millivolts or
much larger. For example, many ADCs that reside on cards and plug into a
PC expansion bus can encounter excessive electrical noise that seriously
affects their accuracy, repeatability, and stability. But an ADC does not
have to be connected directly to the bus within the computer. An ADC
mounted in an external enclosure often solves the problem.
When an ADC inside a computer has to be located, its noise level is
checked.
Connecting the ADC‟s input terminal to the signal common terminal should
produce an output of zero volts. If it still reads a value when shorted, the
noise is being generated on the circuit card and will interfere with the
desired input signal. More critical diagnostics are necessary when using an
external power supply because noise also can arise from both the power
supply and the input leads.
Electrical noise in the system could also result from ground loops. Theses
loops often occur when two or more devices in a system, such as a
measurement instrument and a transducer, are connected to ground
terminals at different physical locations. Slight differences in the actual
potential of each ground point generate a current flow from one device to
the other. This current, which often flows through the low potential lead of a
pair of measurement wires generates a voltage drop that appears as noise
and measurement inaccuracy at the signal conditioner or ADC input.
The electrons in the conductors possess varying amounts of energy by virtue
of the temperature of the conductors. The slight fluctuations in energy about
the values specified by the most probable distribution are very small, but are
sufficient to produce small noise potentials within the conductors.
These random fluctuations produced by thermal agitation of the electrons are called
the thermal, or Johnson, noise.

IV. CONCLUSION AND RECOMMENDATION

An Electronic Weighing Indicator system was developed for digital measurement and
the functions of the components were explained in the course of this paper. This
system was built to read weight measurement digital form. The system developed
consisted of a 40kg load cell which read mechanical energy (weight) between 0 to
40kg. The load cell amplifier module reads the output from the load cell and converts
the data from analog to digital form which is then fed to the microcontroller. The
microcontroller processes the data, apart from coordinating the activities of the entire
system. The processed data is the sent from the microcontroller to the LCD module
which is displayed for the user to read.

A. Conclusion

This research work has presented a new concept of making a flexible


electronic weighing balance, which is indeed a data acquisition system,
through the use of a low-cost microcontroller that has a built-in Serial
Programming Interface (SPI). The electronic balance is developed based on
the Atmel AT89S8252 microcontroller that serially interfaced to a 10-bit
ADC. The microcontroller has 8 kB of in-system reprogrammable
downloadable flash memory for storing the program, 2 kB of EEPROM
Memory for data and 256 bytes of internal RAM for storing variables. The
transducer used is a foil strain gauge-based load cell mounted to operate by
the bending principle. When a load is placed on the platter, the gauge
resistance changes. The load cell bridge circuit converts this resistance
change to an electrical voltage, which is in turn fed to and amplified by the
INA125P instrumentation amplifier and associated circuitry. The signal
conditioner is interfaced to the ADC. The analog and digital circuits were
designed and implemented on PCB boards using Express PCB. The system
code was designed and developed using M-IDE

Studio for MCS-51. It was „burnt‟ into the microcontroller via the PM-51
programmer. In comparison with commercially available electronic weighing
balances, the developed microcontroller based electronic weighing balance is low-cost,
flexible and portable. The fabricated system is able to measure mass in the range of 0
to 19 kg to a sensitivity of 40 g per volt of excitation voltage.

B. Recommendations

The proposed weighing system can be employed in the laboratory for


measurement of mass in the high regime, teaching on microcontroller 8051
applications and commercial purposes like in butcheries.
APPANDIX 1

weighing machine based on microcontroller

Dissertation submitted to the Faculty of Electronic s and Electrical


Engineering in partial fulfillment of the requirements for the award of
Bachelor’s Degree in Electronic and Telecommunication Technology

Submitted by

MIRINDI Damien & MURHANDIKIRE Fanuel

Supervisor:

KAYIJAMAHYE Patrick
Kigali, January, 2021

APPANDIX 2: References/Bibliography

Bibliography

References
1. Dr. Pradeep B. Dahikar, Mr. Kamlesh S. Patle “Design of an Embedded platform for Digital
weighing system to enhance measuring capabilities,” International Journal of Innovative
Research in Computer and Communication engineering. Volume 1 Issue 8 october 2013 pp.
1881-1887
2. Kimani Peter Ng’ang’a “Microcontroller Based weighing Machine,” final year project,
Electrical and Electronic Engineering of the University of Nairobi. 22 may 2014
3. Munyao kitavi “Design and fabrication of a microcontroller based electronic weighing
machine in high mass regime,” m.sc thesis, Kenyatta University, August 2009
APPANDIX 3: Necessary code uploaded in the system

#include <LiquidCrystal.h>
#include "HX711.h"
//LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

#define DT A0
#define SCK A1
#define sw 7

long sample=0;
float val=0;
long count=0;

unsigned long readCount(void)


{
unsigned long Count;
unsigned char i;
pinMode(DT, OUTPUT);
digitalWrite(DT,HIGH);
digitalWrite(SCK,LOW);
Count=0;
pinMode(DT, INPUT);
while(digitalRead(DT));
for (i=0;i<24;i++)
{
digitalWrite(SCK,HIGH);
Count=Count<<1;
digitalWrite(SCK,LOW);
if(digitalRead(DT))
Count++;
}
digitalWrite(SCK,HIGH);
Count=Count^0x800000;
digitalWrite(SCK,LOW);
return(Count);
}

void setup()
{
Serial.begin(9600);
pinMode(SCK, OUTPUT);
pinMode(sw, INPUT_PULLUP);
lcd.begin(16, 2);
lcd.print(" Weight ");
lcd.setCursor(0,1);
lcd.print(" Measurement ");
delay(10000);
lcd.clear();
calibrate();
}

void loop()
{
count= readCount();
int w=(((count-sample)/val)-2*((count-sample)/val));
Serial.print("weight:");
Serial.print((int)w);
Serial.println("g");
lcd.setCursor(0,0);
lcd.print("Weight ");
lcd.setCursor(0,1);
lcd.print(w);
lcd.print("g ");

if(digitalRead(sw)==0)
{
val=0;
sample=0;
w=0;
count=0;
calibrate();
}
}

void calibrate()
{
lcd.clear();
lcd.print("Calibrating...");
lcd.setCursor(0,1);
lcd.print("Please Wait...");
for(int i=0;i<100;i++)
{
count=readCount();
sample+=count;
Serial.println(count);
}
sample/=100;
Serial.print("Avg:");
Serial.println(sample);
lcd.clear();
lcd.print("Put 100g & wait");
count=0;
while(count<1000)
{
count=readCount();
count=sample-count;
Serial.println(count);
}
lcd.clear();
lcd.print("Please Wait....");
delay(2000);
for(int i=0;i<100;i++)
{
count=readCount();
val+=sample-count;
Serial.println(sample-count);
}
val=val/100.0;
val=val/100.0; // put here your calibrating weight
lcd.clear();
}

You might also like