Anda di halaman 1dari 17

1

Chapter 4
Hardware Module
In this chapter, we will study:
Mechanical Hardware Module
Electronic Hardware Modules
o DC Power Supply Module
o Microcontroller Module
o Serial Communication Module
o Belt Motor Drive
o IR Sensors Module
o H-Bridge Module
o Weighing Scale Module
Integration of sub-modules
List of Figures
Fig. 1 Conveyer Belt System.2
Fig. 2 Light Box3
Fig. 3 Lever...4
Fig. 1 Power Supply Circuit Diagram...4
Fig. 2 Power Supply PCB.4
Fig. 3 Atmega16 Pin Configuration..7
Fig. 4 Data Transmission Types8
Fig. 5 RS232 Connector 9
Fig. 6 MAX232 Pin Configuration.9
Fig. 7 MAX232 Typical Operating Circuit10
Fig. 8 (a) Belt Motor Drive Circuit Diagram 10
(b) Belt Motor Drive PC Board11
Fig. 9 IR Sensors Circuit Diagram.11
Fig. 10 H-Bridge Circuit Diagram.12
Fig. 11 H-Bridge PC Board...13
Fig. 12 Load Cell (weight sensor).12
Fig. 13 Block Diagram..13
Fig. 14 First Lever activated Position14
Fig. 15 Normal Lever Position..14
Fig. 16 Second Lever activated Position15
List of Tables
Table. 1 RS232 Pins...............................................................................................................7
2

Mechanical Hardware Module
In Mechanical Hardware Module there are following sub-modules:
1. Conveyer Belt System
2. Light Box
3. Stand System
4. Levers
Now let us discuss the use and specifications of these modules one by one:
1. Conveyer Belt System
A conveyor belt system consists of two or more pulleys (sometimes stated to
as drums), with an endless loop of carrying medium - the conveyor belt - that rotates
about them. One or both of the pulleys powered up, moving the belt and the material
on the belt to the forward direction. In our system we are using the same kind of
Conveyer Belt system which is used for carrying the fruit from beginning point to first
under the camera and then to the specified buckets. This is the main part of our
system, which completes the sorting and grading tasks. This is shown as under in the
following figure:

Fig. 1 Conveyer Belt System
The fruit is placed on one side of the belt and then after software decision making it
finally goes to respective bucket with the help of Levers.
2. Light Box
The light box serves the purpose of getting the clear image of the fruit. This
box is formed of Acrylic Sheet material and is covered from outside to stop the
external light come inside the box. It consists of two light sources inside the box,
3

which make sure the presence of uniform light on the fruit. This is used for the
following purposes:
Uniform Light
No External Light Interference
Objects Shadow Removal
Therefore, this is another major portion of the Hardware Module. This Light Box
shown in the following figure:

Fig. 2 Light Box
3. Stand System
The whole System is fixed on a standing system. This stand is 1m high and
1m in length. It is lifting up the whole system to 1m height. The following parts or
sub-modules directly fixed with this system:
Conveyer Belt
Motors
Buckets
Light Box
PCBs support
So this is also a major portion of the mechanical hardware system. All the above
mentioned sub-modules are strongly fixed on this standing system.
4

4. Levers
This is also a major part of the Mechanical Hardware, which serves a great
part in sorting and grading of fruit. Its lengthy part is of Aluminium and the fixing
part is of Iron Metal. They are fixed on the shafts of motors, which are being
controlled by Microcontroller. Its length is 1ft and they move over the belt between
two fixed hooks. The fruit on the Conveyer Belt after decision-making slides with the
lever and goes to the specified category bucket. This is shown in the figure below:

Fig. 3 Lever
Electronic Hardware Module
Electronic Hardware Sub-modules:
1. DC Power Supply Module
This Module is used to provide the specific required amount of voltages to the
other modules of the Hardware. This supply is designed to provide +5V, +12V and
Variable (0.5-35V) to drive all other modules. The supply is shown in the following
figure:


Fig. 1 Power Supply Circuit Diagram
5


