You are on page 1of 89

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 1



SERICULTURE MARKETING AND COCOON
SELECTION MECHANISM
TABLE OF CONTENTS
CHAPTER 1INTRODUCTION AND BACKGROUND
1.1 INTRODUCTION..........................................................................5

1.2 OBJECTIVE .......................6

1.3 ADVANTAGES....................7
CHAPTER 2: BLOCK DIAGRAM

2.1. HARDWARE TOOLS ...............................................................9

2.2. SOFTWARE TOOLS.................10

2.3. WORKING DESCRIPTION...............10
CHAPTER 3: HARDWARE COMPONENTS
3.1. LOAD CELL...............................................................................13
3.2 ALGORITHM OF LOAD CELL..............15
3.3 TEMPERATURE SENSOR.........................................................15
3.4 ALGORITHM OF TEMPERATURE SENSOR............................16
3.5 ADC..............................................................................................17
3.6 MICROCONTROLLER.................................................................19
3.7 MICROCONTROLLER ALGORITHM........................................20
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 2

3.8 RELAY DRIVER CIRCUIT..........................................................21
3.9 DC MOTOR..................................................................................24
3.10 ULN 2003....................................................................................25
3.11 SERIAL PORT CONNECTOR....................................................26
3.12 MAX232......................................................................................29
3.13 PARALLEL PORTCONNECTOR...............................................30
3.14 CENTRALISED DATABASE.....................................................31
3.15 GSM MODEM.............................................................................32
3.16 VISUAL BASIC...........................................................................34
CHAPTER 4: CIRCUIT DIAGRAM
CHAPTER 5: SOFTWARE CODE
5.1 CONTROLLER CODE.................................................................37
5.2 CENTRALISED DATABASE CODE..........................................50
CHAPTER 6: FLOWCHART
6.1 FLOWCHART STEPS.................................................................64
CHAPTER 7: RESULT
CHAPTER 8: APLLICATION AND FUTURE WORK
CHAPTER 9: BIBLIOGRAPHY
CHAPTER 10: APPENDIX
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 3

LIST OF FIGURES
3.1.1: DIAGRAM OF LOAD CELL.......................................................13
3.1.2: INTERFACING OF LOAD CELL WITH AD620........................14
3.3.1: LM35............................................................................................16
3.5.1: PIN DIAGRAM OF ADC.............................................................18
3.5.2: INTERFACING DIAGRAM OF ADC WITH C.........................18
3.6.1: PIN DETAILS OF C8051............................................................19
3.8.1: SUGAR CUBE RELAY.................................................................21
3.8.2: INTERFACING DIAGRAM OF RELAY WITH C......................22
3.9.1: DC MOTOR...................................................................................24
3.10.1: ULN2003 IC PIN DETAILS.........................................................25
3.10.2: INTERFACING DIAGRAM OF ULN WITH RELAY.................26
3.11.1: DB9 CONNECTOR......................................................................27
3.12.1: MAX232 CONNECTED TO SEIAL PORT AND C..................29
3.13.1: PIN DETAILS OF DB25..............................................................30
3.14.1: INTERFACING DIAGRAM OF DATABASE WITH C............32
3.15.1: INTERFACING DIAGRAM OF GSM WITH DATABASE........33
3.16.1: FRONT END OF VB...................................................................34
4.1: COMPLETE INTERFACING DIAGRAM........................................35

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 4

4.1.1: INTERFACING DIAGRAM OF RELAY WITH CONVEYOR
STIRRER,HEATER......................................................................36
7.1: OUTCOME OF THE PROJECT......................................................65

















SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 5

CHAPTER 1: INTRODUCTION AND BACKGROUND
1.1 INTRODUCTION
Traditionally, in sericulture the weighing process is mechanical and selection
oI cocoon is manually done. This takes a lot oI time an inaccurate reading is
obtained due to human and mechanical errors. The Iarmer collects the
cocoons and sell them in the market where government bodies and private
bodies buy and sell the cocoon at various rates.
In the conventional methods oI silk process, segregation oI cocoons is done
with the help oI a bulb along with natural light. AIter segregation, the cocoons
are put inside the steam bath, which requires 10-12kgs oI bamboo Ior 6-8
mins oI steam bath(Ior 200-300 kgs oI cocoons).Further cocoons are boiled at
controlled temperature with manual stirrer. The manual stirrer does not spread
the temperature equally inside the bucket, which spoils the silk. and also Ior
the boiling purpose it needs a Iuel oI 750 kgs.
Here we propose to automate the market place and change most oI the
mechanical process into electrical which would be more accurate and reliable.
The temperature is maintained at a constant celsius with the help oI LM35
temperature sensor due to which the silk quality and the killing oI the larvae is
not tampered.


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 6


1.2 OB1ECTIVE OF OUR PRO1ECT
O The obiective oI our proiect is to provide an aid Ior sericulture
marketing.

O Mass cocoon segregation mechanism by using electronic weighing
machine.

O To learn the concept oI use oI microcontroller.

O Continuous monitoring oI the temperature.

O To get the weight diIIerence beIore and aIter removing black
spotted cocoons Irom the sample.

O To maintain a log ,oI the type and quality oI the cocoons being
supplied by a particular vendor and also the amount and quantity
being settled Ior what price using pc with centralized database.

O Optimize the entire system to make it accurate, eIIicient, cost
eIIective.





SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 7

1.3 ADVANTAGES
O Semi automated cocoons selection
O Less energy consumption and Iast cocoon selection procedure
O We propose to automate the procedure by connecting electronic
weighting machine to the microcontroller.
O With modern GSM technique we will directly communicate with
Iarmer through SMS.
O Less time consuming as we are using GSM technology.










SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 8

CHAPTER 2: BLOCK DIAGRAM










8
e
l
a
v

u
r
l
v
e
r

C
l
r
c
u
l
L

(
u
L
n
2
0
0
3
)

MoLor for
SLlrrer
1ube llahLs
conLrol
MoLor for
Convevor
Analog to Digital Converter
Load cell for
welahlna
machlne
CAmp (lor
AmpllflcaLlon)
1emperaLure
Sensor

