You are on page 1of 78

RFID BASED INDUSTRIAL INVENTORY

CONTROL SYSTEM
A Major Project Report
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE
OF

Bachelor of Technology
In

INSTRUMENTATION AND CONTROL ENGINEERING

By
SAGAR BARASARA (09BIC002)
MANISH JHURANI (09BIC014)
KALPESH DHAPA (09BIC015)
UNDER THE GUIDANCE OF
PROF. VISHAL VAIDYA

DEPARTMENT OF ELECTRICAL ENGINEERING

INSTITUTE OF TECHNOLOGY
NIRMA UNIVERSITY
Ahmedabad 382 481

May 2013

CERTIFICATE
This is to certify that the Major Project Report entitled RFID Based Industrial
Inventory Control System submitted by Sagar Barasara (09BIC002), Manish
Jhurani (09BIC014) & Kalpesh Dhapa (09BIC015) as the partial fulfillment of
the requirements for the award of the degree of Bachelor of Technology in
Instrumentation and Control Engineering, Institute of Technology, Nirma
University is the record of work carried out by them under my supervision and
guidance. The work submitted in our opinion has reached a level required for being
accepted for the examination. The results embodied in this project work to the best
of my knowledge have not been submitted to any other University or Institution for
award of any degree or diploma.

Prof. Vishal Vaidya

Prof. Dipak M Adhyaru

Prof. P.N.Tekwani

Project Guide

Section Head (IC)

HOD (EE)

Date:

Acknowledgement
We would deeply like to express our sincere gratitude towards project guide Prof.
Vishal Vaidya and faculty members of our panel who have guided until the
completion of the project. We also extend our thanks towards our Section Head Dr.
D M Adhyaru and all the staff, Department of Instrumentation and Control
Engineering, Institute of Technology, Nirma University for their assistance during
the project whether it was a technical help or concerned with providing facilities
for internet, implementing and simulating the ideas of the project. We would also
like to thank the faculty members of Workshop- Prof. Naik, Prof. I.R.Patel, Prof.
Narendra Patel, Prof. Mihir Chauhan who helped us a lot in building the
mechanical structure of Grappler robot. Their excessive support has been the
source of motivation to perform our best regarding the project.

Moreover, we are highly thankful to our classmates who were there all the times,
backing us up and their undue support has been the pushing drive for us to
complete the project within time.

Sagar Barasara(09BIC002)
Manish Jhurani(09BIC014)
Kalpesh Dhapa(09BIC015)

Page i

Abstract
The project model is based on a typical open loop system. When a particular
coloured RFID card is swiped in the control room, the information about the same
is transmitted wirelessly by the microcontroller in the control room to the
microcontroller on the Grappler robot on the field. The robot then picks up the
same coloured object from the inventory, places it on the conveyor belt and returns
to its initial position. The object on the conveyor belt is now directed to its
appropriate position by the actuators on the conveyor belt. This system can be used
to load the finally packed products in the manufacturing industry into the
transportation trucks as well as to access the various items in the inventory to use
during the manufacturing process. The cost of human labour can thus be reduced
as this process becomes automatic.

Page ii

List of Figures
1.1: Workers taking out stock from the inventory 3
2.1: Mechanical Structure of Grappler Robot ..5
2.2: Vertical Mechanism6
2.3: Horizontal Mechanism...7
2.4: Clamper Assembly.8
2.5: The Inventory.9
3.1: Control Panel11
4.1: Transmitter connection.13
4.2: Receiver connection.14
5.1: Conveyor Belt...17
6.1: 5V Power Supply..19
6.2: 12V Power Supply19
7.1: DC Motor Internal Diagram.22
8.1: Block Diagram..23
8.2: Grappler Circuit Diagram.23
9.1: 315/434 MHz ASK Transmitter..49
9.2: ST-TX01 Pin Diagram.50
9.3: Pin Dimensions of ST-TX0151
9.4: ST-RX02 Receiver IC..52
9.5: ST-RX02 Pin Diagram.52
9.6: Pin Dimensions of ST-RX0253
9.7: Temperature Characteristics of ST-RX0254
9.8: RFID Reader RKI-1512...61
9.9: RKI-1512 Pin Diagram62
9.10: RKI-1512 Connections...63
9.10: Pin diagram of L298...64
9.11: Circuit Diagram for L298 Motor Driver65
9.12: LM7805/12 Packages.67

Page iii

List of Tables
9.1: Electrical Characteristics of ST-TX01.50
9.2: Pin Dimensions of ST-TX0151
9.3: Electrical Characteristics of ST-RX02.53
9.4: PIC 16F877A Features.59
9.5: L298 Pin Functions...65
9.6: L298 Operation66
9.7: LM7805 Electrical Characteristics..68
9.8: LM7812 Electrical Characteristics..69

Page iv

CONTENTS
Acknowledgement...i
Abstract...ii
List of Figuresiii
List of Tables..iv
Contents...v
Chapter 1: Introduction

1.1 Inventory...1
1.2 Motivation.3
Chapter 2: Mechanical Structure

2.1 Vertical Motion...6