Fig. 2 Power Supply PCB
It is consisted of the following sub-parts:
a. Transformer (12V, 2A)
b. Power Diodes
c. Capacitors (4700uF, 50V)
d. Voltage Regulators LM7805, LM7812, LM317
These four components combined to provide required DC Voltages. The
Transformer steps down the AC voltage level from ~230V to ~13V. The diode bridge
rectifies the AC voltages to pulsating DC voltages, the Capacitors filters these
voltages and the DC voltages are obtained. The voltage regulator LM7805, LM7812
and LM317 changes the voltage levels and regulates these voltages to +5V, +12V and
Variable (0.5-35V) respectively.
2. Microcontroller Module
This is the most important Module of hardware. It controls the processing of
all other modules in hardware. Atmega16 is used in our application and have
following main features:
High-performance, Low-power Atmel AVR 8-bit Microcontroller
Advanced RISC Architecture
o 131 Powerful Instructions
o 32 x 8 General Purpose Working Registers
o Fully Static Operation
o Up to 16 MIPS Throughput at 16 MHz
o On-chip 2-cycle Multiplier
6

High Strength Non-volatile Memory segments
o 16 Kbytes of In-System Self-programmable Flash memory
o 512 Bytes of EEPROM
o 1 Kbyte of Internal SRAM
o Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
o Data retention: 20 years at 85C/100 years at 25C
o Programmable Lock for Software Security
JTAG Interface
o Boundary-scan Capabilities According to the JTAG Standard
o Widespread On-chip Debug Support
o Programming of Flash, EEPROM, Fuse, and Lock Bits through the
JTAG Interface
Bordering Features
o Two 8-bit Timers/Counters with Separate Pre-scalers and Compare
Modes
o One 16-bit Timer/Counter with Separate Pre-scaler, Compare Mode,
and Capture Mode
o Real Time Counter with Separate Oscillator
o Four PWM Channels
o 8-channel, 10-bit ADC
8 Single-ended Channels
7 Differential Channels in TQFP Package Only
2 Differential Channels with Prog. Gain at 1x, 10x, or 200x
o Byte-oriented Two-wire Serial Interface
o Programmable Serial USART
o Master/Slave SPI Serial Interface
o Programmable Watchdog Timer with Separate On-chip Oscillator
o On-chip Analogue Comparator
Special Microcontroller Features
o Power-on Reset and Programmable Brown-out Detection
o Internal Calibrated RC Oscillator
o External and Internal Interrupt Sources
o Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-
down, Standby and Extended Standby
7

I/O and Packages
o 32 Programmable I/O Lines
o 40-pin PDIP, 44-lead TQFP, and 44-pad QFN/MLF
Operating Voltages
o 2.7V - 5.5V for ATmega16L
o 4.5V - 5.5V for ATmega16
Speed Ratings
o 0 - 8 MHz for ATmega16L
o 0 - 16 MHz for ATmega16
Our system is using Serial Communication with the Baud Rate of 9600 with
frequency of 8MHz, so 0x33 is loaded into UBRRL register and Interrupts of RXC,
TXC and external interrupt INT0. The Microcontroller through Serial
Communication controls the Motors and different delays are used to maintain the ON
time of the Motors. The working of each Module is discussed later in this chapter.
The pin configuration of the Atmega16 shown as under:
Pin Configuration

Fig. 3 Atmega16 Pin Configuration

8

3. Serial Communication Module
Computers normally transfer data in two ways:
a. Parallel
i. Normally 8 or more lines are used to transfer data to a device that is
only a few feet away
b. Serial
i. To transfer data to a device located many meters away, the serial
method is used
ii. The data is sent one bit at a time
Here our concern is about the transfer of data serially. The basic features of Serial
Communication are given as under:
At the transmitting side, the byte of data must be converted to serial bits using
parallel-in-serial-out shift register
At the receiving side, there is a serial-in-parallel-out shift register to receive the
serial data and pack them back into byte
Serial data communication uses two methods
o Synchronous method, which transfers a block of data at a time.
o Asynchronous method, which transfers a single byte at a time.
It is possible to write software to use either of these methods, but the programs
can be monotonous and long.
There are special IC chips made by many manufacturers for serial
communications
o UART (universal asynchronous Receiver transmitter)
o USART (universal synchronous-asynchronous Receiver-transmitter)
Half- and Full-Duplex Transmission
o If data can be both transmitted and received simultaneously, it is called
duplex transmission.
o If data transmitted only one way a time, it is referred to as half duplex.
o If data can go both ways at a time, it is full duplex.
o This is totally contrasted to simplex transmission.
9


