Top Banner
SERICULTURE MARKETING AND COON SELECTION MECHANISM 2011 SERICULTURE MARKETING AND COCOON SELECTION MECHANISM TABLE OF CONTENTS CHAPTER 1: INTRODUCTION 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 DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 1
115

Sericulture marketing and coccoon selection mechanism

Nov 27, 2014

Download

Documents

Dewan Desrtrose

Automated process for coccon selection mechanism n marketing via gsm
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

SERICULTUREMARKETINGANDCOCOON

SELECTION MECHANISM

TABLE OF CONTENTS

CHAPTER 1: INTRODUCTION 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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 1

Page 2: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

3.7 MICROCONTROLLER ALGORITHM........................................20

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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 2

Page 3: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 10: APPENDIX

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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 3

Page 4: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

4.1: COMPLETE INTERFACING DIAGRAM........................................35

4.1.1: INTERFACING DIAGRAM OF RELAY WITH CONVEYOR

STIRRER,HEATER......................................................................36

7.1: OUTCOME OF THE PROJECT......................................................65

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 4

Page 5: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 1: INTRODUCTION AND BACKGROUND

1.1 INTRODUCTION

Traditionally, in sericulture the weighing process is mechanical and selection

of cocoon is manually done. This takes a lot of time an inaccurate reading is

obtained due to human and mechanical errors. The farmer 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 of silk process, segregation of cocoons is done

with the help of a bulb along with natural light. After segregation, the cocoons

are put inside the steam bath, which requires 10-12kgs of bamboo for 6-8