2.2 Horizontal Motion...7
2.3 Clamper Assembly..8
2.4 Inventory.9
Chapter 3: Control Panel

10

Chapter 4: Wireless Transmission and Reception

12

4.1 Transmitter...13
4.2 Receiver14
4.3 Encoder and Decoder...15
Page v

Chapter 5: Distribution

16

Chapter 6: Power Supply

18

Chapter 7: DC Motor

20

7.1 Connection Types.20


Chapter 8: Circuit Diagram and Code

23

8.1 Circuit Diagram..23


8.2 Code for Control Panel...24
8.3 Code for Grappler robot.31
Appendix

48

References

70

Page vi

CHAPTER 1
Introduction

1.1 INVENTORY:
Inventory is the total amount of goods and/or materials contained in a
store or factory at any given time.
A canned food manufacturer's materials inventory includes the
ingredients to form the foods to be canned, empty cans and their lids
(or coils of steel or aluminum for constructing those components),
labels, and anything else (solder, glue, etc.) that will form part of a
finished can.
The firm's work in process includes those materials from the time of
release to the work floor until they become complete and ready for
sale to wholesale or retail customers.
This may be vats of prepared food, filled cans not yet labeled or subassemblies of food components.
It may also include finished cans that are not yet packaged into
cartons or pallets.
Its finished goods inventory consists of all the filled and labeled cans
of food in its warehouse that it has manufactured and wishes to sell to
food distributors (wholesalers), to grocery stores (retailers), and even

Page 1

Chapter 1: Introduction
perhaps to consumers through arrangements like factory stores and
outlet centers.
Similarly, an automobile makers inventory includes various parts of
the automobile like the doors, bonnet, lights, seats, etc.
The access to the inventory for the materials stored in there can be
automatic or manual.
Building an autonomous system can ultimately reduce the cost of
human labour in the long run.
Moreover, this system is robust and can work in the range of 100
meters.

THE REASONS FOR KEEPING STOCK


There are four basic reasons for keeping an inventory:
1. Time - The time lags present in the supply chain, from supplier to user at
every stage, requires that you maintain certain amounts of inventory to use
in this lead time. However, in practice, inventory is to be maintained for
consumption during 'variations in lead time'. Lead time itself can be
addressed by ordering that many days in advance.
2. Uncertainty - Inventories are maintained as buffers to meet uncertainties in
demand, supply and movements of goods.
3. Economies of scale - Ideal condition of "one unit at a time at a place where
a user needs it, when he needs it" principle tends to incur lots of costs in
terms of logistics. So bulk buying, movement and storing brings in
economies of scale, thus inventory.
4. Appreciation in Value - In some situations, some stock gains the required
value when it is kept for some time to allow it reach the desired standard for
consumption, or for production. For example; beer in the brewing industry

Page 2

Chapter 1: Introduction

Fig 1.1: Workers taking out stock from the inventory

1.2 MOTIVATION:

Recently, we visited the Adani Wilmar Limited which manufactures cooking


oil.

The entire production facility was automatic in the industry.

The only problem which we noticed was that the finally packaged products
were stored in the storehouse manually.

Also, the loading of the finally manufactured products kept in the storehouse
into the trucks used for transportation was done manually.

This involved a lot of human effort as well as increase of cost and wastage
of time.

So, we decided to make a model so that this process can also become
autonomous.
Page 3

CHAPTER 2
Mechanical Structure
The main task of picking up the object from the inventory and placing it on
the conveyor belt is done by the Grappler robot.
The Grappler robot had to be made such that it becomes robust and that it
should not bend due to weight.
Moreover, it should have been a light weighted robot so that it could be
easily put into motion.
So, we decided to make the body of the robot with Aluminium plate as it
catered to all our requirements.
The entire structure was made by us by working intensively for 15 hours in
the college workshop.
The Grappler robot is the heart of our project.
The Grappler is a simple four wheeled autonomous robot that works on the
instructions provided by its on-board microcontroller.
All the electronic circuits, motor drivers, wireless data receiver, decoder,
antenna and power supplies are mounted on its body.
In order to move to different columns of the inventory, it is provided with
four 30 rpm motors.

Page 4

Chapter 2: Mechanical Structure

Fig 2.1: Mechanical Structure of Grappler Robot


Page 5

Chapter 2: Mechanical Structure

2.1 Vertical Motion:


For moving up and down a column, a 4-pulley lift is made.
The lift houses a wooden bucket on which the slider is supported.
The lift system works when the string winds and unwinds around a wooden
support.
The height to which it should be lifted is decided by the timing calibration.
The lift motor is of 10 rpm.

Fig2.2: Vertical Mechanism

Page 6

Chapter 2: Mechanical Structure

2.2 Horizontal motion:


For picking the object out of the box, horizontal motion is required.
This is achieved by using a simple drawer channel used in table drawers.
The motor used to slide the clamper assembly had to be light in weight
otherwise it would have been difficult to lift it.
So, a medium torque, light weight 60 rpm motor is used here.
Also, due to the in and out motion of the slider, imbalance can arise.
Hence, a counterweight is kept at the back side of the slider bucket.
This helps in smooth working of the system.