Fig. 4 Data Transmission Types
Asynchronous serial data communication is widely used for character-oriented
transmissions. Each character is placed in between a start and stop bits. The start
bit is always one bit, but the stop bit can be one or two bits. The start bit is
always a 0 (low) and the stop bit(s) is 1 (high).
RS232 Standards
RS232 is one of the most widely used I/O interfacing standards. In RS232, a 1
is represented by -3 to -25V, while a 0 is represented by +3 to +25V, making -3 and
+3 undefined. For this reason, to connect any RS232 to a microcontroller system, we
must use a voltage converter such as MAX232 to convert TTL logic levels to RS232
voltage levels and vice versa. The RS232 connectors are of different types, while DB9
connector is of our concern. It has nine pins and every pin has a specific function
regarding the serial communication. It is shown in the following figure and table with
pin configuration:

Fig. 5 RS232 Connector Table. 1 RS232 Pins
10

MAX232
A line driver such as the MAX232 chip is required to convert RS232 voltage
levels to TTL levels, and vice versa. AVR has two pins which are used specifically for
transferring and receiving data serially. These two pins are called TXD and RXD and
are part of the PORTD group (PD0 and PD1). These pins are TTL compatible; We
need a line driver (voltage converter) to convert the R232s signals to TTL voltage
levels that will be acceptable to AVR's TXD and RXD pins. This IC's pin
configuration can be shown in the following figure:

Fig. 6 MAX232 Pin Configuration
For this IC to work for the Line Driver application a Typical Operating Circuit
is required with this device. This Circuit consists of Capacitors connected to the
specified pins of the device. The IC with this circuit is shown in the following figure:

Fig. 7 MAX232 Typical Operating Circuit
11

4. Belt Motor Drive
To drive the conveyer belt we are using a geared DC motor of 12V, 2A rating.
The components used to build this drive are as under:
a. Relay (DC 120V, 7AAC 230V, 10A)
b. Transistor TIP122
c. Diode
d. Resistors (10-kOhms, 100-Ohms)
The microcontroller with the Relay switch controls this motor. A separate Power
supply used to drive this motor through Relay. The circuit diagram is shown as under:


(a) (b)
Fig. 8 (a) Belt Motor Drive Circuit Diagram
(b) Belt Motor Drive PC Board
As we apply the signal to the base of transistor, then the relay switches ON
and the supply provides 12V to the motor through this switch and the motor starts.
The freewheeling diode is used to limit the current in the coil of Relay. The 100-Ohm
resistor prevents the transistor from heating due to current drawn by the Relay coil.
5. IR Sensors Module
In order to detect the arrival of fruit under the Camera IR Sensors pair (Emitter
and Detector) is used. This pair is mounted on both sides of the conveyer belt. The
circuitry used for this pair is shown as under:
12


Fig. 9 IR Sensors Circuit Diagram

The output of the Sensors is fed to the Interrupt INT0 of the Microcontroller. When an
object comes between the Sensors, a high to low edge occurs at the output of the
sensors and the INT0 pin, which signals the microcontroller about the presence of the
fruit.
6. H-Bridge Module
As we have to move the levers to sort out the Fruit of different categories, so
for this purpose a circuit to control the direction of Lever Motors implemented. This
circuit is build-up with the help of four switches, which provide the flow of current
through the Motor connected between the switches. The switches used in our case are
two types of MOSFETs, which are:
a. IRF740 (n-channel Power MOSFET, 10A, 400V)
b. IRF9540 (p-channel Power MOSFET, 19A, 100V)
The MOSFETs used for this case because they provide fast switching and in
our case fast switching is required. These MOSFETs are so biased that at a time just
two MOSFETs are ON while the other two are OFF and the Motor is connected in
between them. The circuit diagram of this H-Bridge given as under:
13


