Professional Documents
Culture Documents
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