MlcroconLroller
Maln
Max 232
Centralize
Database
PC
CSM
MCuLM
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 9

2.1 HARDWARE TOOLS
O Load cell CZL-601
O Amplifier AD620
O Temperature sensor LM35
O ADC0809 . 8-bit ADC . 8-channel multiplexer with 3 select
lines
O Schmitt trigger 74HCT14
O 5 pin sugar cube relay
O ULN2003 relay driver
O DC motor . Rated output12V. 84RPM.current 1.0A at no load
O DC motor . Rated output 12V . 74RPM . current 4A at load
O Atmel mega 89C51
O Transparent conveyor belt
O Stirrer and tube light
O Light Emitting Diode(LED) as heater
O MAX232
O DB9 male and female connectors.
O DB25 male and female connectors.
O SIM300v7.03 model (GSM modem).
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 10

2.2 SOFTWARE TOOLS
O Visual Studio 6.0
O Keil UV3 software
O NXP-Flash magic
2.3 WORKING DESCRIPTION
Following components are included in our Proiect
1. LOAD CELL :
O We use CZL601 model load cell, which is a bonded metallic
type strain gauge , which uses Iull wheatstone bridge. The
output will be in terms oI milli volts.
O ThereIore ,we use AD620 ampliIier Ior ampliIication, the
gain oI the ampliIier will be 500.Design part is explained in
the next chapter.
2. TEMPERATURE SENSOR :
O We use LM35 temperature sensor, which does the direct
measurement oI temperature.
O It gives 10mV/degree rise in temperature.
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 11

O We give temperature sensor output directly to ADC, Ior
100C it gives 1V.
3. ADC :
O The ADC0809, data acquisition component is a monolithic
CMOS device with an 8-bit analog-to-digital converter, 8-
channel multiplexer and microprocessor compatible control
logic.
O The outputs Irom temperature sensor and load cell are
selected through IN0 and IN1 channel oI ADC respectively.
O Each input oI ADC are selected once at a time by grounding
other input.
O Based on the selected line oI the ADC the output will be sent
to the microcontroller.

4. RELAY MECHANISM :
We use relays along with ULN2003 driver circuit which is a
current booster Ior controlling the Iollowing:
O Motor oI the conveyor
O Motor oI the stirrer
O ON-OFF control oI tube light

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 12

5. MICROCONTROLLER :

O Microcontroller interIaces with relay driver circuit and the
analog to digital converter. The output data obtained is then
sent to the centralized database through Max232.
6. CENTRALIZED DATA BASE :
O In the PC using the centralized database we maintain a log oI
the type and the quality oI the cocoons being supplied by a
particular vendor and also the amount and quantity being
settled and Ior what price. These details can be used Ior
deciding and planning later. Visual Basic Language is used to
create the centralized database system.

7. GSM MODEM :

O We use SIM300V7.03 model oI GSM modem
O Through which the communication between Centralized data
base and the modem is made. Vice versa is also possible.


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 13

CHAPTER 3: HARDWARE COMPONENTS
HARDWARE COMPONENTS USED FOR COCOON SELECTION
MECHANISM:
3.1 LOAD CELL
Load cell is a transducer, which converts pressure/weight into electrical
signal. Inside the load cell the strain gauges are connected in a Iull
bridge Iashion. The load cell is used to measure the weight oI the
unknown cocoons in kgs. Normally the load cell can weigh upto 50 kgs
or more than that.
RATE LOAD (kg) : 3120kg



FIGURE 3.1.1: DIAGRAM OF LOAD CELL

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 14


FIGURE 3.1.2: INTERFACING OF LOADCELL WITH AD620
DESIGN OF LOAD CELL:
Excitation voltage oI load cell 5 v
Rated output oI load cell 2mV/V
For 120kg |2mV*5| 10mV
So, Iullscale load oI 120 kg 10mV output
Gain |5/10mV| 500.
DESIGN OF AD620 AMPLIFIER:
The gain equation is

Rg |49.4KO|/|499|100O
Gain |49.4kO/100|1495
2
6
7
4
8
1
3
5


&21
AD620
LOAD CELL
5V
V
V
#38
100 Ohm
5V
To ADC Channel N1
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 15