mins of steam bath(for 200-300 kgs of 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 for

the boiling purpose it needs a fuel of 750 kgs.

Here we propose to automate the market place and change most of the

mechanical process into electrical which would be more accurate and reliable.

The temperature is maintained at a constant celsius with the help of LM35

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 5

Page 6: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

temperature sensor due to which the silk quality and the killing of the larvae is

not tampered.

1.2 OBJECTIVE OF OUR PROJECT

The objective of our project is to provide an aid for sericulture marketing.

Mass cocoon segregation mechanism by using electronic weighing machine.

To learn the concept of use of microcontroller.

Continuous monitoring of the temperature.

To get the weight difference before and after removing black spotted cocoons from the sample.

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

Optimize the entire system to make it accurate, efficient, cost effective.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 6

Page 7: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

1.3 ADVANTAGES

Semi automated cocoons selection

Less energy consumption and fast cocoon selection procedure

We propose to automate the procedure by connecting electronic

weighting machine to the microcontroller.

With modern GSM technique we will directly communicate with

farmer through SMS.

Less time consuming as we are using GSM technology.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 7

Page 8: Sericulture marketing and coccoon selection mechanism

Relay Driver Circuit (U

LN2003)

Motor for Stirrer

Tube lights control

Motor for ConveyorAnalog to Digital Converter

Load cell for weighing machine

OP-Amp (For Amplification)

(For amplification)

TemperatureSensor

Micro-controllerMain

Max 232

Centralize Database PCGSM

MODEM

SERICULTURE MARKETING AND 2011

CHAPTER 2: BLOCK DIAGRAM

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 8

Page 9: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

2.1 HARDWARE TOOLS

Load cell CZL-601

Amplifier AD620

Temperature sensor LM35

ADC0809 , 8-bit ADC , 8-channel multiplexer with 3 select

lines

Schmitt trigger 74HCT14

5 pin sugar cube relay

ULN2003 relay driver

DC motor , Rated output12V, 84RPM,current 1.0A at no load

DC motor , Rated output 12V , 74RPM , current 4A at load

Atmel mega 89C51

Transparent conveyor belt

Stirrer and tube light

Light Emitting Diode(LED) as heater

MAX232

DB9 male and female connectors.

DB25 male and female connectors.

SIM300_v7.03 model (GSM modem).

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 9

Page 10: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

2.2 SOFTWARE TOOLS

Visual Studio 6.0

Keil UV3 software

NXP-Flash magic

2.3 WORKING DESCRIPTION

Following components are included in our Project

1. LOAD CELL :

We use CZL601 model load cell, which is a bonded metallic

type strain gauge , which uses full wheatstone bridge. The

output will be in terms of milli volts.

Therefore ,we use AD620 amplifier for amplification, the

gain of the amplifier will be 500.Design part is explained in

the next chapter.

2. TEMPERATURE SENSOR :

We use LM35 temperature sensor, which does the direct

measurement of temperature.

It gives 10mV/degree rise in temperature.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 10

Page 11: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

We give temperature sensor output directly to ADC, for

100ºC it gives 1V.

3. ADC :

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.

The outputs from temperature sensor and load cell are

selected through IN0 and IN1 channel of ADC respectively.

Each input of ADC are selected once at a time by grounding

other input.

Based on the selected line of 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 for controlling the following:

Motor of the conveyor

Motor of the stirrer

ON-OFF control of tube light

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 11

Page 12: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

5. MICROCONTROLLER :

Microcontroller interfaces 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 :

In the PC using the centralized database we maintain a log of

the type and the quality of the cocoons being supplied by a

particular vendor and also the amount and quantity being

settled and for what price. These details can be used for

deciding and planning later. Visual Basic Language is used to

create the centralized database system.

7. GSM MODEM :

We use SIM300_V7.03 model of GSM modem

Through which the communication between Centralized data

base and the modem is made. Vice versa is also possible.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 12

Page 13: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 3: HARDWARE COMPONENTS

HARDWARECOMPONENTSUSED 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 full bridge fashion. The load cell is used to measure the weight of the unknown cocoons in kgs. Normally the load cell can weigh upto 50 kgs or more than that.

RATE LOAD (kg) : 3~120kg

FIGURE 3.1.1: DIAGRAM OF LOAD CELL

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 13

Page 14: Sericulture marketing and coccoon selection mechanism

26 7

48

1

3

5

-

+

U21AD620

LOAD CELL

5V

V-

V+

R38

100 Ohm

5V

To ADC Channel IN1

SERICULTURE MARKETING AND 2011

FIGURE 3.1.2: INTERFACING OF LOADCELL WITH AD620

DESIGN OF LOAD CELL:

Excitation voltage of load cell =5 v

Rated output of load cell = 2mV/V

For 120kg = [2mV*5] = 10mV

So, fullscale load of 120 kg →10mV output

Gain = [5/10mV] =500.

DESIGN OF AD620 AMPLIFIER:

The gain equation is

Rg = [49.4KΩ]/[499]=100Ω

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 14

Page 15: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Gain = [49.4kΩ/100]+1=495

3.2 ALGORITHM TO INTERFACE LOADCELL WITH ADC

STEP 1: Select the channel_0 of ADC to which output of load cell is connected.

STEP 3: Digital output of load cell is sent to the centralised database (PC) using serial communication.

STEP 4: Initial weight of the load cell is send to centralised data base by the controller, by sending equivalent character (!) value of data base

STEP 5: Second weight of the load cell is send to centralised data base by the controller, by sending equivalent character (@) value of data base

STEP 6: Original weight is calculated in centralised data base through VB software which is given by the following formula:

txtactualwt = txtoriginalwt - txtnewwt

3.3 TEMPERATURE SENSOR

DESIGN:

Temperature sensor range is from 1ºC to +150ºC

1ºC gives 10mV output

100ºC - 1V

150ºC gives 1.5V

In our application we need 100ºC to kill larvae.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 15

Page 16: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DESIGN DESCRIPTION

LM 35 senses the temperature and converts it into voltage (Linear 10mV raise per

degree raise in temperature). The output of the lm35 is directly given to the

channel IN1 of ADC so that the analog output is converted into digital form for the

microcontroller.

FIGURE 3.3.1 LM 35

3.4 ALGORITHMTO INTERFACELM35 WITH ADC

STEP 1: Select channel_1 of ADC for initial temperature.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 16

ADC

Page 17: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

STEP 2: The temperature sensor input is given to ADC in terms of volts and digital output of ADC is given to microcontroller and then the controller communicates with PC through serial port.

STEP 3: In centralised database the temperature value ‘#’ describes the room temperature obtained from 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 features 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 of 8-single-ended analog signals. The device eliminates the need for

external zero and full-scale adjustments. Easy interfacing to

microprocessors is provided by the latched and decoded multiplexer

address input.

INPUT:

Temperature sensor (1V) O/P is connected to pin IN1 and amplified load cell (3V) O/P is connected to pin IN0.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 17

Page 18: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIGURE 3.5.1: PIN DIAGRAM OF ADC 0808

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 18

Page 19: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIG: 3.5.2 INTERFACING DIAGRAM OF ADC WITH µC

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-performance CMOS 8-bit microcomputer with 4K bytes of Flash memory programmable and erasable read only memory (EPROM).

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 19

Page 20: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIGURE 3.6.1 PIN DETAILS OF µC 8051

3.7 MICROCONTROLLER ALGORITHM

STEP 1: Select channel_0 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.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 20

Page 21: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

STEP 4: Select channel_1 to which temperature sensor output is

connected.

STEP 5: Controller controls ADC0809 to get equivalent digital value of

sensed temperature.

STEP 6: This digital value (sensed temperature) send to the centralised

data base using serial communication.

STEP 7: Controller controls the bulb,motorstirrer,motorconveyor and

heater through driver circuit ULN2003.

STEP 8: MAX232 is interfaced with controller for communication with

centralised data base.

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 flowing through the coil ,the relay

creates a magnetic field, which attracts a lever and changes the switch

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 21

Page 22: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 22

NOO

POLE

NC

Vcc

Gnd

Page 23: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIG: 3.8.2 INTERFACING DIAGRAM OF RELAY WITH µC

PIN DETAILS

In the above figure3.8.2 the first and second relay pin no3 are

connected to the motor of conveyor(for clock wise and anti clock

wise rotation).

Third relay pin no3 is connected to the motor of stirrer, fourth

relay pin no3 is connected to the bulb and fifth relay pin no3 is

connected to the heater.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 23

Heater

Page 24: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

NO (pin 4) of each relay are grounded.

NC(pin5) of each relay are connected to the supply voltage of 5V

and 12V

And pin no2 of each relay is given to Pin no16,15,14,13,12 of

ULN2003 IC respectively.

Pin no1 of each relay are given to supply voltage of 12V and

output pins of ULN 1,2,3,4,5 are given to the microcontroller.

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//

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

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

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

acall stop_all_motorsclr p2.4clr p2.5

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 24

Page 25: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

move_back: acall Motor_1_anticlk jb intial_position, move_back acall stop_all_motors ret

move_front: acall Motor_1_clk ret

3.9 DC MOTOR

HEAVY GEARED DC MOTOR

FIGURE3.9.1 DC MOTOR

DESCRIPTION OF DC MOTOR Rate voltage: 12V

Speed: 84rpm (no load)

Current: 1.0A (no load)

Rate torque: 30kg.m

Speed: 75rpm (load)

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 25

Page 26: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Current: 4A (load)

3.10 ULN 2003 IC

DESCRIPTION

We use ULN2003 as current booster for relays in order to drive the motor of 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 fig:3.10.2

FIG 3.10.1: ULN 2003IC PIN DETAILS

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 26

Page 27: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

1 2 V

12

A-

+

12

A-

+

35 4

1 2 35 4

1 235 4

1 2

Heater

1 2 V

BULB5 V

-+

35 4

1 2

1 B1

2 B2

3 B3

4 B4

5 B5

6 B6

7 B7

1 C1 6

2 C1 5

3 C1 4

4 C1 3

5 C1 2

6 C1 1

7 C1 0

C O M9

G N D8

CONVEYER

STIRRER

ULN 2003

1 2 V

35 4

1 2

5 V

1 2 V

F ro m M C P in P o rt P 2 . 0

F ro m M C P in P o rt P 2 . 1

F ro m M C P in P o rt P 2 . 2

F ro m M C P in P o rt P 2 . 3

F ro m M C P in P o rt P 3 . 2

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) of 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 of the microcontroller.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 27