Fig2.3: Horizontal Mechanism

Page 7

Chapter 2: Mechanical Structure

2.3 Clamper Assembly:


To pick up the object and hold it, a clamper assembly is made.
Two light weight Aluminium strips form the fingers of the clamper.
Since Aliminium is smooth, there was a chance of the object falling down
from its clasp.
So, rubber coating is done on its inner surface.

A medium torque, light weight 45 rpm motor is used to rotate one strip of
Aluminium.

The other one rotates due to the gear assembly.

Fig2.4: Clamper Assembly

Page 8

Chapter 2: Mechanical Structure

2.4 Inventory
The model inventory made by us consists of different shelves where the
objects are placed.
The inventory shelves are made of wood.
Each section is of 25x15 cm.
The Grappler picks up the required coloured object from the inventory.

Fig2.5: The Inventory

Page 9

CHAPTER 3
Control Panel
Control panels are found in factories to monitor and control machines or
production lines. Old control panels are most often equipped with push
buttons and analog instruments, whereas today in many cases touchscreens are used for monitoring and control purposes.
A similar model of a control panel is made by us.
The information regarding which object is to be picked up is passed from
here to the Grappler robot.
Different coloured RFID cards are placed in a tray.
The user can pick up any desired colour card and swipe it once over the
RFID sensor module.
Each card corresponds to a specific number from 1 to 6.
The RFID sensor sends the information to PIC16f877A microcontroller.
The microcontroller then searches in its code and assigns the cards
particular number from 1 to 6.

This data is then sent to the encoder to encode it.

The encoder then passes on this data to the transmitter IC to transmit


wirelessly at 433 MHz through the antenna.
The receiver IC on the Grappler robot receives the data and decoder is used
to decode it.

Page 10

Chapter 3: Control Panel

Fig3.1: Control Panel

Page 11

CHAPTER 4
WIRELESS

TRANSMISSION

AND

RECEPTION
In industry, the control room is actually far away from the field devices.
The information about the task to be performed or the reading to be noted is
transmitted from the control room to the field.
We have achieved this with the help of wireless transmission at 433 MHz
frequency.
The information about which coloured object is to be picked up by Grappler
robot is transmitted to it wirelessly once the RFID card is swiped and its
colour is decided by the microcontroller in the control room.
The microcontroller on the Grappler robot receives this data and works
accordingly. The RX ASK is an ASK Hybrid receiver module. It is an
effective low cost solution for using 433 MHz.
The TX-ASK is an ASK hybrid transmitter module. TX-ASK is designed by
the saw resonator, with an effective low cost, small size and simple to use
for designing.

Page 12

Chapter 4: Wireless Transmission and Reception

4.1 Transmitter:
ST-TX01
Typical Application:

Fig4.1: Transmitter connection

Applications

Wireless security systems


Car Alarm systems
Remote controls.
Sensor reporting
Automation systems
Page 13

Chapter 4: Wireless Transmission and Reception

4.2 Receiver
ST-RX02
Applications

Car security system


Wireless security systems
Sensor reporting
Automation system
Remote Keyless entry

Fig4.2: Receiver connection

Page 14

Chapter 4: Wireless Transmission and Reception

4.3 Encoder and Decoder

Each of the RFID cards is assigned a number from 1 to 6.

Depending on the RFID card that is swiped, the particular number


corresponding to that card is transmitted wirelessly.

But this number is encoded before transmission. On reception, it is decoded


and the information is passed on to the microcontroller. It then decides
which coloured object is to be picked up.

The Grappler robot then performs the task of picking up the same coloured
object, placing it on the conveyor belt and returning back to its initial
position.

HT12E is the encoder IC whereas HT12D is the decoder IC.

Page 15

CHAPTER 5
DISTRIBUTION
Distribution is the final stage of the process.
Once the Grappler robot picks up the object from its position in the
inventory, it places it on the conveyor belt besides the inventory.
The main objective of distribution is performed here.
The conveyor belt is made by winding a leather strap on two kite string
spools.
A power window motor is used to run the conveyor belt.
The motor is connected to the spool and is powered by 12V supply.
The objects in the inventory are distributed with the help of actuator on the
conveyor belt.
If the object is taken from the first column of the inventory, it is knocked
down by the actuator and it falls in the bucket.
If it is taken from the second column of the inventory, the actuator does not
work and hence the object falls down on the other side of the conveyor belt
in the second bucket.
Thus, the task of distributing objects to the specified places is accomplished.
After placing the object on the conveyor belt, the Grappler robot returns to
its initial position and the entire process can be performed again.

Page 16

Chapter 5: Distribution

Fig5.1: Conveyor Belt

Page 17

CHAPTER 6
Power Supply
A regulated power supply is an embedded circuit, or stand alone unit, the
function of which is to supply a stable voltage (or less often current), to a
circuit or device that must be operated within certain power supply limits.

The output from the regulated power supply may be alternating or


unidirectional, but is nearly always DC.