3.2 ALGORITHM TO INTERFACE LOADCELL WITH
ADC
STEP 1: Select the channel0 oI ADC to which output oI load cell is connected.
STEP 3: Digital output oI load cell is sent to the centralised database (PC) using
serial communication.
STEP 4: Initial weight oI the load cell is send to centralised data base by the
controller, by sending equivalent character (!) value oI data base
STEP 5: Second weight oI the load cell is send to centralised data base by the
controller, by sending equivalent character (() value oI data base
STEP 6: Original weight is calculated in centralised data base through VB soItware
which is given by the Iollowing Iormula:
txtactualwt txtoriginalwt - txtnewwt

3.3 TEMPERATURE SENSOR
DESIGN:
Temperature sensor range is Irom 1C to 150C
1C gives 10mV output
100C - 1V
150C gives 1.5V
In our application we need 100C to kill larvae.


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 16

DESIGN DESCRIPTION
LM 35 senses the temperature and converts it into voltage (Linear 10mV raise per
degree raise in temperature). The output oI the lm35 is directly given to the
channel IN1 oI ADC so that the analog output is converted into digital Iorm Ior the
microcontroller.

FIGURE 3.3.1 LM 35
3.4 ALGORITHM TO INTERFACE LM35 WITH ADC
STEP 1: Select channel1 oI ADC Ior initial temperature.
STEP 2: The temperature sensor input is given to ADC in terms oI volts and digital
output oI ADC is given to microcontroller and then the controller communicates
with PC through serial port.

ADC
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 17

STEP 3: In centralised database the temperature value #` describes the room
temperature obtained Irom microcontroller.

3.5 ANALOG TO DIGITAL CONVERTER
The ADC0808, data acquisition component is a monolithic CMOS
device with an 8-bit analog-to-digital converter, 8-channel multiplexer
and microprocessor compatible control logic. The 8-bit A/D converter
uses successive approximation as the conversion technique. The
converter Ieatures a high impedance chopper stabilized comparator, a
256R voltage divider with analog switch tree and a successive
approximation register. The 8-channel multiplexer can directly access
any oI 8-single-ended analog signals. The device eliminates the need Ior
external zero and Iull-scale adiustments. Easy interIacing to
microprocessors is provided by the latched and decoded multiplexer
address input.
INPUT:
Temperature sensor (1V) O/P is connected to pin IN1 and ampliIied load
cell (3V) O/P is connected to pin IN0.

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 18


FIGURE 3.5.1: PIN DIAGRAM OF ADC 0808
FIG: 3.5.2 INTERFACING DIAGRAM OF ADC WITH C
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 19

3.6 MICROCONTROLLER
Microcontroller communicates and coordinates with relay driver circuit
and the analog to digital convertor. The output data obtained is then sent
to the centralized database through Max232.The Port0 i.e. P0.1-P0.7 are
connected to the ADC. P2.1,P2.2,P2.3,P3.7 are connected to conveyor
,stirrer, tube light and buzzer respectively.P3.0 and P3.1 is connected to
max 232.We use AT89C51 which is a low-power, high-perIormance
CMOS 8-bit microcomputer with 4K bytes oI Flash memory
programmable and erasable read only memory (EPROM).

FIGURE 3.6.1 PIN DETAILS OF C 8051




SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 20

3.7 MICROCONTROLLER ALGORITHM

STEP 1: Select channel0 to which load cell is connected.
STEP 2: Controller controls ADC0809 to get equivalent digital value.
STEP 3: This digital value (original weight) send to centralised data base
using serial communication.
STEP 4: Select channel1 to which temperature sensor output is
connected.
STEP 5: Controller controls ADC0809 to get equivalent digital value oI
sensed temperature.
STEP 6: This digital value (sensed temperature) send to the centralised
data base using serial communication.
STEP 7: Controller controls the bulb , motor stirrer ,motor conveyor and
heater through driver circuit ULN2003.
STEP 8: MAX232 is interIaced with controller Ior communication with
centralised data base.



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 21

3.8 RELAY DRIVER CIRCUIT

Relay is an electro mechanical switch. Usually relays use an electro
magnet to operate a switching mechanism when several circuits need to
be controlled by one signal Current Ilowing through the coil ,the relay
creates a magnetic Iield, which attracts a lever and changes the switch
contacts. The coil current can be ON or OFF so relays have two switch
positions and they are double throw switches (NC and NO).




FIG 3.8.1: SUGAR CUBE RELAY

nC
CLL
nC
vcc
Cnd
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 22


FIG: 3.8.2 INTERFACING DIAGRAM OF RELAY WITH C
PIN DETAILS
O In the above Iigure3.8.2 the Iirst and second relay pin no3 are
connected to the motor oI conveyor(Ior clock wise and anti clock
wise rotation).
O Third relay pin no3 is connected to the motor oI stirrer, Iourth
relay pin no3 is connected to the bulb and IiIth relay pin no3 is
connected to the heater.
O NO (pin 4) oI each relay are grounded.
Heater
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 23

O NC(pin5) oI each relay are connected to the supply voltage oI 5V
and 12V
O And pin no2 oI each relay is given to Pin no16,15,14,13,12 oI
ULN2003 IC respectively.
O Pin no1 oI each relay are given to supply voltage oI 12V and
output pins oI ULN 1,2,3,4,5 are given to the microcontroller.
O From controller pin port P2.0,P2.1,P2.2,P2.3,P3.2 are connected to ULN as
input ports.
CODE FOR RELAY AND RUNNING DC MOTOR:

//Relay motor Control Code//

Motor1clk: setb p2.2 // dir ctrl; Iront//
clr p2.3 // Enable movement//
ret

Motor1anticlk: clr p2.2 // dir ctrl ; back//
setb p2.3 // Enable movement//
ret

stopallmotors: setb p2.2 // dir ctrl//
setb p2.3 //Enable movement//
ret

acall stopallmotors
clr p2.4
clr p2.5

moveback: acall Motor1anticlk
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 24

ib intialposition, moveback
acall stopallmotors
ret

moveIront: acall Motor1clk
ret

3.9 DC MOTOR
HEAVY GEARED DC MOTOR

FIGURE3.9.1 DC MOTOR
DESCRIPTION OF DC MOTOR
O Rate voltage: 12V
O Speed: 84rpm (no load)
O Current: 1.0A (no load)
O Rate torque: 30kg.m
O Speed: 75rpm (load)
O Current: 4A (load)
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 25

3.10 ULN 2003 IC
DESCRIPTION
We use ULN2003 as current booster Ior relays in order to drive the
motor oI conveyer, motor stirrer, tube light and heater are connected to
input pins 1C& 2C,3C,4C and 5C and the outputs are obtained at pin
1B&2B,3B,4B and 5B and are connected to microcontroller as shown in
Iig:3.10.2

FIG 3.10.1: ULN 2003IC PIN DETAILS




SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 26


FIG: 3.10.2: INTERFACING DIAGRAM OF ULN WITH RELAY
SPECIFICATIONS
It a driver circuit which is used to separate external devices which are
controlled through microcontroller. It requires collector Current(Vce) oI
500 mA and Base Current(Vbe) 25 mA.
3.11 SERIAL PORT CONNECTOR
DB9 is a serial port connector used to connect MAX232 to
microcontroller. It is a physical connector which connect through the
ports P3.0-P3.1 oI the microcontroller.
12V
1
2
A

1
2
A

3
5 4
1 2 3
5 4
1 2 3
5 4
1 2
Heater
12V
B
U
L
B
5V
-
+
3
5 4
1 2
1B
1
2B
2
3B
3
4B
4
5B
5
6B
6
7B
7
1C
16
2C
15
3C
14
4C
13
5C
12
6C
11
7C
10
COM
9
GND
8
C
J
N
V
E
Y
E
R
S
T
I
R
R
E
R

ULN 2003
12V
3
5 4
1 2
5V
12V
From MC Pin Port P2.0
From MC Pin Port P2.1
From MC Pin Port P2.2
From MC Pin Port P2.3
From MC Pin Port P3.2
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 27


FIG 3.11.1:DB9 CONNECTOR
CODE
Serial port connectivity codes

//Initializes the port for the COM Commection//

initserial: mov TH1,#0FDh // pour 28.800 HZ//
mov TMOD,#0x20
mov SCON,#0x50
mov a, pcon
setb acc.7 // to make it work at 57.600 Hz//
mov pcon, a
setb TR1
clr TI
clr RI
ret


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 28

//Send the accumulator contents to the COM port//

sendserial: clr TI
mov sbuI,a
here: inb TI,here
clr TI
ret
//Gets the contents from COM port and stores in accumulator//

getchar: clr ri
clr a
here1: inb ri,here1
clr ri
mov a, sbuI
ret

//Routine to continuously monitor and echo the value received//

getstr: nop
notend: call getchar
call sendserial // to echo back the recieved byte//
cinea,#27,notend //#27.notend.P marks end of communication//
ret










SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 29

3.12 MAX 232

FIG:3.12.1: MAX232 CONNECTED TO SERIAL PORT AND c
DESCRIPTION
Fig 3.12.1, MAX232 is a dual driver/receiver that includes a capacitive
voltage generator to supply EIA-232 voltage levels Irom a single 5-V
supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS
levels. These receivers have a typical threshold oI 1.3 V and a typical
hysteresis oI 0.5 V, and can accept 30V inputs. Each driver converts
TTL/CMOS input levels into EIA-232 levels
FEATURES
O We connect a MAX 232 Ior the inter compatibility between the
PC and C signal levels.
O It does signal level conversion automatically.
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 30

O MAX232 parts are particularly useIul in battery powered
systems, since theirlow-power shut down mode reduces power
dissipation to less than 5W.
3.13 PARALLEL PORT CONNECTOR
DB25 is a parallel port connector Irom PC to microcontroller,
which is connected to stirrer, motor, heater and bulb to the ports
P2.2,P2.0(clockwise)P2.1(anti-clockwise),P3.2 and P2.3
respectively.

FIG 3.13.1: PIN DETAILS OF DB25



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 31

ALGORITHM TO INTERFACE PARALLEL PORT WITH
CENTRALISED DATA BASE
STEP 1: Centralised data base will receive user input through parallel
port.
STEP 2: Once the data is received through parallel port that data will be
decoded by centralised data base.
STEP 3: AIter decoding the data it will receive particular message to
controller.
STEP 4: So that the controller will process the acquired data.
HARDWARE COMPONENTS USED FOR SERICULTURE
MARKETING
3.14 CENTRALISED DATABASE
O Through centralised database we get inIormation/data at a certain
place where the marketing has been made.
O Final weight oI cocoons obtained Irom load cell will be sent to the
centralized data base (PC), which we got Irom the microcontroller.
O We make the rotation oI stirrer, operate the heater and get the
temperature sensor readings by using Visual Basic.
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 32


FIG:3.14.1: INTERFACING DIAGRAM OF DATABASE WITH c
3.15 GSM MODEM
O GSM modem is suitable Ior remote dial-up systems where we are
using SIM300V7.03 model.
O We connect GSM modem to the PC using MAX232 which gives
serial communication in between , where it collects all the data
such as todays rate , total weight , wastage , cost and balance.
O These datas are send to the Iarmer through SMS.
O And vice versa is also possible
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 33


FIG3.15.1: INTERFACING DIAGRAM OF GSM WITH DATABASE










PC
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 34

3.16 VISUAL BASIC

FIG:3.16.1: FRONT END OF VISUAL BASIC








SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 35

CHAPTER 4: CIRCUIT DIAGRAM

FIG: 4.1. COMPLETE INTERFACING DIAGRAM
PSEN
29
ALE
30
VCC
40
GND
20
EA
31
X
1
1
9
X
2
1
8
#ST
9
P0.0/AD0
39
P0.1/AD1
38
P0.2/AD2
37
P0.3/AD3
36
P0.4/AD4
35
P0.5/AD5
34
P0.6/AD6
33
P0.7/AD7
32
P1.0
1
P1.1
2
P1.2
3
P1.3
4
P1.4
5
P1.5
6
P1.6
7
P1.7
8
P2.0/A8
21
P2.1/A9
22
P2.2/A10
23
P2.3/A11
24
P2.4/A12
25
P2.5/A13
26
P2.6/A14
27
P2.7/A15
28
P3.0/#XD
10
P3.1/TXD
11
P3.2/NT0
12
P3.3/NT1
13
P3.4/T0
14
P3.5/T1
15
P3.6/W#
16
P3.7/#D
17
&1
CLK
10
OE
9
EOC
7
D0
17
D1
14
D2
15
D3
8
D4
18
D5
19
D6
20
D7
21
STA#T
6
ALE
22
VCC
11
GND
13
#EF+
12
#EF-
16
N0
26
N1
27
N2
28
N3
1
N4
2
N5
3
N6
4
N7
5
A0
25
A1
24
A2
23

C
R
O
C
O
N
T
R
O
L
L
E
R

8
9
C
5
1
5V
C#STAL
0592MHZ
47uf
0K
5v
1
2 3 4 5 6 7 8 9
1
0
4.7K SP
1
2 3 4 5 6 7 8 9
1
0
4.7K SP
SW2
MC #ESET
33pf
Q1
2N3904
33pf
1
2 3 4 5 6 7 8 9 1
0
4.7K SP
#34
4.7K
5V
1
2 3 4 5 6 7 8 9 1
0
4.7K SP
To MAX232 Pin no.11 TXD
From MAX232 Pin no.12 #XD
1
2
LS11
B&E#
Temperature Sensor
Load Cell
5V
13
25
12
24
11
23
10
22
9
21
8
20
7
19
6
18
5
17
4
16
3
15
2
14
1
P1
CONNECTO# DB25
Conv ey or Motor +
Conv ey or Motor -
K
SCHMITT TRIGGER
000uf
3 4
&16B
%
Stirrer
5v
Bulb
Heater
A
D
C

0
8
0
9
SW1
CONVEO# NTAL
5V

A
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 36



FIG 4.1.1: INTERFACING DIAGRAM OF RELAYS WITH CONVEYOR.
STIRRER .HEATER

















12V
1
2
A

1
2
A

3
5 4
1 2 3
5 4
1 2 3
5 4
1 2
Heater
12V
B
U
L
B
5V
-
+
3
5 4
1 2
1B
1
2B
2
3B
3
4B
4
5B
5
6B
6
7B
7
1C
16
2C
15
3C
14
4C
13
5C
12
6C
11
7C
10
COM
9
GND
8
C
J
N
V
E
Y
E
R
S
T
I
R
R
E
R

ULN 2003
12V
3
5 4
1 2
5V
12V
From MC Pin Port P2.0
From MC Pin Port P2.1
From MC Pin Port P2.2
From MC Pin Port P2.3
From MC Pin Port P3.2

A
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 37

CHAPTER 5: SOFTWARE CODE

5.1 CONTROLLER CODE


SLRICUL1URL

Declaration for ADC

start LOU p2.
add_a LOU p2.6
AD(_data_port LOU p0
segregation_done LOU p1.5
intial_position LOU p1.4
start_switch LOU p1.0


Declaration for 1emperature sensor
adc_al_returned DA1A 21h
conerting_al DA1A 22h
temp2 DA1A 23h
org 0x00
LJMP main
org 0003h
ret
org 0013h // Address for external interrupt J
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 38

ret
org 0x100


Standard delays
delav_hal_second:
push 00
push 01
push 02
mo r2.40ah : Changed from J6 to 0a
two_delv:mo r1.464h
one_delv: mo r0.40h
back: djnz r0.back
djnz r1. one_delv
djnz r2.two_delv
pop 02
pop 01
pop 00
ret
Delay_half_secondJ
push 00
push 01
push 02
mo r2.406h Changed from J6 to 0a
two_delv1: mo r1.464h
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 39

one_delv1: mo r0.40h
back1: djnz r0.back1
djnz r1. one_delv
djnz r2.two_delv1
pop 02
pop 01
pop 00
ret
\ait_20ms: push 06
push 0
mo R6.420
mo R.40
\L_01: nop
nop
djnz R.\L_01
djnz R6.\L_01
pop 0
pop 06
ret

\ait_200ms: push 06
push 0
mo R6.420
mo R.40
\L_200: nop
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 40

nop
djnz R.\L_200
djnz R6.\L_200
pop 0
pop 06
ret
Delay_J00us
delav_100us:push 00
mo r0.446
delav_100us_loop: djnz r1.delav_100us_loop
pop 00
ret

Delay_J6ms
delav_16ms:push 00
push 01
mo r0.430
delav_16ms_loop1:mo r1.4255
delav_16ms_loop2:djnz r1.delav_16ms_loop2
djnz r0.delav_16ms_loop1
pop 01
pop 00
ret
delav_1ms: push 06
push 05
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 41

mo r6.402h
delav_1ms_2: mo r5.40e4h
delav_1ms_1: djnz r5.delav_1ms_1
djnz r6.delav_1ms_2
pop 05
pop 06
ret
Delay 5 ms
delav_5ms: acall delav_1ms
acall delav_1ms
acall delav_1ms
acall delav_1ms
acall delav_1ms
ret
Delay 3 ms
delav_3ms: acall delav_1ms
acall delav_1ms
acall delav_1ms
ret

Serial Port Connectivity codes
Initializes the port for the COM Commection
init_serial:mo 1l1.40lDh Pour 28,800 Hz
mo 1L1.40lh
mo 1MOD.40x20
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 42

mo S(ON.40x50
mo a. pcon
setb acc. // 1o make it work at 57,600 Hz
mo pcon. a
setb 1R1
clr 1I
clr RI
ret


Send the accumulator contents to the COM port

send_serial: clr 1I
mo sbu.a
here:jnb 1I.here
clr 1I
ret

Gets the contents from COM port and stores in accumulator

getchar: clr ri
clr a
here1: jnb ri.here1
clr ri
mo a. sbu
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 43

ret

// Routine to continuously monitor and echo the value received//
get_str: nop
not_end: call getchar
call send_serial 1o echo back the rxed byte//
cjne a.42.not_end:42.not_end // P marks the end of the Communication
ret
Serial port codes end here

//Display_message_serial
push 0
push acc
mo r. 420 //0f for J6 characters,28hfor 40 characters//
all_char1: mo a. 400h Reset accumulator
moc a.(a-dptr
mo sbu.a
here_disp1 // jnb 1I,here_dispJ
clr 1I
inc dptr
djnz r. all_char1
pop acc
pop 0
ret
displav_gr8: DB "working ( 5600 "
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 44

displav_hello: DB "lLLLO"
displav_done: DB "Done"

1est_display
mo dptr. 4displav_gr8
acall displav_message_serial
ret

Motor Control Code

Motor_1_clk: setb p2.2 : dir ctrl front
clr p2.3 Lnable movement//
ret

Motor_1_anticlk:clr p2.2 : dir ctrl // Back//
setb p2.3 Lnable movement//
ret

stop_all_motors:setb p2.2 // dir ctrl
setb p2.3 Lnable movement//
ret



//At reset
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 45

at_reset: setb p3. : switch o teh bulb
acall stop_all_motors
clr p2.4
clr p2.5
lcall init_serial
acall test_displav
moe_back: acall Motor_1_anticlk
jb intial_position. moe_back
acall stop_all_motors
ret
moe_ront: acall Motor_1_clk
ret

select the channel by selecting appropriate select lines

select_channel_in_0:
clr add_a weight sensor - Load Cell//
ret
select_channel_in_1:
setb add_a: heater temperature
ret


Use to fill the location with the ADC value captured
Set the channel address before calling this routine//
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 46

//value returned will be present in the location "adc_val_returned"//

get_adc_and_store: lcall delav_1ms
lcall delav_1ms
lcall delav_1ms
setb start issue start conversion//
lcall delav_1ms
lcall delav_1ms
lcall delav_1ms
clr start // clearing to get the pulse//
lcall delav_5ms delay for the LOC to be active
lcall delav_5ms
lcall delav_5ms
lcall delav_5ms
lcall delav_5ms

mo a. AD(_data_port
mo adc_al_returned. a
ret





SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 47

Main code Starts here

main:
mo sp. 464h
acall at_reset
loop: acall select_channel_in_1
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
mo a. 4'4'
acall send_serial
acall get_adc_and_store
mo a. adc_al_returned
acall send_serial
acall check_parallel_port_alues
jnb start_switch. take_weight_and_start
jmp loop
end_loop:
jmp loop

//1ake_weight_and_start

acall select_channel_in_0
lcall delav_hal_second
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 48

lcall delav_hal_second
acall get_adc_and_store
mo a. adc_al_returned
mo 30h. a // weight one
acall Motor_1_clk
lcall delav_hal_second
lcall delav_hal_second

lcall delay_half_second

acall stop_all_motors
clr p3. switch on the bulb
keep_segregating:
jb segregation_done. keep_segregating
setb p3. switch off the bulb//
acall moe_back
acall select_channel_in_0
lcall delav_hal_second
lcall delav_hal_second
acall get_adc_and_store
mo a. adc_al_returned
mo 31h. a //weight two//
mo a. 4'!'
acall send_serial
mo a. 30h
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 49

acall send_serial
mo a. 4'('
acall send_serial
mo a. 31h
acall send_serial
acall check_parallel_port_alues
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
acall moe_ront to drop the material//
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second1
call stop_all_motors
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
lcall delav_hal_second
acall moe_back to return to the base position
jmp end_loop

check_parallel_port_alues:
mo c. p1.1
mo p2.0. c stirrer
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 50

mo c. p1.2
mo c. p1.3
mo p3.5. c heater//
ret

5.2 CENTRALISED DATABASE CODE

// Interfacing code with stirrer //

Public lag As Boolean
Public objGSM As (lsGSMModem
Public objSerial As (lsSerial(ommunication
Dim 1otstr. St1. St2. St3. St4. St5. SMSBOD\ As String
Dim tmp. (mdlen. MsgLen. l1. l2 As Integer
Priate Declare Sub Sleep Lib "kernel32" BvVal dwMilliseconds As Long,
Dim alue_Data_Port

Priate Sub (heck1_(lick,
I (heck1.Value ~ b(hecked 1hen
'Out Val"&l" & "e800",. Val253,
alue_Data_Port ~ alue_Data_Port And Value_S1IRRLR_ON
Llse
'Out Val"&l" & "e800",. Val254,
alue_Data_Port ~ alue_Data_Port Or Value_S1IRRLR_Oll
Lnd I
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 51

Lnd Sub

Interfacing code of heater to ON-OFF //

Priate Sub (heck3_(lick,
I (heck3.Value ~ b(hecked 1hen
'Out Val"&l" & "e800",. Val24,
alue_Data_Port ~ alue_Data_Port And Value_lLA1LR_ON
Llse
'Out Val"&l" & "e800",. Val254,
alue_Data_Port ~ alue_Data_Port Or Value_lLA1LR_Oll
Lnd I
Lnd Sub

Priate Sub cmdOpen1_(lick,
On Lrror Go1o mverr
I LetcmbPort1.1ext. 3, "(OM" 1hen
MsgBox "Speciv the (ommPort irst"
Lxit Sub
Lnd I

'Settings or (omm Port
I MS(omm1.PortOpen ~ 1rue 1hen MS(omm1.PortOpen ~ lalse
'Open 1he (ommPort
MS(omm1.(ommPort ~ MidcmbPort1.1ext. 4,
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 52

MS(omm1.PortOpen ~ 1rue
(all SaeSetting"MS(omm1". "Settings". "(ommPort". cmbPort1.1ext,
mverr:
MsgBox err.Description
Lnd Sub

Code for GSM communication with centralised data base //
Priate SubcmbPortGSM_DropDown,
cmbPortGSM.(lear
objSerial.GetSerialPorts MS(omm1. cmbPortGSM
Lnd Sub

Priate Sub cmbPortGSM_DropDown,
cmbPortGSM.(lear
objSerial.GetSerialPorts MS(omm2. cmbPortGSM
Lnd Sub

Priate Sub cmdGet\t_(lick,
txtResponse_(hange
Lnd Sub

Priate Sub (MDOPLN2_(lick,
On Lrror Go1o mverr
I LetcmbPort.1ext. 3, "(OM" 1hen
MsgBox "Speciv the (ommPort irst"
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 53

Lxit Sub
Lnd I
// Settings for communication Port //
I MS(omm2.PortOpen ~ 1rue 1hen MS(omm2.PortOpen ~ lalse
'Open 1he (ommPort
MS(omm2.(ommPort ~ MidcmbPort.1ext. 4,
MS(omm2.PortOpen ~ 1rue
(all SaeSetting"MS(omm2". "Settings". "(ommPort". cmbPort.1ext,
mverr:
MsgBox err.Description
Lnd Sub
Priate Sub cmdsart_(lick,
alue_Data_Port ~ alue_Data_Port And Value_S1AR1
Out Val"&l" & "e800",. alue_Data_Port
Sleep 5000
alue_Data_Port ~ alue_Data_Port Or Value_S1OP
Out Val"&l" & "e800",. alue_Data_Port
'lag ~ 1rue
Lnd Sub

Priate Sub (ommand1_(lick,
Lnd
Lnd Sub
Priate Sub (ommand2_(lick,
MsgBox (Int"&l29",,
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 54

Lnd Sub


Priate Sub (ommand3_(lick,
objSerial.Open(omport MS(omm1. cmbPortGSM
objGSM.1estModem MS(omm1
Sleep 500
objGSM.(hange1o1extMode MS(omm1
Sleep 500
objGSM.IsModemReadv MS(omm1
Sleep 500
'txtmsg.1ext ~ "(ost is :" & txtcost & "Balance is :" & 1X1BALAN(L
'objGSM.SendSMS MS(omm1. "". txtmob.1ext. txtmsg.1ext
'Sleep 1000
objGSM.InitReciee MS(omm1
Lnd Sub

Priate Sub (ommand4_(lick,
objGSM.1estModem MS(omm1
Sleep 500
objGSM.(hange1o1extMode MS(omm1
Sleep 500
objGSM.IsModemReadv MS(omm1
Sleep 500
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 55

txtmsg.1ext ~ "1odavs Rate:" & cmbtodatrate & "\astage:" & txtactualwt &
"1otal\eight:" & 1ext4.1ext
txtmsg.1ext ~ txtmsg.1ext & "(ost:" & txtcost & "Balance:" & 1X1BALAN(L
objGSM.SendSMS MS(omm1. "". txtmob.1ext. txtmsg.1ext
Sleep 1000
objGSM.InitReciee MS(omm1
Lnd Sub

Priate Sub (ommand5_(lick,
lrame1.Visible ~ 1rue
Lnd Sub

Priate Sub lorm_Load,
'Out Val"&l" & "e800",. Val255,
alue_Data_Port ~ Deault_Value_Data_port
Set objGSM ~ New (lsGSMModem
Set objSerial ~ New (lsSerial(ommunication
Lnd Sub

Priate Sub MS(omm1_On(omm,
Dim strbu As String
Dim smsg As String
Dim strMsg As String
Dim strMob As String
Dim lg As Integer
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 56

Select (ase MS(omm1.(ommLent
(ase comLReceie
Sleep 300
strbu ~ MS(omm1.Input
' strGSM_input ~ strGSM_input & strbu
1ext6.1ext ~ 1ext6.1ext - strbu
objGSM.GetSMS MS(omm1. strbu. strMob. strMsg
strbu ~ ""
I LenstrMob, 0, 1hen
txtmob.1ext ~ strMob
txtmsg.1ext ~ strMsg
ParseGSM strMob. strMsg
Lnd I
Lnd Select
Lnd Sub

Priate Sub ParseGSMstrMob As String. strMsg As String,
I InStr1. txtmsg.1ext. "1odavsRate". bBinarv(ompare, 1hen
objGSM.1estModem MS(omm1
Sleep 500
objGSM.(hange1o1extMode MS(omm1
Sleep 500
objGSM.IsModemReadv MS(omm1
Sleep 500
txtmsg.1ext ~ cmbtodatrate.1ext
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 57

objGSM.SendSMS MS(omm1. "". txtmob.1ext. "1odavsRateis:" & txtmsg.1ext
Sleep 1000
objGSM.InitReciee MS(omm1
Lnd I
Lnd Sub

Interfacing code of temperature sensor //

Priate Sub MS(omm2_On(omm,
Dim txtBu As String. i. c As Integer
\ith MS(omm2
Select (ase .(ommLent
(ase comLReceie
txtBu ~ .Input
1ext5.1ext ~ txtBu
lor i ~ 1 1o LentxtBu,
c ~ AscMidtxtBu. i. 1,,
' txtdec ~ c,
' 1ext5.1ext ~ 1ext5.1ext & txtdec
' I c ~ 35 Or c ~ 33 Or c ~ 64, 1hen
' 1ext3.1ext ~ 1ext3.1ext & (hr\c,
' Lnd I
' txtResponse ~ txtResponse & c
Next i
' txtResponse ~ RighttxtResponse. 1,
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 58

' 1ext3.1ext ~ 1ext3.1ext & (hr\c,
' Lnd Select
Lnd \ith

On Lrror Go1o mverr
I txtResponse ~ "" 1hen Lxit Sub
'I LentxtResponse, 2 1hen
I InStr1. 1ext5.1ext. "4", 1hen
index1 ~ InStr1. 1ext5.1ext. "4". b1ext(ompare,
1ext3.1ext ~ ""
1ext1.1ext ~ MidtxtResponse.1ext. index1 - 1. 2,
1ext2.1ext ~ AscU(aseMidtxtResponse.1ext. index1 - 1. 2,,,,
'txttemperarture.1ext ~ (IntAscMidtxtResponse.1ext. index1 - 1. 2,, 100
255,,
txttemperarture.1ext ~ (IntAscMidtxtResponse.1ext. index1 - 1. 2,, 100
255,,
txttemperarture.1ext ~ txttemperarture.1ext - 5
'txt1emperature.1ext ~ (IntAscMidtxtResponse.1ext. temp - 2,. bin - 2,,,
100 255,,
Lnd I

Code for measuring initial weight load cell and final weight of load cell //

I InStr1. 1ext5.1ext. "!", 1hen
index22 ~ InStr1. 1ext5.1ext. "!". b1ext(ompare,
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 59

1ext3.1ext ~ ""
temp1 ~ (Int"&l" - MidtxtResponse.1ext. index22 - 1. 2,,,
'txtoriginalwt ~ Mid1ext5.1ext. index22 - 1. 2,,
' temp1 ~ Valtxtoriginalwt,,

Initial weight will be calculated and stored in temp1 //

temp1 ~ Valtemp1,,
temp1 ~ temp1 \1lA(1OR
'' txtoriginalwt ~ (Int"&l" - MidtxtResponse.1ext. index22 - 1. 2,,,
'' 'txtoriginalwt ~ Mid1ext5.1ext. index22 - 1. 2,,
'' txtoriginalwt ~ Valtxtoriginalwt,,
'' txtoriginalwt ~ txtoriginalwt \1lA(1OR
Lnd I
I InStr1. 1ext5.1ext. "(", 1hen
index33 ~ InStr1. 1ext5.1ext. "(". b1ext(ompare,
1ext3.1ext ~ ""

Reduced value will be calculated and stored in temp2 //

temp2 ~ (Int"&l" - MidtxtResponse.1ext. index33 - 1. 2,,,
' temp2 ~ txtnewwt
' temp2 ~ txtnewwt \1lA(1OR
temp2 ~ temp2
temp2 ~ temp2 \1lA(1OR
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 60



Comparing initial weight and reduced weight //

I temp2 temp1 1hen

Which will be larger declaring that weight as original weight //

txtoriginalwt ~ temp2
txtnewwt ~ temp1
Llse

Otherwise temp1 will be declared as original weight //

txtoriginalwt ~ temp1
txtnewwt ~ temp2
Lnd I
' txtnewwt ~ (Int"&l" - MidtxtResponse.1ext. index33 - 1. 2,,,
' txtnewwt ~ txtnewwt
' txtnewwt ~ txtnewwt ' \1lA(1OR

Calculating the actual weight //

txtactualwt ~ txtoriginalwt - txtnewwt
Lnd I
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 61

txtResponse ~ ""
' Lnd I
mverr:
Lxit Sub
txtResponse.SelStart ~ LentxtResponse,
Lnd Sub
Priate Sub txtactualwt_(hange,
On Lrror Go1o mverr
1ext4.1ext ~ txtnewwt.1ext

Calculating the cost //

txtcost ~ 1ext4.1ext cmbtodatrate.1ext

Calcuating balance weight of load cell which is left //

1X1BALAN(L ~ txtoriginalwt - txtactualwt, txtoriginalwt, 100
mverr:
Lxit Sub
Lnd Sub



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 62

CHAPTER 6: FLOW CHART









lalse

1rue






SLarL
8rlna all moLors Lo lnlLlal poslLlon
8ead LemperaLure sensor value and send
Lo ersonal CompuLer
uaLabase ls read from ersonal CompuLer lf Lhe
requesL ls Lo swlLch on/swlLch off sLlrrer alarm
heaLer Lhen perform Lhe correspondlna acLlon
ls swlLch sw2 ls
pressed ?
8ead welahL from load cell and send Lo ersonal
CompuLer
8oLaLe convevor belL clockwlse for someLlme
and sLop
SwlLch on bulb
8 C
C
A
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 63

,80
%7:0














ls seareaaLlon done ?
swlLch sw1 ls pressed
u
u
SwlLch off 8ulb
A
8oLaLe convevor belL anLlclockwlse for
someLlme
8ead welahL from load cell and send daLa Lo
ersonal CompuLer (WelahL of cleaned cocoon)
8oLaLe convevor belL moLor ln clockwlse Lo
drop cocoons
8oLaLe convevor belL moLor ln anLlclockwlse for
lnlLlal poslLlon
8
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 64

6.1 FLOW CHART STEPS

STEP 1: Start the process.
STEP 2: Bring all motors to initial position.
STEP 3: Read temperature sensor value and send to PC.
STEP 4: DB25 parallel port is used to connect to the PC. It perIorms the ON/OFF
operations oI stirrer, motor, conveyor and heater on request.
STEP 5: Switch on sw2 oI microcontroller.
STEP 6: Read weight Irom the load cell send to PC.
STEP 7: Rotate the conveyer belt motor clockwise Ior some time and stop.
STEP 8: Switch on bulb.
STEP 9: Check the segregation condition, iI it is done, switch on sw1, iI its not
done complete the segregation process and again check Ior segregation condition.
STEP 10: II yes, switch OFF bulb or go to step 8 and repeat.
STEP 11: Rotate conveyer belt anti clockwise Ior some time.
STEP 12: Read the reduced weight oI cocoons Irom load cell and send to PC.
STEP 13: Rotate conveyor belt motor in clockwise to drop cocoons.
STEP 14: Rotate conveyor belt motor in anti clockwise Ior initial position.
STEP 15: Repeat the process Irom step 3 Ior next set oI weights oI cocoons.

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 65

CHAPTER 7 : RESULT


FIG 7.1: OUTCOME OF THE PRO1ECT
FROM FIG 7.1 RESULTS ARE AS FOLLOWS
O Temperature :26C
O Today`s rate : 30rs
O Initial weight : 560gms
O Reduced weight : 490gms
O Wastage : 70gms
O Total weight : 490gms
O Cost : 14,700rs
O Balance : 87
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 66

CHAPTER 8: APPLICATION AND FUTURE WORK
CONCLUSION
O The semi automatic cocoons selection, automatic temperature and lights
control circuits Ior the proiects model is designed.
O Tested & results are obtained, it is Iound that the energy utilized is
minimum compared to the existing conventional system.
FUTURE WORK
O II the mechanical design is oI larger size so as to weigh 50 Kgs oI
cocoons at a time.
O In this method, segregation process can be speeded up and the
power can be much more saved.
O Further the entire process to obtain the silk will be automated.
O Energy, Time & the man power can be reduced.
O It will improve the quality oI the silk , saves lot oI Iuel (wood) &
maintain pollution Iree environment.
O It will give good accuracy oI measurement oI cocoons than that oI
conventional method




SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 67

CHAPTER 9: BIBLIOGRAPHY
WEBSITE
http://www.emt-india.net/Presentations2010/09-Buildings-
15April2010/PIR.pdI
http://www.hobbyproiects.com/microcontrollertutorials.html
http://www.keil.com/c51
http://www.national.com/mpI/DC/ADC0809.html#Overview
http://www.datasheetsite.com/datasheet/ADC0809
http://www.omega.com/prodinIo/loadcells.html
http://www.societyoIrobots.com/robottheory/loadcellprimer.pdI
http://www.ladyada.net/learn/sensors/tmp36.html
http://www.IacstaII.bucknell.edu/mastascu/elessonshtml/Sensors/TempL
M35.html

BOOKS REFERRED
1.8051 MICROCONTROLLER (MAZIDI)
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 68

CHAPTER 10: APPENDIX

|Title
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 69

(CD74H
C14,

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 70


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 71

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 72

4H

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 73

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 74

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 75

T14)
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 76

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 77

ct
(High
Speed



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 78

CMOS
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 79


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 80


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 81



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 82

Logic
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 83


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 84


Hex


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 85

Invert

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 86

SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 87



SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 88


SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 89

You might also like