Page 28: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIG 3.11.1:DB9 CONNECTOR

CODE

Serial port connectivity codes

//Initializes the port for the COM Commection//

init_serial: 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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 28

Page 29: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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

send_serial: clr TI mov sbuf,ahere: jnb TI,here clr TI ret//Gets the contents from COM port and stores in accumulator//

getchar: clr ri clr ahere1: jnb ri,here1 clr ri mov a, sbuf ret

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

get_str: nopnot_end: call getchar call send_serial // to echo back the recieved byte//

cjnea,#27,not_end //#27,not_end,P marks end of communication// ret

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 29

Page 30: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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 from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept ±30V inputs. Each driver converts TTL/CMOS input levels into EIA-232 levels.

FEATURES

We connect a MAX 232 for the inter compatibility between the PC and µC signal levels.

It does signal level conversion automatically.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 30

Page 31: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

MAX232 parts are particularly useful in battery powered systems, since their low-power shut down mode reduces power dissipation to less than 5µW.

3.13 PARALLEL PORT CONNECTOR

DB25 is a parallel port connector from 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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 31

Page 32: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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: After decoding the data it will receive particular message to controller.

STEP 4: So that the controller will process the acquired data.

HARDWARECOMPONENTSUSED FOR SERICULTURE MARKETING

3.14 CENTRALISED DATABASE

Through centralised database we get information/data at a certain place where the marketinghasbeen made.

Final weight of cocoons obtained from load cell will be sent to the centralized data base (PC), which we got from the microcontroller.

We make the rotation of stirrer, operate the heater and get the temperature sensor readings by using Visual Basic.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 32

Page 33: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIG:3.14.1: INTERFACING DIAGRAM OF DATABASE WITH µc

3.15 GSM MODEM

GSM modem is suitable for remote dial-up systems where we are

using SIM300_V7.03 model.

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.

These datas are send to the farmer through SMS.

And vice versa is also possible

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 33

Page 34: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

FIG3.15.1: INTERFACING DIAGRAM OF GSM WITH DATABASE

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 34

PC

Page 35: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

3.16 VISUAL BASIC

FIG:3.16.1: FRONT END OF VISUAL BASIC

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 35

Page 36: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 4: CIRCUIT DIAGRAM

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 36

Page 37: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

P S E N2 9

A L E3 0

V C C4 0

G N D2 0

E A3 1

X119

X218

R S T9

P 0 . 0 / A D 03 9

P 0 . 1 / A D 13 8

P 0 . 2 / A D 23 7

P 0 . 3 / A D 33 6

P 0 . 4 / A D 43 5

P 0 . 5 / A D 53 4

P 0 . 6 / A D 63 3

P 0 . 7 / A D 73 2

P 1 . 01

P 1 . 12

P 1 . 23

P 1 . 34

P 1 . 45