Fig. 10 H-Bridge Circuit Diagram
This circuit diagram shows that upper half two MOSFETs are p-channel
IRF9540 whereas the lower half are n- channel IRF740. Now in order to turn ON the
Motor in any direction two MOSFETs of both types turned ON ate a time, which are
either Q1 & Q4 or Q2 & Q3. This phenomenon is achieved by biasing the MOSFETs
accordingly. The Opto-couplers EL817 are used to provide biasing to the required
switches. It is a solid-state component that using light-emitting diode to transmit light
through an optically transparent barrier between two isolated circuits. This barrier
insulates circuits by allowing the light to pass through it, but not the current.
For this H-Bridge, circuit to work properly one of the following combinations can be
applied at the inputs:
a. 01 (For one direction of Motor e.g. clockwise)
b. 10 (For opposite direction of Motor e.g. counter-clockwise)
c. 11 (Standstill or OFF state of Motor)
If there is the fourth combination i.e. 00 is applied, then both the MOSFETs of
one side are shorted out and a huge amount of current flows through them and it may
result in damaging the devices. Therefore, this precaution should be taken into
14

account for working of the Bridge properly. The hardware PCB circuit shown as
under:

Fig. 11 H-Bridge PC Board
7. Weighing Scale Module
The Grading of Fruit also done based on weight. For this purpose, a weighing
scale Module is implemented using a Load Cell (weight sensor). This weighing scale
Module measures the weight of the fruit digitally and sends this measured value to the
Computer Software via Serial Communication and apply grading condition based on
weight of the Fruit. The weight sensor used for this purpose shown below:

Fig. 12 Load Cell (weight sensor)
This sensor has four wire connections from which two Red & Black are used
for the supply of +5V and Ground while the remaining two Green & White
connections are used as input to the Instrumentation amplifier circuit which gives an
15

analog output to the Microcontroller Analog to Digital Converter (ADC) pin. Then,
Microcontroller converts this analog input to the digital and uses it as required.
Integration of Sub-modules:
All the Sub-modules discussed earlier so integrated with each other that the
whole system becomes automatically controlled. The main controlling part is the
Microcontroller system, which is responsible for the working of the hardware
Module. This is communicating with every part by sending and receiving the signals
to them and this can be justified in the following block diagram.











Fig. 13 Block Diagram

Working Criterion
The systematic complete working is explained in the following lines:
As the system is starts, Conveyer Belt Starts moving with the Fruit placed on it.
As the object comes between the IR sensors, the signal between the sensor pair
breaks and a low edge appears at the output of the sensors, which is directly
connected to the External Interrupt (INT0) of the Microcontroller.
The Microcontroller is so programmed that when a high to low edge appears at
the INT0 pin, the transistor of the Belt Motor Drive turns OFF due to 0 at its base
and then the Relay also switches to OFF state and results in stopping of Belt

Micro
Controller
IR sensors
Belt Motor
Software Module
Image Acquisition Point
S
M
m0
m1
IA
IR sensors IR sensors IR sensors IR sensors
Lever Motors
IR sensors
Serial
Comm.
Link
Hardware Module Software Module
16

Motor. At the same time, a character C sent to the Computer Software via Serial
Communication. This character, a flag value to suggest computer that an object
has come under the Camera and is ready to get a snap for processing.
The Software suggests the Camera to get a snap of the object. The Image
Processing algorithm applied on the object, which decides in which category the
fruit lies. This decision is encoded in the form of any value from 1 to 5 and sent
back to the Microcontroller via same serial Path.
If the character received from Computer Software is 1, then the corresponding
category lever is activated and moves to the following state:

Fig. 14 First Lever activated Position
At the same time, the Belt Moor Circuit is activated and the Belt starts moving.
The fruit, placed on the Belt, slides with the lever in the above shown position
and goes to the desired category bucket. After a short delay of about 3 seconds,
the character 2 is sent to the Microcontroller by Software and the lever gets back
to the normal position as shown below:

17

Fig. 15 Normal Lever Position

Similarly, for 2
nd
category of Fruit, the characters 3 & 4 are received by the
Microcontroller and activates the other lever as shown below in the figure:

Fig. 16 Second Lever activated Position

For third category of Fruit, the Microcontroller, which makes sure that both the
levers are at their normal position, receives the character 5 and the object passes
straight ahead to the third category bucket.

Anda mungkin juga menyukai