Upload
shyammilky
View
218
Download
0
Tags:
Embed Size (px)
DESCRIPTION
ration
Citation preview
ERADIS – Electronic
Ration Distribution
System
This Machine is invented
by:-
Umang Sharma
(Group Leader)
Vaibhav Kumar
Vikalp Chauhan
This section includes-
Embedded Systems
ERADIS-Electronic Ration
Distribution System.
Pictorial View of ERADIS
System Design
Flow Chart
Working
INTRODUCTION
Introduction
Embedded systems:
An embedded system is a computer system designed to do one or a
few dedicated and/or specific functions often with real-time
computing constraints. It is embedded as part of a complete device often
including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to
meet a wide range of end-user needs. Embedded systems control many
devices in common use today.
Embedded systems are controlled by one or more main processing cores that
are typically either microcontrollers or digital signal processors (DSP). The
key characteristic, however, is being dedicated to handle a particular task.
They may require very powerful processors and extensive communication,
for example air traffic control systems may usefully be viewed as embedded,
even though they involve mainframe computers and dedicated regional and
national networks between airports and radar sites (each radar probably
includes one or more embedded systems of its own).
Since the embedded system is dedicated to specific tasks, design engineers
can optimize it to reduce the size and cost of the product and increase the
reliability and performance. Some embedded systems are mass-produced,
benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital
watches and MP3 players, to large stationary installations like traffic
lights, factory controllers, or the systems controlling nuclear power plants.
Complexity varies from low, with a single microcontroller chip, to very high
with multiple units, peripherals and networks mounted inside a
large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most
systems have some element of extensibility or programmability. For
example, handheld computers share some elements with embedded systems
such as the operating systems and microprocessors that power them, but they
allow different applications to be loaded and peripherals to be connected.
Moreover, even systems that do not expose programmability as a primary
feature generally need to support software updates. On a continuum from
"general purpose" to "embedded", large application systems will have
subcomponents at most points even if the system as a whole is "designed to
perform one or a few dedicated functions", and is thus appropriate to call
"embedded".
Figure1: Block Diagram of an Embedded System Showing Different Software & Hardware Components.
Looking onto the above block diagram one can easily observe that what all an
embedded system constitutes of.
Our project – Electronic RAtion DIstribution System (ERADIS) is also
an Embedded System since it includes a perfect share of hardware and
an appreciable share of software as well.
ERADIS Like in many of the embedded systems consists of Program
source code, a microcontroller, a circuit with which the microcontroller
is interfaced (Weighing machine), a keypad and other keys as user
interface, a display, power supply and other supporting electronic
circuitry.
The actual concept of ERADIS is explained in detail further.
Electronic RAtion DIstribution System (ERADIS)
“Electronic Ration Distribution System(ERADIS)”- The name speaks for itself, is an important, innovative, and a totally new concept thought by our group taking into account the various social, economic and general aspects relating to technical as well as day to day disciplines.
“Electronic Ration Distribution System(ERADIS)”- means distribution of essential commodities to a large number of people through a network on a recurring basis in an automated way.
The Concept is to automate the Public Distribution System (PDS), A Govt. Of India initiative Process in which a fixed amount of ration is provided monthly to the people by the PDS stores.
Our group thought of this concept because the increased corruption in the market sector can be prevented if system becomes automated, increased adulteration can be prevented as well, the hoarding done by the officials and labourers of Govt. Super Bazaars (PDS Stores) which in turn leads to price hike can be prevented using this system.
The apparatus we are designing is cost effective and can prove helpful to Govt. Of India’s PDS System and to various other disciplines. In terms of feasibility it is a vast concept and an interesting task to perform and totally feasible in all aspects technical as well as other.
Advantages of employing ERADIS are:
increased corruption in the Govt. As well as market sector can be prevented if system becomes automated
increased adulteration in consumables can be prevented the problem of hoarding at Govt. Super Bazaars (PDS Stores) that gives
rise to price hike can be prevented cost effective approach time saving approach
Pictorial View of ERADIS
Figure2: Pictorial view of ERADIS
The detailed description of ERADIS is given in further sections.
System Design
Figure3: Front View of ERADIS.
Figure4: Side View of ERADIS.
Flow Chart
Start
Check Reading on weighing machine
Is Reading
Zero?
Press
ZERO Key
No
Yes
Press SET key to store the value
entered by the user
Enter the desired value
Solenoid opens the flap of the container to release the items
Items start to collect on container kept on Weighing Machine
Weighing Machine checks the value
Is Weighing Machine
Reading Equal to the
value entered
(Desired Value)?
Solenoid closes the flap of the container
No
Yes
Stop
Working
Looking on to the system designs above one can easily predict the working of ERADIS- “Electronic Ration Distribution System”. In this system there is a container in which the items (wheat, rice etc.) are stored. A user enters the required amount using a Keypad, whenever a key is pressed the buzzer indicates that a key has been pressed by buzzing, the moment user enters a value the solenoid releases the flap and the items are collected in a container which is placed on a weighing machine, and when the load on weighing machine equals the value entered by the user the solenoid again pushes the flap back towards the container. Spring is used to keep the flap closed when the power is off. Also there is a provision of SET and ZERO key which is used to enter a value and to make the reading of the weighing machine zero respectively. The power supply used here is 12 Volts Battery for microcontroller and A.C. Supply for solenoid. A wooden table is used to showcase the system properly and to demonstrate the intended functions. The electronics part of the project is aligned systematically in a plastic box so as to ensure that the connections remain intact.
Snapshot of ERADIS’s working is given as follows:
1. Setting the value to zero using ZERO Key and storing the entered value
using SET Key:-
Figure5: Snapshot 1 of ERADIS.
2. Entering the value using Keypad:-
Figure6: Snapshot 2 of ERADIS.
3. As soon as the user enters a value the solenoid opens the flap of the
container and the item (wheat) start falling on the collecting tray placed
on weighing machine:-
Figure7: Snapshot 3 of ERADIS.
4. Display showing the amount which has been received in the collecting
tray placed on the weighing machine:-
Figure8: Snapshot 4 of ERADIS.
5. Item released by the container getting collected in collecting tray:-
Figure9: Snapshot 5 of ERADIS.
6. When the reading of weighing machine equals the entered value
(Desired Value) the Solenoid closes the flap of the container and
restricts the item from falling on collecting tray:-
Figure10: Snapshot 6 of ERADIS.
Block Diagram
The Block diagram of ERADIS depicting the important components is shown
below:
Figure11: Block Diagram of ERADIS
Hence the ERADIS consists of following parts:
Container
Weighing Machine
Solenoid & Spring Arrangement
User Interface
Display
Power Supply
Control Unit
Container
Weighing
Machine
Solenoid &
Spring
Arrangement
Control
Unit
User Interface
Keypad
SET and
ZERO
Key
Display
Power Supply
Container
The container used in the project is the one used to store mustard oil. The
further changes in the orientation of the container as per requirements are
explained as below:
This is how the container was adapted to use in ERADIS.
Figure12: Step1: A mustard Oil
Container was taken
Figure13: Step2: The Container
was chopped off from the top
Figure14: Step3: A small
rectangular hole was done at the
bottom of the container
Figure15: Step4: A flap was
placed on that rectangular hole
Weighing Machine
Figure16: Weighing Machine used in the project.
What is a Weighing Machine?
A weighing scale is a measuring instrument for determining the weight
or mass of an object. When you place an object on a digital weigh scale, the
load cell senses the weight and sends the signal to the indicator. The signal
conditioner processes the load cell signal and displays weight.
Design Considerations
Weigh scales have wide range of uses in industrial, commercial and consumer applications. Electronic weight scales design is based on using a load cell as the primary transducer. Load cell designs can be distinguished according to the type of output signal generated (pneumatic, hydraulic, electric). Strain-gage load cells convert the load acting on them into electrical signals with the output in range of mV/V. The signal chain has to handle the small signal accurately in presence of noise. The signal then has to be processed for non-linearity, temperature dependency and offset errors and drifts. Hence the signal chain consists of appropriate excitation technique, signal conditioning, signal acquisition and processing and interface and communication.
Excitation Technique:-
The sensor needs an accurate and a highly stable excitation source. Many pressure sensor designs use the same common reference for the excitation circuitry and the ADC for better accuracy and the thus the sensor output is ratio metric. Reference Voltages provide cost effective solution for the
mentioned requirements with high initial accuracy and extremely low temperature drift.
Signal Conditioning:-
In most Load cells the output range of a strain gauge is very small and thus
the signal needs to be amplified before processing to prevent introduction of
errors. Market provides a wide selection of Low Noise Amplifiers with high
CMRR and high gain at low frequencies suitable for the small signal output of
the sensor. Additionally, since the signal bandwidth is low, the 1/f noise of the
amplifiers can introduce errors. Chopper-stabilization amplifiers provide
extremely high dc precision and noise performance at low frequency range.
Highly efficient solutions tailored for Weigh Scale application comprise of
precise, low-drift programmable gain instrumentation amplifiers with high
common mode rejection ratio and proprietary auto-zero techniques.
Signal Acquisition and Processing:-
High resolution differential ADCs have low temperature and offset drifts
required for Weigh Scale application before it is sent to a MCU.
Microcontroller can be used to perform calibration and compensation in
addition to using the on-chip data converters for data acquisition. It also
provides functions including calculation and signal processing, friendly user
interface such as Seven Segment Display and key pad control.
Power Supply:-
The Weigh Scale can be Line Powered (AC Mains supply) or Battery Powered.
Compare a mechanical scale to an electronic scale. Mechanical scale just shows the weight but an electronic scale does much more than that- it helps to automate.
Load Cells
Figure17: Load Cell arrangement for weighing machine.
What is a “Load Cell”?
A load cell is a transducer that is used to convert a force into electrical signal.
This conversion is indirect and happens in two stages. Through a mechanical
arrangement, the force being sensed deforms a strain gauge. The strain gauge
measures the deformation (strain) as an electrical signal, because the strain
changes the effective electrical resistance of the wire. A load cell usually
consists of four strain gauges in a Wheatstone bridge configuration. Load cells
of one strain gauge (quarter bridge) or two strain gauges (half bridge) are
also available. The electrical signal output is typically in the order of a few
millivolts and requires amplification by an instrumentation amplifier before it
can be used. The output of the transducer is plugged into an algorithm to
calculate the force applied to the transducer.
Figure18: Quarter Bridge Circuit for Strain Guage
Solenoid & Spring Arrangement
Figure19: A.C. Solenoid with pressure bearing capacity of 1kg
What is a “Solenoid”?
A solenoid is a coil wound into a tightly packed helix. In physics, the
term solenoid refers to a long, thin loop of wire, often wrapped around
a metallic core, which produces a magnetic field when an electric current is
passed through it. Solenoids are important because they can create controlled
magnetic fields and can be used as electromagnets. The term solenoid refers
specifically to a magnet designed to produce a uniform magnetic field in a
volume of space (where some experiment might be carried out). The term is
also often used to refer to a solenoid valve, which is an integrated device
containing an electromechanical solenoid which actuates either
a pneumatic or hydraulic valve, or a solenoid switch, which is a specific type
of relay that internally uses an electromechanical solenoid to operate an
electrical switch; for example, an automobile starter solenoid, or a linear
solenoid, which is an electromechanical solenoid.
Figure20: Working Principle of Solenoid
Figure21: Spring of Diameter 1 Inches (Approximately)
What is a “Spring”?
A spring is an elastic object used to store mechanical energy. Springs are
usually made out of hardened steel. Small springs can be wound from pre-
hardened stock, while larger ones are made from annealed steel and
hardened after fabrication. Some non-ferrous metals are also used
including phosphor bronze and titanium for parts requiring corrosion
resistance and beryllium copper for springs carrying electrical current
(because of its low electrical resistance).
When a spring is compressed or stretched, the force it exerts is proportional
to its change in length. The rate or spring constant of a spring is the change in
the force it exerts, divided by the change in deflection of the spring. That is, it
is the gradient of the force versus deflection curve.
Depending on the design and required operating environment, any material
can be used to construct a spring, so long as the material has the required
combination of rigidity and elasticity: technically, a wooden bow is a form of
spring.
In ERADIS Spring is used to keep the flap closed when the power is off.
Solenoid is used to stop and allow the flow the flow of items from the
container.
Keypad
Ep
pe
c 5
13
1
Figure22: PCB Layout of 4x4 Keypad
What is a “Keypad”?
A keypad is a set of buttons arranged in a block or "pad" which usually bear
digits, symbols and usually a complete set of alphabetical letters. If it mostly
contains numbers then it can also be called a numeric keypad. Keypads are
found on many alphanumeric keyboards and on other devices such as
calculators, push-button telephones, combination locks, and digital door
locks, which require mainly numeric input.
Figure23: A4x4 Keypad
SET & ZERO Keys
These keys are the important part of the user interface as they are used for
setting the value entered by the user and to set the value to zero respectively.
ZERO: This key is used when the reading of the weighing machine is not
equal to zero when no weight is placed on it.
This key when pressed, sets the reading to zero.
SET: This key is used when user wants to enter a value.
This key when pressed, jumps the program execution to Keypad so as to
get an input from the user. This is terminated when ENTER is pressed
on the keypad.
Figure24: SET & ZERO Keys (part of User Interface)
In ERADIS the SET & ZERO keys are the important part of the user
interface as it is basically used to activate the keypad.
Buzzer
Figure25: Picure of the Buzzer used in ERADIS
What is a Buzzer?
A buzzer or beeper is an audio signaling device, which may
be mechanical, electromechanical, or Piezoelectric. Typical uses of buzzers
and beepers include alarms, timers and confirmation of user input such as a
mouse click or keystroke. The circuit Diagram of the buzzer used in ERADIS is
given as follows.
Figure26: Circuit Diagram of the Buzzer used in ERADIS
In ERADIS a Buzzer is just used to indicate that a key has been pressed
on Keypad.
Functional Numeric Display (FND) ( 7 - Segment Display)
Figure27: PCB Layout of Common Negative (-) FND Display
What is a “Seven Segment Display”?
A seven-segment display, or seven-segment indicator, is a form of
electronic display device for displaying decimal numerals that is an
alternative to the more complex dot-matrix displays. Seven-segment displays
are widely used in digital clocks, electronic meters, and other electronic
devices for displaying numerical information. A seven segment display, as its
name indicates, is composed of seven elements. Individually on or off, they
can be combined to produce simplified representations of the arabic
numerals. Often the seven segments are arranged in an oblique (slanted)
arrangement, which aids readability.
Figure28: Seven Segment Display showing individual elements (LED’s)
Power Supply
12 Volts Battery (For Microcontroller Circuit)
Figure29: 12 Volt Battery
What is a 12 V lead acid Battery?
Structure and Operation: Most lead-acid batteries are constructed with the positive electrode (the anode) made from a lead antimony alloy with lead (IV) oxide pressed into it, although batteries designed for maximum life use a lead-calcium alloy. The negative electrode (the cathode) is made from pure lead and both electrodes are immersed in sulphuric acid. When the battery is discharged water is produced, diluting the acid and reducing its specific gravity. On charging sulphuric acid is produced and the specific gravity of the electrolyte increases.
A.C. Supply( For A.C. Solenoid)
An AC power supply typically takes the voltage from a wall outlet (mains
supply, often 220v-230v) and lowers it to the desired voltage (e.g. 9vac). As
well as lowering the voltage some filtering may take place.
The components used are discussed in further section.
Power Supply: Components Used
Te component used in the power supply of ERADIS are as follows:
1. IC7805: This is an IC of a Voltage Regulator (+5V Output). It is a member of 78xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at input and output pins depending upon the respective voltage levels. Pin Configuration is given as follows-
Figure30: Pin Configuration of IC-7805
Pin Description:
Figure31: Pin Description of IC-7805
2. IC-7905: This is an IC of a Voltage Regulator(-5V Output). It is a member of 79xx series of fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not give the fixed voltage output. The voltage regulator IC maintains the output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide. 7905 provides a regulated supply of -5 V and 1A current. Its additional features include internal thermal overload protection, short circuit protection and output transistor safe operating area compensation. Pin Configuration is given as follows-
Figure32: Pin Configuration of IC-7905
Pin Description:
Figure33: Pin Description of IC-7905
3. ICL-7660: This is an IC of a Voltage Converter. This is used for
Simple Conversion of +5V Logic Supply to ±5V Supplies. Pin
Configuration is given as follows-
Figure34: Pin Configuration of ICL-7660
Pin Description:
N.C.(ICL7660): No Connection
CAP+: Connection to positive terminal of Charge-Pump
Capacitor.
GND Ground: For most applications, the positive terminal of
the reservoir capacitor is connected to this pin.
CAP-: Connection to negative terminal of Charge-Pump
Capacitor.
VOUT Negative Voltage Output: For most applications, the
negative terminal of the reservoir capacitor is connected to
this pin.
LV Low-Voltage Operation: Connect to ground for supply
voltages below 3.5V. ICL7660: Leave open for supply voltages
above 5V.
OSC Oscillator Control Input: Connecting an external capacitor
reduces the oscillator frequency. Minimize stray capacitance at
this pin.
V+ Power-Supply Positive Voltage Input: (1.5V to 10V). V+ is
also the substrate connection.
4. 12 Volt Relay (used to Energize the Solenoid Coil):
A relay is an electrically operated switch that isolates one electrical circuit from another. In its simplest form, a relay consists of a coil used as an electromagnet to open and close switch contacts. Since the two circuits are isolated, a lower voltage circuit can be used to trip a relay, which will control a separate circuit that requires a higher voltage or amperage. A 12-volt relay requires 12 volts direct current (DC) to energize the coil. Relays can be found in early telephone exchange equipment, in industrial control circuits, as a starter solenoid in automobiles, on water pumps, in high-power audio amplifiers, and as protection devices. Below is the schematic of a 12 Volt, 5-Pin, Single Contact, D.C. Relay.
Figure35: Pin Configuration of a 12 Volt Relay
Pin Description:
N/O: Normally Open N/C: Normally Closed COMMON: Common Connection COIL: A.C. Supply to the Coil
Control Unit
Control Unit is the actual intelligence of ERADIS since it constitutes of the
most significant components used in any embedded system eg.
Microcontroller, circuit board, programming (application) etc. The control
unit is responsible for accomplishing the desired operation i.e. it is solely
responsible for automation of the system. The supporting technology behind
control unit is embedded systems.
Hence it is obvious to divide control unit into two parts as follows:
Hardware Platform:
Weighing Machine Circuit
Power Supply Circuits
Microcontroller AT89S52 & other IC’s
Topwin Program Burner Hardware
Software:
UMPS Compiler (To program microcontroller AT89S52 )
Topwin Program Burner Software
CORELDRAW (To design the PCB’s used in ERADIS)
Additional Hardware:
A plastic box to accommodate all the electronic circuitry so as to avoid
the intermittency in connection as when the circuit will be packed the
connections will remain intact.
A wooden table to demonstrate the desired working.
The detailed explaination of subcomponents of ERADIS is given in further
sections.
Weighing Machine PCB Layout
Figure36: PCB Layout of Weighing Machine ( Component Side)
Splder side
S-B
mic
ro w
eig
hin
g s
yste
m
Figure37: PCB Layout of Weighing Machine (Solder Side)
The efficient laying out of traces on a PCB is a complex skill, and requires
much patience. This task has been made vastly easier with the advent of
readily available PCB layout software, but it is still challenging.
The PCB Layouts given above are designed using a software named
CORELDRAW.
Component side
RWGB
Weighing Machine Circuit Diagram
Figure38: Circuit Diagram of Weighing Machine
Circuit Diagram Description
The above Circuit Diagram shows the part of our project which is its actual
intelligence. It shows clearly that the output of load cells (RWBG) is given to
Operational Amplifiers OP-07, then the amplified output from op-amps is
given to ADC’s IC-7135 which converts the analog input to digital output, ADC
is used because a Microcontroller understands digital signals, Also in the
above diagram, there is an IC 7404 which is used as an inverting amplifier and
an IC 4050 which is a Non-Inverting Amplifier. In the circuit diagram above
there is an IC 74HC390 which is used here as clock divider for the ADC-MCU
interface. The Microcontroller used is AT89S52. The Hex to Decimal
conversion is done by the Decoder IC-74HC138, this is done to display the
output on Display Segment. The display segment consists of Common
Negative Seven Segment Display (FND). There is also a ULN Driver.
IC’s which are used in the Circuit are as follows:
OP-07
IC-7135
IC-7404
IC-4050
IC-74HC390
IC-AT89S52
IC-ULN2003
IC-74HC138
These IC’s are explained in detail in further sections.
Weighing Machine Circuit – Components Used
1. OP-07: This is an IC of an Operational Amplifier. Pin Configuration is
given as follows-
Figure39: Pin Configuration of OP-07
Pin Description:
VOS TRIM: Input offset voltage.
-IN: Inverting Input
+IN: Non-Inverting Input
V-,V+: IC’s Power Supply pins.
OUT: Output of the Operational Amplifier.
NC: No Connection
2. IC-7135: This is an IC of an ADC (Analog to Digital Converter). Pin
Configuration is given as follows-
Figure40: Pin Configuration of IC-7135
Pin Description:
V+,V-: IC’s Power Supply Pins
AZ: Auto Zero
INT: Signal Integrate
IN HI, IN LO: Internal Input High & Low
ANALOG COMMON: It is used as the input low return during auto-
zero and de-integrate.
REFERENCE: The reference input must be generated as a positive
voltage with respect to COMMON.
Run/HOLD: When high (or open) the A/D will free-run with
equally spaced measurement cycles every 40,002 clock pulses. If
taken low, the converter will continue the full measurement cycle
that it is doing and then hold this reading as long as R/H is held
low.
STROBE: This is a negative going output pulse that aids in
transferring the BCD data to external latches, UARTs, or
microprocessors.
BUSY: This pin goes high at the beginning of signal integrate and
stays high until the first clock pulse after zero crossing (or after
end of measurement in the case of an overrange).
OVERRANGE: This pin goes positive when the input signal
exceeds the range (20,000) of the converter.
UNDERRANGE: This pin goes positive when the reading is 9% of
range or less.
POLARlTY: This pin is positive for a positive input signal. It is
valid even for a zero reading.
DIGIT DRIVES (Pins 12, 17, 18, 19 and 20): Each digit drive is a
positive going signal that lasts for 200 clock pulses. The scan
sequence is D5 (MSD), D4, D3, D2, and D1 (LSD).
BCD (Pins 13, 14, 15 and 16): The Binary coded Decimal bits B8,
B4, B2, and B1 are positive logic signals that go on simultaneously
with the digit driver signal.
3. IC-7404: This is an IC of an Inverting Amplifier. Pin Configuration is
given as follows-
Figure41: Pin Configuration(Functional) of IC-7404
Functional Table:
Figure42: Functional Table of IC-7404
H: High Logic Level
L: Low Logic Level
VCC & GND: These pins are the IC’s Power Supply Pins.
4. IC-4050: This is an IC of a Non-Inverting Amplifier. Pin Configuration is
given as follows-
Figure43: Pin Configuration of IC-4050
Pin Description:
VDD: Supply voltage
1Y-6Y: Outputs
1A-6A: Inputs
VSS: Ground Supply Voltage
NC: Not Connected
5. IC-74HC390: This is an IC of a Dual Decade Ripple Counter. Pin
Configuration is given as follows-
Figure44: Pin Configuration of IC-74HC390
Pin Description:
1CP0, 2CP0: Clock input divide-by-2 section (HIGH-to-LOW, edge-
triggered)
1MR, 2MR: Asynchronous master reset inputs (active HIGH)
1Q0 to 1Q3: Flip-Flop outputs
1CP1, 2CP1: Clock input divide-by-5 section (HIGH-to-LOW, edge
triggered)
GND: Ground (0 V)
2Q0 to 2Q3: Flip-Flop outputs
VCC: Positive Supply Voltage
6. IC-AT89S52: This is an IC of a Microcontroller. Pin Configuration is
given as follows-
Figure45: Pin Configuration of IC-AT89S52
Pin Description:
Port0: Port 0 is an 8-bit open drain bidirectional I/O port. As an
output port, each pin can sink eight TTL inputs. When 1s are
written to port 0 pins, the pins can be used as high impedance
inputs.
Port1: Port 1 is an 8-bit bidirectional I/O port with internal pull
ups. The Port 1 output buffers can sink/source four TTL inputs.
Port Pin Alternate Functions:-
P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction
control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming
Port2: Port 2 is an 8-bit bidirectional I/O port with internal pull-
ups. The Port 2 output buffers can sink/source four TTL inputs.
Port3: Port 3 is an 8-bit bidirectional I/O port with internal
pullups. The Port 3 output buffers can sink/source four TTL
inputs.
Port Pin Alternate Functions:-
P3.0 RXD (serial input port) P3.1 TXD (serial output port) P3.2 INT0 (external interrupt 0) P3.3 INT1 (external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input) P3.6 WR (external data memory write strobe) P3.7 RD (external data memory read strobe)
RST: Reset Input
ALE/PROG: Address Latch Enable (ALE) is an output pulse for
latching the low byte of the address during accesses to external
memory. This pin is also the program pulse input (PROG) during
Flash programming.
PSEN: Program Store Enable (PSEN) is the read strobe to external
program memory.
EA/VPP: External Access Enable. EA must be strapped to GND in
order to enable the device to fetch code from external program
memory locations starting at 0000H up to FFFFH. This pin also
receives the 12-volt programming enable voltage (VPP) during
Flash programming.
XTAL1: Input to the inverting oscillator amplifier and input to the
internal clock operating circuit.
XTAL2: Output from the inverting oscillator amplifier.
7. IC-74HC138: This is an IC of a Decoder. Pin Configuration is given as
follows-
Figure46: Pin Configuration of IC-74HC138
Pin Description:
A0: Address Input 0
A1: Address Input 1
A2: Address Input 2
E1: Enable Input 1
E2: Enable Input 2
E3: Enable Input 3
Y7: Output 7
GND: Ground
Y6: Output 6
Y5: Output 5
Y4: Output 4
Y3: Output 3
Y2: Output 2
Y1: Output 1
Y0: Output 0
VCC: Positive Supply Voltage
8. ULN-2003: This is an IC used as a driver for Display Section i.e. FND
Display. Pin Configuration is given as follows-
Figure47: Pin Configuration of ULN-2003
Pin Description:
Pin No. 1 to 8: Input pins
Pin No. 11 to 18: Output Pins
Pin No. 9: GND (Ground)
Pin No. 10: Free Wheeling Diode Pins
The above description explained the hardware platform of ERADIS. The
further section includes the Software descriptions.
SOFTWARE SECTION
Screenshots Of CORELDRAW for designing the PCB’s used in ERADIS.
Figure48: Screenshot of CORELDRAW
Figure49: Screenshot of CORELDRAW
Screenshot of Universal Microprocessor Program Simulator (UMPS).
Figure50: Screenshot of UMPS
Code Description
The Program Source Code to be burned on Microcontroller AT89S52
constitutes following functions:
Function 1: To assign the location for FND channels
Function 2: For FND (Display)
Function 3: The main program of Weighing Scale.
Function 4: For setting the value of all channels of FND to Zero
Function 5: For checking the FND after restarting the program.
Function 6: For FND display
Function 7: For converting the Hexadecimal value into the Decimal
value
Function 8: For entering the value through keypad.
Function 9: For displaying and storing the values from 0 to 9
Function 10: For storing the value entered by the keypad
Function 11: For comparing the value of key store (entered value)
& scale reading
Hence as per requirements the program has been manipulated and has been
divided into separate functions so that it can be understood easily and also to
provide flexibility so that it can be manipulated further if required. The
program is written using the basic instruction set of the microcontroller used
and has been compiled using a software named Universal Microprocessor
Program Simulator (UMPS) and has been burned to the microcontroller using
a software named TOPWIN.
The complete program source code is given in further sections.
The source code explained is divided according to the functions as declared
above and has been clearly specified. The code is written in assembly level
language using the instruction set of the microcontroller used.
The code is working correctly and has been properly debugged before
burning it to the microcontroller.
Program source code:
Function 1: To assign the location for FND channels
ch1 equ 70h ;assign 70-7ah for channels of FND
ch2 equ 72h
ch3 equ 74h
ch4 equ 76h
ch5 equ 78h
ch6 equ 7ah
org 00h ;p1.1 for busy *//// start the program from that location
mov sp,#0fh
mov 7eh,#00h ;zero
mov 7fh,#00h ;zero
freq:
sjmp fnd
org 0bh *////
ljmp disp
ljmp over
org 2bh *////
clr tr2
mov 32h,rcap2h
mov 33h,rcap2l
clr ie.5 ;dis int
reti
disp:
mov tl0,#0fbh ;display timer value low
mov th0,#0efh ;display timer value high
setb psw.3
mov p0,@r0
inc r0
mov p2,@r0
inc r0
cjne r0,#7ch,nxt
mov r0,#ch1
nxt:
clr psw.3 *//// start the 3rd
bit of the first register bank
reti
Function 2: For FND (Display)
fnd:
setb psw.3 *//// stop the register bit
mov r4,#00h
mov r0,#ch1
mov tl0,#0fbh
mov th0,#0efh
mov tmod,#01h
setb tcon.4
clr psw.3 *//// start the register bit
mov ch1,#00h
mov 71h,#00 *//// assign that address for the cathode of FND
mov ch2,#00h (71h,73h,75h,77h,79h,7bh)
mov 73h,#00
mov ch3,#00h
mov 75h,#00
mov ch4,#00h
mov 77h,#00
mov ch5,#00h
mov 79h,#00
mov ch6,#00h
mov 7bh,#00
mov 7ch,#00
setb psw.3
mov r0,#ch1
inc r0 *// increment the r0 to make that value as the anode of
fnd
mov @r0,#00h
inc r0
inc r0
mov @r0,#01h
inc r0
inc r0
mov @r0,#02h
inc r0
inc r0
mov @r0,#03h
inc r0
inc r0
mov @r0,#04h
inc r0
inc r0
mov @r0,#05h
mov r0,#ch1
clr psw.3
jnb p1.3,ram_zero1 ;ignore rom read
ljmp over1
ram_zero1:
mov 4ah,#00h ; ram add fill zero
mov 4bh,#00h
mov 4ch,#00h
mov 4dh,#00h
mov 4eh,#00h
mov 4fh,#00h
over1:
mov rcap2h,#00h
mov rcap2l,#00h
mov th2,#00h
mov tl2,#00h
mov t2con,#00h
mov t2mod,#02h
mov t2con,#0bh
mov ie,#0a2h
here1:
jnb p1.1,here1 ; busy
setb tr2 ; timer start
lcall subt
lcall rutin
lcall calcu
lcall bcd10.....
lcall delay1
lcall delay1
lcall delay1
lcall delay1
lcall delay1
ljmp over
Function 3: The main program of Weighing Scale.
*//// in this the subprograms are being called as per requirements
*//// in over: assigning the value of interrupts has been done
over:
mov rcap2h,#00h
mov rcap2l,#00h
mov th2,#00h
mov tl2,#00h
mov t2con,#00h
mov t2mod,#02h
mov t2con,#0bh
mov ie,#0a2h
*//// in ‘here’ jump not bit instruction is being used to use the interrupts
here:
jnb p1.1,here ;busy
setb tr2 ;timer start
lcall subt ; subtract 10000 adc count from adc capture.
jnb p1.2,zero ; zero present count
aee:
*//// in this we called the following instruction set
lcall rutin ; find out data '+'or '-' .
lcall calcu ; capture value hex convart from hex to decimal.
lcall transfar_to_bcd ; data transfer to bcd display add.
lcall bcd
lcall comp_value
; lcall delay1
; lcall delay1
; lcall delay1
jnb p1.5, key *//// after getting the p1.5 high, the execution jump to:
; lcall delay1
lcall delay1
ljmp over *//// otherwise again and again execution occured in
the over:
Function 4: For setting the value of all channels of FND to Zero
Key:
mov 61h,#0h ;most
mov 62h,#0h
mov 63h,#0h
mov 64h,#0h
mov 65h,#0h ;list
lcall bcd *//// show the all channels of FND 0.
ljmp key_board *//// when all channels is 0,
then execution goes to the keyboard program
Zero:
mov 7eh,32h ; high hex capture value save to another ram
mov 7fh,33h ; low hex capture value save to another ram
ljmp aee
Function 5: For checking the FND after restarting the program.
bcd1:
mov a,#09 ;after restart the program digit chake'9',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#08 ;after restart the program digit chake'8',
mov 61h,a ;;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#07 ;after restart the program digit chake'7',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#06 ;after restart the program digit chake'6',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#05 ;after restart the program digit chake'5',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#04 ;after restart the program digit chake'4',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#03 ;after restart the program digit chake'3',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#02 ;after restart the program digit chake'2',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#01 ;after restart the program digit chake'1',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
mov a,#00 ;after restart the program digit chake'0',
mov 61h,a ;at a time all six channels.
mov 62h,a
mov 63h,a
mov 64h,a
mov 65h,a
lcall bcd
lcall delay1
lcall delay1
lcall delay1
lcall delay1
ret
delay:
mov r7,#0ffh *//// assign the value 0ffh for r7 register
dale:
djnz r7,dale *//// decrement jump not zero for r7 for using,
ret this as a delay time
Function 6: For FND display
bcd:
mov a,60h ; data convert for fnd display.
lcall convart ; call the convert subprogram
mov ch1,a
mov a,61h
lcall convart
mov ch2,a
mov a,62h
lcall convart
mov ch3,a
mov a,63h
lcall convart
mov ch4,a
mov a,64h
lcall convart
mov ch5,a
mov a,65h
lcall convart
mov ch6,a
ret
convart:
inc a
mov a,@a+ pc
ret *//// in convart we convert the hex no into the
decimal no for FND display
db 03fh ; 0 for cathode +
db 06h ; fnd cathode +, binary data '0'
db 05bh ; 2 fnd hex value
db 04fh ; 3 fnd hex value
db 066h ; 4 fnd hex value
db 06dh ; 5 fnd hex value
db 07dh ; 6 fnd hex value
db 07h ; 7 fnd hex value
db 07fh ; 8 fnd hex value
db 06fh ; 9 fnd hex value
db 40h ;(-)
db 00h ; (blank)
;***************************************************
rutin:
mov 60h,#0bh ; 2e=blank hex value
clr c
mov a,33h
mov b,7fh
subb a,b
mov 3dh,a
mov a,32h
mov b,7eh
subb a,b
jnc nextt1
ljmp rev
nextt1:
mov 32h,a ;high final
mov 33h,3dh ;low final
mov a,32h ;zero chake
cjne a,#00h,as
mov a,33h
cjne a,#00h,fill_zero
as:
ret
fill_zero:
cjne a,#01h,fill_zero1
mov 33h,#00h
ljmp as
fill_zero1:
cjne a,#02h,fill_zero2
mov 33h,#00h
ljmp as
fill_zero2
cjne a,#03h,fill_zero3
mov 33h,#00h
ljmp as
fill_zero3
cjne a,#04h,fill_zero4
mov 33h,#00h
ljmp as
fill_zero4
ljmp as
rev:
mov 60h,#0ah ;for asc2nd (-)
clr c
mov a,7fh ;33h
mov b,33h ;3bh
subb a,b
mov 33h,a
;high
mov a,7eh ;32h
mov b,32h ;3ah
subb a,b
mov 32h,a
mov a,32h ;zero chake 5-1-07
cjne a,#00h,asr
mov a,33h
cjne a,#00h,fill_zeror
asr:
ret
fill_zeror:
cjne a,#01h,fill_zero1r
mov 33h,#00h
ljmp as
fill_zero1r:
cjne a,#02h,fill_zero2r
mov 33h,#00h
ljmp as
fill_zero2r
cjne a,#03h,fill_zero3r
mov 33h,#00h
ljmp as
fill_zero3r
cjne a,#04h,fill_zero4r
mov 33h,#00h
ljmp as
fill_zero4r
ljmp as
delay1:
mov r6,#0ffh *////assign the 0ffh value for r6,r7 register
mov r7,#0ffh for using as a delay
delay2:
djnz r6,delay2 *//// decrement r6,r7 untill jump not zero,
djnz r7,delay2 otherwise program executes in this delay
ret
subt: *//// in subt extra count received from the bcd
clr c (==10000)is reduced,for this 2710h moved
mov a,33h to the a & b
mov b,#10h
subb a,b
mov 33h,a
mov a,32h
mov b,#27h
subb a,b
mov 32h,a
ret
Function 7: For converting the Hexadecimal value into the Decimal value
calcu: *//// in this the capture hex value convert into the decimal no
clr c
mov a,32h ;31,34,35h
mov b,#10
div ab
mov 35h,b
mov b,#10
div ab
mov 34h,b
mov 31h,a ;end of div 32h
mov a,35h ;35*6
mov b,#6
mul ab
mov b,#10
div ab
mov 39h,b
mov 30h,a ;cary
mov a,34h ;34*6
mov b,#6
mul ab
add a,30h
mov b,#10
div ab
mov 38h,b
mov 30h,a ;cary
mov a,31h ; 31*6
mov b,#6
mul ab
add a,30h
mov b,#10
div ab
mov 37h,b
mov 36h,a
mov a,35h ;35*5
mov b,#5
mul ab
mov b,#10
div ab
mov 3dh,b
mov 30h,a ;cary
mov a,34h ;34*5
mov b,#5
mul ab
add a,30h
mov b,#10
div ab
mov 3ch,b
mov 30h,a ;cary
mov a,31h ;31*5
mov b,#5
mul ab
add a,30h
mov b,#10
div ab
mov 3bh,b
mov 3ah,a
mov a,35h ;35*2
mov b,#2
mul ab
mov b,#10
div ab
mov 41h,b
mov 30h,a ;cary
mov a,34h ;34*2
mov b,#2
mul ab
add a,30h
mov b,#10
div ab
mov 40h,b
mov 30h,a ;cary
mov a,31h ;31*2
mov b,#2
mul ab
add a,30h
mov b,#10
div ab
mov 3fh,b
mul adding
mov 44h,39h ;result
mov a,38h
add a,3dh
mov b,#10
div ab
mov 43h,b ;result
mov 30h,a ;cary
mov a,37h
add a,3ch
add a,41h
add a,30h
mov b,#10
div ab
mov 42h,b ;result
mov 30h,a ;cary
mov a,36h
add a,3bh
add a,40h
add a,30h
mov b,#10
div ab
mov 41h,b ;result
mov 30h,a ;cary
mov a,3ah
add a,3fh
add a,30h
mov b,#10
div ab
mov 40h,b ;result
mov 30h,a ;cary
mov a,33h
mov b,#10
div ab
mov 35h,b
mov b,#10
div ab
mov 34h,b
mov 33h,a
mov a,44h
add a,35h
mov b,#10
div ab
mov 44h,b
mov 30h,a
mov a,43h
add a,34h
add a,30h
mov b,#10
div ab
mov 43h,b ;dis lsb
mov 30h,a
mov a,42h
add a,33h
add a,30h
mov b,#10
div ab
mov 42h,b ;dis lsb
mov 30h,a
mov a,41h
add a,30h
mov b,#10
div ab
mov 41h,b
mov 30h,a
mov a,40h
add a,30h
mov b,#10
div ab
mov 40h,b
mov 30h,a
ret
;end of calcu prog
transfar_to_bcd: *//// in this the output of calcu: move into the FND display
mov 65h,44h
mov 64h,43h
mov 63h,42h
mov 62h,41h
mov 61h,40h
ret
;end of b_d_a_d_adding+present:
;result in 45,46,47,48,49
Function 8: For entering the value through keypad.
key_board:
begen:
mov p3,#0ffh
clr 0b0h
jnb 0b4h,get ;p2.4
jnb 0b5h,get ;p2.5
jnb 0b6h,get ;p2.6
jnb 0b7h,get
lcall delay1
setb 0b0h ;p2.0
lcall delay1
clr 0b1h ;p2.1
lcall delay1
jnb 0b4h,get ;p2.4
jnb 0b5h,get ;p2.5
jnb 0b6h,get ;p2.6
jnb 0b7h,get
lcall delay1
setb 0b1h ;p2.1
lcall delay1
clr 0b2h ;p2.2
lcall delay1
jnb 0b4h,get ;p2.4
jnb 0b5h,get ;p2.5
jnb 0b6h,get ;p2.6
jnb 0b7h,get
lcall delay1
setb 0b2h ;p2.2
lcall delay1
clr 0b3h ;p2.3
lcall delay1
jnb 0b4h,get ;p2.4
jnb 0b5h,get ;p2.5
jnb 0b6h,get ;p2.6
jnb 0b7h,get
lcall delay1
setb 0b3h ;p2.3
lcall delay1
ljmp begen
get:
lcall delay1
mov r2,p3 ;key port
clr p1.3
lcall delay1
setb P1.3
setb psw.3
inc r4
cjne r4,#06h,convert
mov r4,#0h
clr psw.3
Function 9: For displaying and storing the values from 0 to 9
convert:
clr psw.3
cjne r2,#07eh,zeroo
setb psw.3
mov a,r4
cjne a,#01h,not_zeroo5
mov 61h,#00h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_zeroo5:
cjne a,#02h,not_zeroo4
mov 62h,#00h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_zeroo4:
cjne a,#03h,not_zeroo3
mov 63h,#00h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_zeroo3:
cjne a,#04h,not_zeroo2
mov 64h,#00h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_zeroo2:
cjne a,#05h,not_zeroo1
mov 65h,#00h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_zeroo1:
ljmp begen
one:
clr psw.3
cjne r2,#07dh,one
setb psw.3
mov a,r4
cjne a,#01h,not_one5
mov 61h,#01h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_one5:
cjne a,#02h,not_one4
mov 62h,#01h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_one4:
cjne a,#03h,not_one3
mov 63h,#01h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_one3:
cjne a,#04h,not_one2
mov 64h,#01h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_one2:
cjne a,#05h,not_one1
mov 65h,#01h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_one1:
ljmp begen
two:
clr psw.3
cjne r2,#07bh,two
setb psw.3
mov a,r4
cjne a,#01h,not_two5
mov 61h,#02h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_two5:
cjne a,#02h,not_two4
mov 62h,#02h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_two4:
cjne a,#03h,not_two3
mov 63h,#02h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_two3:
cjne a,#04h,not_two2
mov 64h,#02h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_two2:
cjne a,#05h,not_two1
mov 65h,#02h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_two1:
ljmp begen
three:
clr psw.3
cjne r2,#077h,three
setb psw.3
mov a,r4
cjne a,#01h,not_three5
mov 61h,#03h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_three5:
cjne a,#02h,not_three4
mov 62h,#03h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_three4:
cjne a,#03h,not_three3
mov 63h,#03h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_three3:
cjne a,#04h,not_three2
mov 64h,#03h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_three2:
cjne a,#05h,not_three1
mov 65h,#03h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_three1:
ljmp begen
four: clr psw.3
cjne r2,#0beh,four
setb psw.3
mov a,r4
cjne a,#01h,not_four5
mov 61h,#04h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_four5:
cjne a,#02h,not_four4
mov 62h,#04h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_four4:
cjne a,#03h,not_four3
mov 63h,#04h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_four3:
cjne a,#04h,not_four2
mov 64h,#04h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_four2:
cjne a,#05h,not_four1
mov 65h,#04h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_four1:
ljmp begen
five:
clr psw.3
cjne r2,#0bdh,five
setb psw.3
mov a,r4
cjne a,#01h,not_five5
mov 61h,#05h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_five5:
cjne a,#02h,not_five4
mov 62h,#05h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_five4:
cjne a,#03h,not_five3
mov 63h,#05h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_five3:
cjne a,#04h,not_five2
mov 64h,#05h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_five2:
cjne a,#05h,not_five1
mov 65h,#05h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_five1:
ljmp begen
six:
clr psw.3
cjne r2,#0bbh,six
setb psw.3
mov a,r4
cjne a,#01h,not_six5
mov 61h,#06h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_six5:
cjne a,#02h,not_six4
mov 62h,#06h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_six4:
cjne a,#03h,not_six3
mov 63h,#06h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_six3:
cjne a,#04h,not_six2
mov 64h,#06h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_six2:
cjne a,#05h,not_six1
mov 65h,#06h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_six1:
ljmp begen
seven:
clr psw.3
cjne r2,#0b7h,seven
setb psw.3
mov a,r4
cjne a,#01h,not_seven5
mov 61h,#07h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_seven5:
cjne a,#02h,not_seven4
mov 62h,#07h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_seven4:
cjne a,#03h,not_seven3
mov 63h,#07h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_seven3:
cjne a,#04h,not_seven2
mov 64h,#07h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_seven2:
cjne a,#05h,not_seven1
mov 65h,#07h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_seven1:
ljmp begen
eight:
clr psw.3
cjne r2,#0deh,eight
setb psw.3
mov a,r4
cjne a,#01h,not_eight5
mov 61h,#08h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_eight5:
cjne a,#02h,not_eight4
mov 62h,#08h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_eight4:
cjne a,#03h,not_eight3
mov 63h,#08h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_eight3:
cjne a,#04h,not_eight2
mov 64h,#08h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_eight2:
cjne a,#05h,not_eight1
mov 65h,#08h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_eight1:
ljmp begen
nine:
clr psw.3
cjne r2,#0ddh,nine
setb psw.3
mov a,r4
cjne a,#01h,not_nine5
mov 61h,#09h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_nine5:
cjne a,#02h,not_nine4
mov 62h,#09h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_nine4:
cjne a,#03h,not_nine3
mov 63h,#09h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_nine3:
cjne a,#04h,not_nine2
mov 64h,#09h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
ljmp begen
not_nine2:
cjne a,#05h,not_nine1
mov 65h,#09h
clr psw.3
lcall bcd
lcall delay1
lcall delay1
lcall delay1
not_nine1:
ljmp begen
ten:
clr psw.3
cjne r2,#0dbh,ten
lcall key_store
ljmp over
Function 10: For storing the value entered by the keypad
key_store:
mov 66h,61h
mov 67h,62h
mov 68h,63h
mov 69h,64h
mov 6ah,65h
clr p1.4 *////start the solenoid coil
ret
Function 11: For comparing the value of key store (entered value) &
scale reading
comp_value:
mov a,66h
cjne a,61h,go_back
mov a,67h
cjne a,62h,go_back
mov a,68h
cjne a,63h,go_back
mov a,69h
cjne a,64h,go_back
setb p1.4 *//// stop the solenoid coil after compare the
clr p1.3 value of key_store &
lcall delay1
setb p1.3
go_back:
ret
end
The program source code of ERADIS ends here.
The further sections includes the Applications & Future Scope of ERADIS.
Applications
“Electronic Ration Distribution System(ERADIS)”- means distribution of essential commodities to a large number of people through a network on a recurring basis in an automated way. The ERADIS has many applications which can easily be implemented in real world.
The applications of ERADIS can be as follows:
Replacement for existing PDS: It can replace the existing Government Of India’s Public Distribition System (PDS) which is responsible for distributing essential commodities to a large number of people through a network of FPS (Fair Price Shops) on a recurring basis. The ERADIS also perform the same functions in an automated way.
Retail Market Sector: It can be used in retail market sector such as in Shopping Complexes, Supermarkets, Ration Shops to automate the process and to sell items without human intervention.
Large Scale implementation:
If implemented on large scale it can be used in ration processing factories and organizations for simultaneously weighing and packaging of items which are intended for selling.
Future Scope
In this era of automation we see many operations getting automated be it
consumer related operations, be it traffic related operations etc. So why
should the Public Distribution System lags behind? ERADIS is also an
automation technique which can be implemented in various day to day
disciplines and can effectively replace PDS.
The future scope of ERADIS constitutes the factors given below:
Anti-corruption tool:
Because of the automation in this field, the chances of corruption are
reduced, which is a common practice in this industry. The factors such
as Adulteration, Hoarding, Price hike of ration goods can be easily
eliminated using this approach.
Less man power:
Since the system gets automated the chances of corruption gets
reduced. As we know that a machine does not have IQ of its own, less
manpower will in turn lead to reduced corruption in this field.
Ease of access:
In the present PDS system, the people have to spend long time waiting
in queues to get ration, ERADIS can easily eliminate this problem. Also
the longevity in working is another important factor as a man cannot
work 24 hours a day but a machine can hence it can operate like an
ATM if properly maintained.
Bibliography
While working on project and on project report we referred to the following
sources:
Caliber Scales Private Limited – Technical Division.( To get the technical
specifications of the weighing machine used.
Micro Instruments – To design the PCB’s used in the project.
Datasheets of approximately all the IC’s present in the circuit (Control Unit
Components)
We also referred to various websites such as:
Google.com
Wikipedia.com
Instructables.com
And various other links of the search engines.
For programming we referred the booknamed M.A. Mazidi
(Microcontroller 8051)
We also referred various manuals provided to us during our summer
training.