P 1 . 56

P 1 . 67

P 1 . 78

P 2 . 0 / A 82 1

P 2 . 1 / A 92 2

P 2 . 2 / A 1 02 3

P 2 . 3 / A 1 12 4

P 2 . 4 / A 1 22 5

P 2 . 5 / A 1 32 6

P 2 . 6 / A 1 42 7

P 2 . 7 / A 1 52 8

P 3 . 0 / R XD1 0

P 3 . 1 / TXD1 1

P 3 . 2 / I N T01 2

P 3 . 3 / I N T11 3

P 3 . 4 / T01 4

P 3 . 5 / T11 5

P 3 . 6 / W R1 6

P 3 . 7 / R D1 7

U 1

C L K1 0

O E9

E O C7

D 01 7

D 11 4

D 21 5

D 38

D 41 8

D 51 9

D 62 0

D 72 1

S TA R T6

A L E2 2

V C C1 1

G N D1 3

R E F +1 2

R E F -1 6

I N 02 6

I N 12 7

I N 22 8

I N 31

I N 42

I N 53

I N 64

I N 75

A 02 5

A 12 4

A 22 3

MICROCONTROLLER 89C51

5 V

C R Y S TA L

11.0592MHZ

47uf

10K

5 v

12345678910

4.7K SIP

12345678910

4.7K SIP

S W 2

M C R E S E T

3 3 p f

Q 12 N 3 9 0 4

3 3 p f

12 3 4 5 6 7 8 9 10

4.7K SIP

R 3 4

4 . 7 K

5 V

12 3 4 5 6 7 8 9 10

4.7K SIP

To M A X2 3 2 P in n o . 1 1 TXD

F ro m M A X2 3 2 P in n o . 1 2 R XD

1

2

L S 1 1

B U Z Z E R

Te m p e ra t u re S e n s o r

L o a d C e ll

5 V

1 32 51 22 41 12 31 02 292 182 071 961 851 741 631 521 41

P 1

C O N N E C TO R D B 2 5

C o n v e y o r M o t o r +

C o n v e y o r M o t o r -

1KSCHMITT TRIGGER

0.001uf

34

U 1 6 B

74HCT14

S t irre r

5 v

B u lb

H e a t e r

ADC 0809S W 1

C O N V E Y O R I N I TI A L5 V

FIG: 4.1. COMPLETE INTERFACING DIAGRAM

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 37

A

Page 38: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

1 2 V

12

A-

+

12

A-

+

35 4

1 2 35 4

1 235 4

1 2

Heater

1 2 V

BULB5 V

-+

35 4

1 2

1 B1

2 B2

3 B3

4 B4

5 B5

6 B6

7 B7

1 C1 6

2 C1 5

3 C1 4

4 C1 3

5 C1 2

6 C1 1

7 C1 0

C O M9

G N D8

CONVEYER

STIRRER

ULN 2003

1 2 V

35 4

1 2

5 V

1 2 V

F ro m M C P in P o rt P 2 . 0

F ro m M C P in P o rt P 2 . 1

F ro m M C P in P o rt P 2 . 2

F ro m M C P in P o rt P 2 . 3

F ro m M C P in P o rt P 3 . 2

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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 38

A

Page 39: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 5: SOFTWARE CODE

5.1 CONTROLLER CODE

SERICULTURE

// Declaration for ADC //

start EQU p2.7

add_a EQU p2.6

ADC_data_port EQU p0

segregation_done EQU p1.5

intial_position EQU p1.4

start_switch EQU p1.0

// Declaration for Temperature sensor//

adc_val_returned DATA 21h

converting_val DATA22h

temp2 DATA23h

org 0x00

LJMP main

org 0003h

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 39

Page 40: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

ret

org 0013h // Address for

external interrupt 1//

ret

org 0x100

// Standard delays//

delay_half_second:

push 00

push 01

push 02

mov r2,#0ah ; // Changed from

16 to 0a//

two_dely:mov r1,#64h

one_dely:mov r0,#0ffh

back: djnz r0,back

djnz r1, one_dely

djnz r2,two_dely

pop 02

pop 01

pop 00

ret

// Delay_half_second1//

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 40

Page 41: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

push 00

push 01

push 02

mov r2,#06h // Changed from

16 to 0a//

two_dely1:mov r1,#64h

one_dely1:mov r0,#0ffh

back1: djnz r0,back1

djnz r1, one_dely

djnz r2,two_dely1

pop 02

pop 01

pop 00

ret

Wait_20ms: push 06

push 07

mov R6,#20

mov R7,#0

WL_01: nop

nop

djnz R7,WL_01

djnz R6,WL_01

pop 07

pop 06

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 41

Page 42: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

ret

Wait_200ms: push 06

push 07

mov R6,#20

mov R7,#0

WL_200: nop

nop

djnz R7,WL_200

djnz R6,WL_200

pop 07

pop 06

ret

//Delay_100us//

delay_100us:push 00

mov r0,#46

delay_100us_loop: djnz r1,delay_100us_loop