The type of stabilization used may be restricted to ensuring that the output
remains within certain limits under various load conditions, or it may also
include compensation for variations in its own supply source.
The latter is much more common today.
Modern regulated supplies mostly use a transformer, silicon diode bridge
rectifier, reservoir capacitor and voltage regulator IC.
There are variations on this theme, such as supplies with multiple voltage
lines, variable regulators, power control lines, discrete circuits and so on.
Switched mode regulator supplies also include an inductor.
In our circuit, we have used two 5V power supplies for the control panel
using the LM-7805 IC.
Also, we have used six 5V power supplies using LM-7805 IC and four 12V
power supplies using LM-7812 IC for powering the Grappler robot.

Page 18

Chapter 6: Power Supply

Fig6.1: 5V Power Supply

Fig6.2: 12V Power Supply

Page 19

CHAPTER 7
DC Motor
A DC motor is a mechanically commutated electric motor powered from direct
current (DC). The stator is stationary in space by definition and therefore so is its
current. The current in the rotor is switched by the commutator to also be
stationary in space. This is how the relative angle between the stator and rotor
magnetic flux is maintained near 90 degrees, which generates the maximum
torque.
DC motors have a rotating armature winding but non-rotating armature magnetic
field and a static field winding or permanent magnet. Different connections of the
field and armature winding provide different inherent speed/torque regulation
characteristics. The speed of a DC motor can be controlled by changing the voltage
applied to the armature or by changing the field current. The introduction of
variable resistance in the armature circuit or field circuit allowed speed control.
Modern DC motors are often controlled by power electronics systems called DC
drives.
The introduction of DC motors to run machinery eliminated the need for local
steam or internal combustion engines, and line shaft drive systems. DC motors can
operate directly from rechargeable batteries, providing the motive power for the
first electric vehicles. Today DC motors are still found in applications as small as
toys and disk drives, or in large sizes to operate steel rolling mills and paper
machines.

7.1 Connection Types:


There are three types of electrical connections between the stator and rotor possible
for DC electric motors: series, shunt/parallel and compound ( various blends of
series and shunt/parallel) and each has unique speed/torque characteristics
appropriate for different loading torque profiles/signatures.

Page 20

Chapter 7: DC Motor

Series connection
A series DC motor connects the armature and field windings in series with a
common D.C. power source. The motor speed varies as a non-linear function of
load torque and armature current; current is common to both the stator and rotor
yielding I^2 (current) squared behavior. A series motor has very high starting
torque and is commonly used for starting high inertia loads, such as trains,
elevators or hoists. This speed/torque characteristic is useful in applications such
as dragline excavators, where the digging tool moves rapidly when unloaded but
slowly when carrying a heavy load.
With no mechanical load on the series motor, the current is low, the counter-EMF
produced by the field winding is weak, and so the armature must turn faster to
produce sufficient counter-EMF to balance the supply voltage. The motor can be
damaged by over speed. This is called a runaway condition.
Series motors called "universal motors" can be used on alternating current. Since
the armature voltage and the field direction reverse at (substantially) the same time,
torque continues to be produced in the same direction. Since the speed is not
related to the line frequency, universal motors can develop higher-thansynchronous speeds, making them lighter than induction motors of the same rated
mechanical output. This is a valuable characteristic for hand-held power tools.
Universal motors for commercial power frequency are usually small, not more than
about 1 kW output. However, much larger universal motors were used for electric
locomotives, fed by special low-frequency traction power networks to avoid
problems with commutation under heavy and varying loads.

Shunt connection
A shunt DC motor connects the armature and field windings in parallel or shunt
with a common D.C. power source. This type of motor has good speed regulation
even as the load varies, but does not have as high of starting torque as a series DC
motor. It is typically used for industrial, adjustable speed applications, such as
machine tools, winding/unwinding machines and tensioners.

Compound connection
A compound DC motor connects the armature and fields windings in a shunt and a
series combination to give it characteristics of both a shunt and a series DC motor.
This motor is used when both a high starting torque and good speed regulation is
Page 21

Chapter 7: DC Motor
needed. The motor can be connected in two arrangements: cumulatively or
differentially. Cumulative compound motors connect the series field to aid the
shunt field, which provides higher starting torque but less speed regulation.
Differential compound DC motors have good speed regulation and are typically
operated at constant speed.
We have used DC Shunt Motor in our circuit.

Fig7.1: DC Motor Internal Diagram

Page 22

CHAPTER 8
Circuit Diagram and Code
8.1 Circuit Connections

Fig 8.1: Block Diagram

Fig 8.2: Grappler Circuit Diagram


Page 23

Chapter 8: Circuit Diagram and Code

8.2 Control Panel Program:


#include<built_in.h>
void main() {
unsigned char uart_rd;
unsigned char i[] = "41009CF0E0CD";
unsigned char j[] = "41009CB17E12";
unsigned char k[] = "41009CD40900";
unsigned char l[] = "41009CA605AE";
unsigned char m[] = "41009CEA86B1";
unsigned char n[] = "840081067271";
unsigned char temp[13];
unsigned char v = 0;
ADCON1 = 0x04;

// Configure as analog

CCP1CON =0x0c;

// Disable comparator

TRISD = 0x00;
PORTD = 0x00;
TRISB = 0x00;
Trisc = 0x80;

// To make Rx Pin as input

portb=0x00;
RCSTA = 0x90;

// To make Receiving enable in continuous mode

TXSTA = 0x00;

Page 24

Chapter 8: Circuit Diagram and Code


UART1_Init(9600);
Delay_ms(100);

// Initialize UART module at 9600 bps


// Wait for UART module to become stable

v1:
v=0;
do {
if (UART1_Data_Ready())
{

// If data is received,

uart_rd = UART1_Read();

// read the received data,

temp[v] = uart_rd;

// temporary storing string

v = v +1;

if (v == 12)
{
temp[12] = 0;
v=0;

Page 25

Chapter 8: Circuit Diagram and Code

if (temp[6] == i[6])
{
portb.f7=1;
portb.f6=1;
portb.f5=1;
portb.f4=1;

delay_ms(2000);
portb.f7=0;
portb.f6=0;
portb.f5=0;
portb.f4=0;

goto v1;
}
else if(temp[6] ==j[6])
{

portb.f7=1;
portb.f6=1;
portb.f5=1;
portb.f4=0;
Page 26

Chapter 8: Circuit Diagram and Code

delay_ms(2000);
portb.f7=0;
portb.f6=0;
portb.f5=0;
portb.f4=0;

goto v1;

else if(temp[6] ==k[6])


{

portb.f7=1;
portb.f6=1;
portb.f5=0;
portb.f4=1;

delay_ms(2000);
portb.f7=0;
Page 27

Chapter 8: Circuit Diagram and Code


portb.f6=0;
portb.f5=0;
portb.f4=0;

goto v1;

else if(temp[6] ==l[6])


{

portb.f7=1;
portb.f6=0;
portb.f5=1;
portb.f4=1;

delay_ms(2000);
portb.f7=0;
portb.f6=0;
portb.f5=0;
portb.f4=0;

Page 28

Chapter 8: Circuit Diagram and Code


goto v1;

else if(temp[6] ==m[6])


{

portb.f7=0;
portb.f6=1;
portb.f5=1;
portb.f4=1;

delay_ms(2000);
portb.f7=0;
portb.f6=0;
portb.f5=0;
portb.f4=0;

goto v1;

Page 29

Chapter 8: Circuit Diagram and Code


else if(temp[6]==n[6])
{
portb.f7=1;
portb.f6=1;
portb.f5=0;
portb.f4=0;

delay_ms(2000);
portb.f7=0;
portb.f6=0;
portb.f5=0;
portb.f4=0;
}
}
}
}while(1);
}

Page 30

Chapter 8: Circuit Diagram and Code

8.3 Grappler Robot Program:


#include<built_in.h>
unsigned char i[] = "41009CF0E0CD";
unsigned char j[] = "41009CB17E12";
unsigned char k[] = "41009CD40900";
unsigned char l[] = "41009CA605AE";
unsigned char m[] = "41009CEA86B1";
unsigned char n[] = "840081067271";
unsigned char temp[13];
unsigned char v = 0;

void forward(unsigned int x)


{
int i;
portd.f0=0;
portd.f1=1;
portd.f2=0;
portd.f3=1;
portd.f6=0;
portd.f7=1;
portb.f0=1;
portb.f1=0;

Page 31

Chapter 8: Circuit Diagram and Code


for(i=x/10;i>0;i--)
{
delay_ms(10);
}
portd.f0=0;
portd.f1=0;
portd.f2=0;
portd.f3=0;
portd.f6=0;
portd.f7=0;
portb.f0=0;
portb.f1=0;
delay_ms(500);

void reverse(unsigned int x)


{
int i;
portd.f0=1;
portd.f1=0;
portd.f2=1;
portd.f3=0;
Page 32

Chapter 8: Circuit Diagram and Code


portd.f6=1;
portd.f7=0;
portb.f0=0;
portb.f1=1;
for(i=x/10;i>0;i--)
{
delay_ms(10);
}
portd.f0=0;
portd.f1=0;
portd.f2=0;
portd.f3=0;
portd.f6=0;
portd.f7=0;
portb.f0=0;
portb.f1=0;
delay_ms(500);
}

void pulleyup(unsigned int x)


{
int i;
portb.f6=1;
Page 33

Chapter 8: Circuit Diagram and Code


portb.f7=0;

for(i=x/10;i>0;i--)
{
delay_ms(10);
}
portb.f7=0;
portb.f6=0;
delay_ms(500);
}

void pulleydown(unsigned int x)


{
int i;
portb.f6=0;
portb.f7=1;

for(i=x/10;i>0;i--)
{
delay_ms(10);
}
portb.f7=0;
portb.f6=0;
Page 34

Chapter 8: Circuit Diagram and Code


delay_ms(500);
}

void sliderforward(unsigned int x)


{
int i;

portb.f4=1;
portb.f5=0;

for(i=x/10;i>0;i--)
{
delay_ms(10);
}

portb.f4=0;
portb.f5=0;
delay_ms(500);
}

void sliderreverse(unsigned int x)


{
Page 35

Chapter 8: Circuit Diagram and Code


int i;

portb.f4=0;
portb.f5=1;

for(i=x/10;i>0;i--)
{
delay_ms(10);
}

portb.f4=0;
portb.f5=0;
delay_ms(500);

void clamperopen(unsigned int x)


{
int i;

portb.f3=1;
portb.f2=0;

Page 36

Chapter 8: Circuit Diagram and Code


for(i=x/10;i>0;i--)
{
delay_ms(10);
}
portb.f3=0;
portb.f2=0;
delay_ms(500);
}

void clamperclose(unsigned int x)


{
int i;

portb.f3=0;
portb.f2=1;

for(i=x/10;i>0;i--)
{
delay_ms(10);
}

portb.f3=0;
portb.f2=0;
Page 37

Chapter 8: Circuit Diagram and Code


delay_ms(50);
}

void main()
{

ADCON1 = 0x0F;

// Configure as analog

CCP1CON =0x0c;

// Disable comparator

TRISD = 0x00;
PORTD = 0x00;
TRISB = 0x00;
TRISC = 0xFF;
portb=0x00;

Delay_ms(100);

// Wait for UART module to become stable

v1:

do
{
if (portc.f4==1 && portc.f5==1 && portc.f6==1 && portc.f7==1)

Page 38

Chapter 8: Circuit Diagram and Code


clamperopen(170);

sliderforward(2000);

clamperclose(2000);

sliderreverse(2500);

forward(4500);

pulleyup(19000);

sliderforward(2000);

clamperopen(170);

sliderreverse(2500);

clamperclose(2000);

reverse(4500);

Page 39

Chapter 8: Circuit Diagram and Code


pulleydown(175000);

goto v1;

else if (portc.f4==0 && portc.f5==1 && portc.f6==1 && portc.f7==1)


{

pulleyup(13000);

sliderforward(2000);

clamperclose(2000);

sliderreverse(2500);

forward(4500);

sliderforward(2000);

clamperopen(170);

Page 40

Chapter 8: Circuit Diagram and Code


sliderreverse(2500);

clamperclose(2000);

reverse(4500);

pulleydown(12500);

goto v1;

else if (portc.f4==1 && portc.f5==0 && portc.f6==1 && portc.f7==1)


{

pulleyup(34500);

clamperopen(170);

sliderforward(2000);

Page 41

Chapter 8: Circuit Diagram and Code


clamperclose(2000);

sliderreverse(2500);

forward(4500);

pulleydown(21000);

sliderforward(2000);

clamperopen(170);

sliderreverse(2500);

clamperclose(2000);

reverse(45000);

pulleydown(12500);

goto v1;
}
Page 42

Chapter 8: Circuit Diagram and Code

else if (portc.f4==1 && portc.f5==1 && portc.f6==0 && portc.f7==1)

{
forward(2000);

pulleyup(13000);

clamperopen(160);

sliderforward(2000);

clamperclose(2000);

sliderreverse(2500);

forward(2500);

sliderforward(2000);

clamperopen(170);

sliderreverse(2500);
Page 43

Chapter 8: Circuit Diagram and Code

clamperclose(2000);

reverse(4500);

pulleydown(12500);

goto v1;

else if (portc.f4==1 && portc.f5==1 && portc.f6==1 && portc.f7==0)

{
forward(2000);

pulleyup(34500);

clamperopen(170);

sliderforward(2000);
Page 44

Chapter 8: Circuit Diagram and Code

clamperclose(2000);

sliderreverse(2500);

forward(2500);

pulleydown(21000);

sliderforward(2000);

clamperopen(170);

sliderreverse(2500);

clamperclose(2000);

reverse(4500);

pulleydown(11500);

goto v1;
Page 45

Chapter 8: Circuit Diagram and Code

else if (portc.f4==0 && portc.f5==0 && portc.f6==1 && portc.f7==1)

{
forward(2000);

pulleyup(34500);

clamperopen(150);

sliderforward(2000);

clamperclose(2000);

sliderreverse(2500);

forward(2500);

pulleydown(21000);

Page 46

Chapter 8: Circuit Diagram and Code


sliderforward(2000);

clamperopen(170);

sliderreverse(2500);

clamperclose(2000);

reverse(4500);

pulleydown(12000);

goto v1;

} while(1);

Page 47

APPENDIX

Page 48

Transmitter IC(ST-TX01)
General Description:
The ST-TX01-ASK is an ASK Hybrid transmitter module. ST-TX01-ASK is
designed by the Saw Resonator, with an effective low cost, small size, and simpleto-use for designing.
Frequency Range:315 / 433.92 MHZ.
Supply Voltage: 3~12V.
Output Power : 4~16dBm
Circuit Shape: Saw

Fig9.1: 315/434 MHz ASK TRANSMITTER

Page 49

Appendix

Pin Description:

Fig 9.2: ST-TX01 Pin Diagram

Table 9.1: Electrical Characteristics of ST-TX01

Page 50

Appendix

Pin Dimension:

Fig 9.3: Pin Dimensions of ST-TX01

Table 9.2: Pin Dimensions of ST-TX01

Page 51

Appendix

ST-RX02-ASK Receiver
General Description:
The ST-RX02-ASK is an ASK Hybrid receiver module.
An effective low cost solution for using at 315/433.92 MHZ.
The circuit shape of ST-RX02-ASK is L/C.
Receiver Frequency: 315 / 433.92 MHZ
Typical sensitivity: -105dBm
Supply Current: 3.5mA
IF Frequency:1MHz

Features:

Low power consumption.


Easy for application.
Operation temperature range : 2070
Operation voltage: 5 Volts.
Available frequency at: 315/434 MHz

Fig 9.4: ST-RX02 Receiver IC

Fig 9.5: ST-RX02 Pin Diagram


Page 52

Appendix

Table 9.3: Electrical Characteristics of ST-RX02

Fig 9.6: Pin Dimensions of ST-RX02


Page 53

Appendix

Fig 9.7: Temperature Characteristics of ST-RX02

Page 54

Appendix

Encoder (HT12E)
Features:
_ Operating voltage
_ 2.4V~5V for the HT12A
_ 2.4V~12V for the HT12E
_ Low power and high noise immunity CMOS technology
_ Low standby current: 0.1_A (typ.) at VDD=5V
_ HT12A with a 38kHz carrier for infrared transmission medium
_ Minimum transmission word
_ Four words for the HT12E
_ One word for the HT12A
_ Built-in oscillator needs only 5% resistor
_ Data code has positive polarity
_ Minimal external components
_ HT12A/E: 18-pin DIP/20-pin SOP package

Applications:
_ Burglar alarm system
_ Smoke and fire alarm system
_ Garage door controllers
_ Car door controllers
_ Car alarm system
_ Security system
_ Cordless telephones
_ Other remote control systems

General Description
The 212 encoders are a series of CMOS LSIs for remote control system
applications. They are capable of encoding information which consists of N
address bits and 12_N data bits. Each address/ data input can be set to one of the
two logic states. The programmed addresses/data are transmitted together with the
Page 55

Appendix
header bits via an RF or an infrared transmission medium upon receipt of a trigger
signal. The capability to select a TE trigger on the HT12E or a DATA trigger on
the HT12A further enhances the application flexibility of the 212 series of
encoders. The HT12A additionally provides a 38kHz carrier for infrared systems.

Operation:
The 212 series of encoders begin a 4-word transmission cycle upon receipt of a
transmission enable (TE for the HT12E or D8~D11 for the HT12A, active low).
This cycle will repeat itself as long as the transmission enable (TE or D8~D11) is
held low. Once the transmission enable returns high the encoder output completes
its final cycle and then stops.

Page 56

Appendix

Decoder (HT 12D)


Features:
_ Operating voltage: 2.4V~12V
_ Low power and high noise immunity CMOS technology
_ Low standby current
_ Capable of decoding 12 bits of information
_ Binary address setting
_ Received codes are checked 3 times
_ Address/Data number combination
_ HT12D: 8 address bits and 4 data bits
_ Built-in oscillator needs only 5% resistor
_ Valid transmission indicator
_ Easy interface with an RF or an infrared transmission medium
_ Minimal external components
_ Pair with Holtek_s 212 series of encoders
_ 18-pin DIP, 20-pin SOP package

Applications:
_ Burglar alarm system
_ Smoke and fire alarm system
_ Garage door controllers
_ Car door controllers
_ Car alarm system
_ Security system
_ Cordless telephones
_ Other remote control systems

General Description:
The 212 decoders are a series of CMOS LSIs for remote control system
applications. They are paired with Holtek_s 212 series of encoders. For proper
operation, a pair of encoder/decoder with the same number of addresses and data
format should be chosen.
Page 57

Appendix
The decoders receive serial addresses and data from a programmed 212 series of
encoders that are transmitted by a carrier using an RF or an IR transmission
medium. They compare the serial input data three times continuously with their
local addresses. If no error or unmatched codes are found, the input data codes are
decoded and then transferred to the output pins. The VT pin also goes high to
indicate a valid transmission. The 212 series of decoders are capable of decoding
informations that consist of N bits of address and 12_N bits of data. Of this series,
the HT12D is arranged to provide 8 address bits and 4 data bits, and HT12F is used
to decode 12 bits of address information.

Operation:
The 212 series of decoders provides various combinations of addresses and data
pins in different packages so as to pair with the 212 series of encoders. The
decoders receive data that are transmitted by an encoder and interpret the first N
bits of code period as addresses and the last 12_N bits as data, where N is the
address code number. A signal on the DIN pin activates the oscillator which in turn
decodes the incoming address and data. The decoders will then check the received
address three times continuously. If the received address codes all match the
contents of the decoder_s local address, the 12_N bits of data are decoded to
activate the output pins and the VT pin is set high to indicate a valid transmission.
This will last unless the address code is incorrect or no signal is received. The
output of the VT pin is high only when the transmission is valid. Otherwise it is
always low.

Page 58

Appendix

PIC 16F877A Microcontroller


Introduction:

PIC is a family of modified Harvard architecture microcontrollers made by


Microchip Technology, derived from the PIC1650 originally developed by
General Instrument's Microelectronics Division. The name PIC initially
referred to "Peripheral Interface Controller".

Operating Frequency

DC 20 MHz

Resets (and Delays)

POR, BOR
(PWRT, OST)

Flash Program Memory


(14-bit words)

8K

Data Memory (bytes)

368

EEPROM Data Memory (bytes)

256

Interrupts

15

I/O Ports

Ports A, B, C, D, E

Timers

Capture/Compare/PWM modules

Serial Communications
Parallel Communications
10-bit Analog-to-Digital Module
Analog Comparators
Instruction Set

MSSP, USART
PSP
8 input channels
2
35 Instructions

Page 59

Appendix
40-pin PDIP
44-pin PLCC
44-pin TQFP
44-pin QFN

Packages

Table 9.4: PIC 16F877A Features

Special Microcontroller Features:


100,000 erase/write cycle Enhanced Flash program memory typical
1,000,000 erase/write cycle Data EEPROM memory typical
Data EEPROM Retention > 40 years
Self-reprogrammable under software control
In-Circuit Serial Programming (ICSP) via two pins
Single-supply 5V In-Circuit Serial Programming
Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable
operation
Programmable code protection
Power saving Sleep mode
Selectable oscillator options
In-Circuit Debug (ICD) via two pins

Page 60

Appendix

RFID Reader RKI-1512

Fig 9.8: RFID Reader RKI-1512

Description:
The ROBOKITS RFID reader is a standalone module with RFID reader and
antenna. Its very small (32mmx32mm) in size and easy to integrate with any
hardware design. It supports 125KHz RFID tags and has DIP 0.1 pins too.
Onboard antenna and hard plastic cover makes device small and sturdy. The
module works on UART protocol which allows user to integrate it with any PC
or Microcontroller based design. It also supports Weigand protocol.

Page 61

Appendix

Technical Parameters:
Voltage: DC 5V
Current: <50ma
Operating Frequency: 125 KHz
Reading Distance: 5 CM, 10 CM (Maximum, only for special tags)
Dimensions 32mm X 32mm X 8mm

Pin Outs:

Fig 9.9: RKI-1512 Pin Diagram

1 VCC- 5V
2 GND- GND
Page 62

Appendix
3 BEEP- BEEP AND LED
4 NC- NOT CONNECTED
5 NC- NOT CONNECTED
6 SEL- HIGH IS UART,LOW IS WEIGAND
7 TX- UART TX
8 D1- WEIGAND DATA 1 (Optional)
9 D0- WEIGAND DATA 0 (Optional)

Application Circuit:

Fig 9.10: RKI-1512 Connections


Note: Connect GND & TX to UART port of MCU or PC.

Page 63

Appendix

L298 Motor Driver


Introduction:
The L298 is an integrated monolithic circuit in a 15- lead Multiwatt and
PowerSO20 packages. It is a high voltage, high current dual full-bridge
driver designed to accept standard TTL logic levels and drive inductive
loads such as relays, solenoids, DC and stepping motors. Two enable inputs
are provided to enable or disable the device independently of the input
signals. The emitters of the lower transistors of each bridge are connected to
gether and the corresponding external terminal can be used for the
connection of an external sensing resistor. An additional supply input is
provided so that the logic works at a lower voltage.

Fig 9.10: Pin diagram of L298

Page 64

Appendix

Table 9.5: L298 Pin Functions

Fig 9.11: Circuit Diagram For L298 Motor Driver


Page 65

Appendix

Above is the circuit shown of Motor driver based on L298 which is


configured for Bidirectional Motion of motors. The operation is as follows:

Table 9.6: L298 Operation

Advantages of L298:
Operating supply voltage up to 46 v
Total dc current up to 4 A
Low saturation voltage
Over temperature protection

Page 66

Appendix

LM-7805/12
Features:
Output Current up to 1A
Output Voltages of 5/12V
Thermal Overload Protection
Short Circuit Protection
Output Transistor Safe Operating Area Protection

The KA78XX/KA78XXA series of three-terminal positive regulator are available


in the TO-220/D-PAK package and with several fixed output voltages, making
them useful in a wide range of applications. Each type employs internal current
limiting, thermal shut down and safe operating area protection, making it
essentially indestructible. If adequate heat sinking is provided, they can deliver
over 1A output current. Although designed primarily as fixed voltage regulators,
these devices can be used with external components to obtain adjustable voltages
and currents.

Fig 9.12: LM7805/12 Packages


Page 67

Appendix

We have used TO-220 type 7805 and 7812 in our circuit.

Table 9.7: LM7805 Electrical Characteristics

Page 68

Appendix

Table 9.8: LM7812 Electrical Characteristics

Page 69

References
www.robokits.co.in
www.alldatasheet.com

Page 70

You might also like