pop 00

ret

//Delay_16ms//

delay_16ms:push 00

push 01

mov r0,#30

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 42

Page 43: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

delay_16ms_loop1:mov r1,#255

delay_16ms_loop2:djnz r1,delay_16ms_loop2

djnz r0,delay_16ms_loop1

pop 01

pop 00

ret

delay_1ms: push 06

push 05

mov r6,#02h

delay_1ms_2: mov r5,#0e4h

delay_1ms_1:djnz r5,delay_1ms_1

djnz r6,delay_1ms_2

pop 05

pop 06

ret

// Delay 5 ms//

delay_5ms:acall delay_1ms

acall delay_1ms

acall delay_1ms

acall delay_1ms

acall delay_1ms

ret

// Delay 3 ms//

delay_3ms:acall delay_1ms

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 43

Page 44: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

acall delay_1ms

acall delay_1ms

ret

//Serial Port Connectivity codes//

//Initializes the port for the COM Commection//

init_serial:mov TH1,#0FDh // Pour

28,800 Hz//

mov TL1,#0Ffh

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

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

send_serial: clr TI

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 44

Page 45: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

mov sbuf,a

here:jnb TI,here

clr TI

ret

//Gets the contents from COM port and stores in

accumulator//

getchar: clr ri

clr a

here1: jnb ri,here1

clr ri

mov a, sbuf

ret

//Routine to continuously monitor and echo the value

received//

get_str: nop

not_end: call getchar

call send_serial // To echo back

the rxed byte//

cjne a,#27,not_end;#27,not_end // P marks the end of the

Communication//

ret

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 45

Page 46: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

//Serial port codes end here//

//Display_message_serial//

push 07

push acc

mov r7, #20 //0f for 16

characters,28hfor 40 characters//

all_char1:mov a, #00h //

Reset accumulator//

movc a,@a+dptr

mov sbuf,a

here_disp1 // jnb

TI,here_disp1//

clr TI

inc dptr

djnz r7, all_char1

pop acc

pop 07

ret

display_gr8:DB "working @ 57600 "

display_hello:DB "HELLO"

display_done:DB "Done"

//Test_display//

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 46

Page 47: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

mov dptr, #display_gr8

acall display_message_serial

ret

//Motor Control Code//

Motor_1_clk:setb p2.2 ; dir ctrl

// front//

clr p2.3 // Enable

movement//

ret

Motor_1_anticlk:clr p2.2 ; dir ctrl

// Back//

setb p2.3 //Enable

movement//

ret

stop_all_motors:setb p2.2

// dir ctrl//

setb p2.3 //Enable

movement//

ret

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 47

Page 48: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

//At reset//

at_reset:setb p3.7; switch off teh bulb

acall stop_all_motors

clr p2.4

clr p2.5

lcall init_serial

acall test_display

move_back:acall Motor_1_anticlk

jb intial_position, move_back

acall stop_all_motors

ret

move_front: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

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 48

Page 49: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

ret

//Use to fill the location with the ADC value captured//

//Set the channel address before calling this routine//

//value returned will be present in the location

"adc_val_returned"//

get_adc_and_store:lcall delay_1ms

lcall delay_1ms

lcall delay_1ms

setb start // issue

start conversion//

lcall delay_1ms

lcall delay_1ms

lcall delay_1ms

clrstart // clearing to

get the pulse//

lcall delay_5ms //delay for the

EOC to be active//

lcall delay_5ms

lcall delay_5ms

lcall delay_5ms

lcall delay_5ms

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 49

Page 50: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

mov a, ADC_data_port

mov adc_val_returned, a

ret

//Main code Starts here//

main:

mov sp, #64h

acall at_reset

loop:acall select_channel_in_1

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second

mov a, #'#'

acall send_serial

acall get_adc_and_store

mov a, adc_val_returned

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 50

Page 51: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

acall send_serial

acall check_parallel_port_values

jnb start_switch, take_weight_and_start

jmp loop

end_loop:

jmp loop

//Take_weight_and_start//

acall select_channel_in_0

lcall delay_half_second

lcall delay_half_second

acall get_adc_and_store

mov a, adc_val_returned

mov 30h, a

// weight one//

acall Motor_1_clk

lcall delay_half_second

lcall delay_half_second

//lcall delay_half_second//

acall stop_all_motors

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 51

Page 52: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

clr p3.7

//switch on the bulb//

keep_segregating:

jb segregation_done, keep_segregating

setb p3.7 //

switch off the bulb//

acall move_back

acall select_channel_in_0

lcall delay_half_second

lcall delay_half_second

acall get_adc_and_store

mov a, adc_val_returned

mov 31h, a

//weight two//

mov a, #'!'

acall send_serial

mov a, 30h

acall send_serial

mov a, #'@'

acall send_serial

mov a, 31h

acall send_serial

acall check_parallel_port_values

lcall delay_half_second

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 52

Page 53: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second

acall move_front // to

drop the material//

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second1

call stop_all_motors

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second

lcall delay_half_second

acall move_back // to return to

the base position//

jmp end_loop

check_parallel_port_values:

mov c, p1.1

mov p2.0, c

// stirrer//

mov c, p1.2

mov c, p1.3

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 53

Page 54: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

mov p3.5, c

// heater//

ret

5.2 CENTRALISED DATABASE CODE

// Interfacing code with stirrer //

Public flag As Boolean

Public objGSM As ClsGSMModem

Public objSerial As ClsSerialCommunication

Dim Totstr, St1, St2, St3, St4, St5, SMSBODY As String

Dim tmp, Cmdlen, MsgLen, l1, l2 As Integer

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds

As Long)

Dim value_Data_Port

Private Sub Check1_Click()

If Check1.Value = vbChecked Then

'Out Val("&H" & "e800"), Val(253)

value_Data_Port = value_Data_Port And Value_STIRRER_ON

Else

'Out Val("&H" & "e800"), Val(254)

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 54

Page 55: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

value_Data_Port = value_Data_Port Or Value_STIRRER_OFF

End If

End Sub

// Interfacing code of heater to ON-OFF //

Private Sub Check3_Click()

If Check3.Value = vbChecked Then

'Out Val("&H" & "e800"), Val(247)

value_Data_Port = value_Data_Port And Value_HEATER_ON

Else

'Out Val("&H" & "e800"), Val(254)

value_Data_Port = value_Data_Port Or Value_HEATER_OFF

End If

End Sub

Private Sub cmdOpen1_Click()

On Error GoTo myerr

If Left(cmbPort1.Text, 3) <> "COM" Then

MsgBox "Specify the CommPort first"

Exit Sub

End If

'Settings for Comm Port

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 55

Page 56: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

If MSComm1.PortOpen = True Then MSComm1.PortOpen =

False

'Open The CommPort

MSComm1.CommPort = Mid(cmbPort1.Text, 4)

MSComm1.PortOpen = True

Call SaveSetting("MSComm1", "Settings", "CommPort",

cmbPort1.Text)

myerr:

MsgBox err.Description

End Sub

// Code for GSM communication with centralised data base //

Private SubcmbPortGSM_DropDown()

cmbPortGSM.Clear

objSerial.GetSerialPorts MSComm1, cmbPortGSM

End Sub

Private Sub cmbPortGSM_DropDown()

cmbPortGSM.Clear

objSerial.GetSerialPorts MSComm2, cmbPortGSM

End Sub

Private Sub cmdGetWt_Click()

txtResponse_Change

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 56

Page 57: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

End Sub

Private Sub CMDOPEN2_Click()

On Error GoTo myerr

If Left(cmbPort.Text, 3) <> "COM" Then

MsgBox "Specify the CommPort first"

Exit Sub

End If

// Settings for communication Port //

If MSComm2.PortOpen = True Then MSComm2.PortOpen =

False

'Open The CommPort

MSComm2.CommPort = Mid(cmbPort.Text, 4)

MSComm2.PortOpen = True

Call SaveSetting("MSComm2", "Settings", "CommPort",

cmbPort.Text)

myerr:

MsgBox err.Description

End Sub

Private Sub cmdsart_Click()

value_Data_Port = value_Data_Port And Value_START

Out Val("&H" & "e800"), value_Data_Port

Sleep 5000

value_Data_Port = value_Data_Port Or Value_STOP

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 57

Page 58: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Out Val("&H" & "e800"), value_Data_Port

'flag = True

End Sub

Private Sub Command1_Click()

End

End Sub

Private Sub Command2_Click()

MsgBox (CInt("&H29"))

End Sub

Private Sub Command3_Click()

objSerial.OpenComport MSComm1, cmbPortGSM

objGSM.TestModem MSComm1

Sleep 500

objGSM.ChangeToTextMode MSComm1

Sleep 500

objGSM.IsModemReady MSComm1

Sleep 500

'txtmsg.Text = "Cost is :" & txtcost & "Balance is :" &

TXTBALANCE

'objGSM.SendSMS MSComm1, "", txtmob.Text, txtmsg.Text

'Sleep 1000

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 58

Page 59: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

objGSM.InitRecieve MSComm1

End Sub

Private Sub Command4_Click()

objGSM.TestModem MSComm1

Sleep 500

objGSM.ChangeToTextMode MSComm1

Sleep 500

objGSM.IsModemReady MSComm1

Sleep 500

txtmsg.Text = "Todays Rate:" & cmbtodatrate & "Wastage:" &

txtactualwt & "TotalWeight:" & Text4.Text

txtmsg.Text = txtmsg.Text & "Cost:" & txtcost & "Balance:" &

TXTBALANCE

objGSM.SendSMS MSComm1, "", txtmob.Text, txtmsg.Text

Sleep 1000

objGSM.InitRecieve MSComm1

End Sub

Private Sub Command5_Click()

Frame1.Visible = True

End Sub

Private Sub Form_Load()

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 59

Page 60: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

'Out Val("&H" & "e800"), Val(255)

value_Data_Port = Default_Value_Data_port

Set objGSM = New ClsGSMModem

Set objSerial = New ClsSerialCommunication

End Sub

Private Sub MSComm1_OnComm()

Dim strbuff As String

Dim smsg As String

Dim strMsg As String

Dim strMob As String

Dim lg As Integer

Select Case MSComm1.CommEvent

Case comEvReceive

Sleep 300

strbuff = MSComm1.Input

' strGSM_input = strGSM_input & strbuff

Text6.Text = Text6.Text + strbuff

objGSM.GetSMS MSComm1, strbuff, strMob, strMsg

strbuff = ""

If (Len(strMob) <> 0) Then

txtmob.Text = strMob

txtmsg.Text = strMsg

ParseGSM strMob, strMsg

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 60

Page 61: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

End If

End Select

End Sub

Private Sub ParseGSM(strMob As String, strMsg As String)

If InStr(1, txtmsg.Text, "TodaysRate", vbBinaryCompare) Then

objGSM.TestModem MSComm1

Sleep 500

objGSM.ChangeToTextMode MSComm1

Sleep 500

objGSM.IsModemReady MSComm1

Sleep 500

txtmsg.Text = cmbtodatrate.Text

objGSM.SendSMS MSComm1, "", txtmob.Text, "TodaysRateis:"

& txtmsg.Text

Sleep 1000

objGSM.InitRecieve MSComm1

End If

End Sub

// Interfacing code of temperature sensor //

Private Sub MSComm2_OnComm()

Dim txtBuf As String, i, c As Integer

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 61

Page 62: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

With MSComm2

Select Case .CommEvent

Case comEvReceive

txtBuf = .Input

Text5.Text = txtBuf

For i = 1 To Len(txtBuf)

c = Asc(Mid(txtBuf, i, 1))

' txtdec = (c)

' Text5.Text = Text5.Text & txtdec

' If (c = 35 Or c = 33 Or c = 64) Then

' Text3.Text = Text3.Text & ChrW(c)

' End If

' txtResponse = txtResponse & c

Next i

' txtResponse = Right(txtResponse, 1)

' Text3.Text = Text3.Text & ChrW(c)

' End Select

End With

On Error GoTo myerr

If txtResponse = "" Then Exit Sub

'If Len(txtResponse) > 2 Then

If InStr(1, Text5.Text, "#") Then

index1 = InStr(1, Text5.Text, "#", vbTextCompare)

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 62

Page 63: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Text3.Text = ""

Text1.Text = Mid(txtResponse.Text, index1 + 1, 2)

Text2.Text = (Asc(UCase(Mid(txtResponse.Text, index1 + 1,

2))))

'txttemperarture.Text = CInt(Asc(Mid(txtResponse.Text, index1

+ 1, 2)) * (100 / 255))

txttemperarture.Text = CInt(Asc(Mid(txtResponse.Text, index1

+ 1, 2)) * (100 / 255))

txttemperarture.Text = txttemperarture.Text + 5

'txtTemperature.Text = CInt(Asc(Mid(txtResponse.Text, (temp +

2), (bin - 2))) * (100 / 255))

End If

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

If InStr(1, Text5.Text, "!") Then

index22 = InStr(1, Text5.Text, "!", vbTextCompare)

Text3.Text = ""

temp1 = CInt("&H" + (Mid(txtResponse.Text, index22 + 1, 2)))

'txtoriginalwt = (Mid(Text5.Text, index22 + 1, 2))

' temp1 = (Val(txtoriginalwt))

// Initial weight will be calculated and stored in temp1 //

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 63

Page 64: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

temp1 = (Val(temp1))

temp1 = temp1 * WTFACTOR

'' txtoriginalwt = CInt("&H" + (Mid(txtResponse.Text, index22 +

1, 2)))

'' 'txtoriginalwt = (Mid(Text5.Text, index22 + 1, 2))

'' txtoriginalwt = (Val(txtoriginalwt))

'' txtoriginalwt = txtoriginalwt * WTFACTOR

End If

If InStr(1, Text5.Text, "@") Then

index33 = InStr(1, Text5.Text, "@", vbTextCompare)

Text3.Text = ""

// Reduced value will be calculated and stored in temp2 //

temp2 = CInt("&H" + (Mid(txtResponse.Text, index33 + 1, 2)))

' temp2 = txtnewwt

' temp2 = txtnewwt * WTFACTOR

temp2 = temp2

temp2 = temp2 * WTFACTOR

// Comparing initial weight and reduced weight //

If temp2 > temp1 Then

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 64

Page 65: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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

txtoriginalwt = temp2

txtnewwt = temp1

Else

// Otherwise temp1 will be declared as original weight //

txtoriginalwt = temp1

txtnewwt = temp2

End If

' txtnewwt = CInt("&H" + (Mid(txtResponse.Text, index33 + 1,

2)))

' txtnewwt = txtnewwt

' txtnewwt = txtnewwt '* WTFACTOR

// Calculating the actual weight //

txtactualwt = txtoriginalwt - txtnewwt

End If

txtResponse = ""

' End If

myerr:

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 65

Page 66: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Exit Sub

txtResponse.SelStart = Len(txtResponse)

End Sub

Private Sub txtactualwt_Change()

On Error GoTo myerr

Text4.Text = txtnewwt.Text

// Calculating the cost //

txtcost = Text4.Text * cmbtodatrate.Text

// Calcuating balance weight of load cell which is left //

TXTBALANCE = ((txtoriginalwt - txtactualwt) / txtoriginalwt) *

100

myerr:

Exit Sub

End Sub

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 66

Page 67: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 6: FLOW CHART

False

True

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 67

Start

Bring all motors to initial position

Read temperature sensor value and send to Personal Computer

Database is read from Personal Computer. If the request is to switch on/switch off stirrer, alarm, heater then perform the corresponding action.

Is switch sw2 is pressed ?

Read weight from load cell and send to Personal Computer

Rotate conveyor belt clockwise for sometime and stop

Switch on bulb

BC

C

A

Page 68: Sericulture marketing and coccoon selection mechanism

Switch off Bulb

A

Rotate conveyor belt anticlockwise for sometime

Read weight from load cell and send data to Personal Computer (Weight of cleaned cocoon)

Rotate conveyor belt motor in clockwise to drop cocoons

Rotate conveyor belt motor in anticlockwise for initial position

B

SERICULTURE MARKETING AND 2011

False

True

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 68

Is segregation done ? switch sw1 is pressed

D

D

Page 69: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

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 performs the ON/OFF operations of stirrer, motor, conveyor and heater on request.

STEP 5: Switch on sw2 of microcontroller.

STEP 6: Read weight from the load cell send to PC.

STEP 7: Rotate the conveyer belt motor clockwise for some time and stop.

STEP 8: Switch on bulb.

STEP 9: Check the segregation condition, if it is done, switch on sw1, if its not done complete the segregation process and again check for segregation condition.

STEP 10: If yes, switch OFF bulb or go to step 8 and repeat.

STEP 11: Rotate conveyer belt anti clockwise for some time.

STEP 12: Read the reduced weight of cocoons from 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 for initial position.

STEP 15: Repeat the process from step 3 for next set of weights of cocoons.

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 69

Page 70: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 7 : RESULT

FIG 7.1: OUTCOME OF THE PROJECT FROM FIG 7.1 RESULTS ARE AS FOLLOWS

Temperature :26ºC Today’s rate : 30rs Initial weight : 560gms Reduced weight : 490gms Wastage : 70gms Total weight : 490gms Cost : 14,700rs Balance : 87%

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 70

Page 71: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 8: APPLICATION AND FUTURE WORK

CONCLUSION

The semi automatic cocoons selection, automatic temperature and lights control circuits for the projects model is designed.

Tested & results are obtained, it is found that the energy utilized is minimum compared to the existing conventional system.

FUTURE WORK

If the mechanical design is of larger size so as to weigh 50 Kgs of cocoons at a time.

In this method, segregation process can be speeded up and the power can be much more saved.

Further the entire process to obtain the silk will be automated. Energy, Time & the man power can be reduced. It will improve the quality of the silk , saves lot of fuel (wood) &

maintain pollution free environment. It will give good accuracy of measurement of cocoons than that of

conventional method

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 71

Page 72: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CHAPTER 9: BIBLIOGRAPHY

WEBSITE

http://www.emt-india.net/Presentations2010/09-Buildings-

15April2010/PIR.pdf

http://www.hobbyprojects.com/microcontroller_tutorials.html

http://www.keil.com/c51

http://www.national.com/mpf/DC/ADC0809.html#Overview

http://www.datasheetsite.com/datasheet/ADC0809

http://www.omega.com/prodinfo/loadcells.html

http://www.societyofrobots.com/robottheory/load_cell_primer.pdf

http://www.ladyada.net/learn/sensors/tmp36.html

http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Sensors/

TempLM35.html

BOOKS REFERRED

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 72

Page 73: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

1.8051 MICROCONTROLLER (MAZIDI)

CHAPTER 10: APPENDIX

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 73

Page 74: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

[Title(CD74HC14,

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 74

Page 75: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 75

Page 76: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 76

Page 77: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

4H

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 77

Page 78: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 78

Page 79: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 79

Page 80: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

T14)

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 80

Page 81: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 81

Page 82: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

ct(HighSpeed

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 82

Page 83: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

CMOS

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 83

Page 84: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 84

Page 85: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 85

Page 86: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 86

Page 87: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Logic

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 87

Page 88: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 88

Page 89: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Hex

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 89

Page 90: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

Invert

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 90

Page 91: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 91

Page 92: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 92

Page 93: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 93

Page 94: Sericulture marketing and coccoon selection mechanism

SERICULTURE MARKETING AND 2011

DEPT OF INSTUMENTATION TECHNOLOGY, MSRIT Page 94