Sei sulla pagina 1di 43

SWARM ROBOTS USING RF COMMUNICATION

CHAPTER-1
INTRODUCTION
Swarm robotics is a new approach to the coordination of multi-robot system
which consist of large numbers of mostly simple physical robot. It is supposed that a
desired collective behavior emerges from the interactions between the robots and interactions
of robots with the environment. This approach emerged on the field of artificial swarm
intelligence, as well as the biological studies of insects, ants and other fields in nature,
where swarm behavior occurs.
Swarm intelligence:
SI (Swarm Intelligence) systems are typically made up of a population of
simple agents interacting locally with one another and with their environment. The
inspiration often comes from nature, especially biological systems. The agents follow very
simple rules, and although there is no centralized control structure dictating how individual
agents should behave, local, and to a certain degree random, interactions between such agents
lead to the emergence of intelligent global behavior, unknown to the individual agents.
Swarm robotics:
Swarm robotics is a relatively new field that focuses on controlling largescale homogeneous multi-robot systems. These systems are used to develop useful macrolevel behaviors while being made of modules that are very simple in design and compact in
size. These properties allow robot swarms to reach populations ranging from a dozen
modules to hundreds of modules. The theme of simplicity and elegance resonates throughout
swarm robotics research in both the designs of the robots as well as the algorithms that are
devised for these systems.

1.1 Objectives:
1.1.1 Goals:

Both miniaturization and cost are key-factors in swarm robotics. These are
the constraints in building large groups of robotics; therefore the simplicity
of the individual team member should be emphasized.
A lot of research has been put into achieving this goal of simplicity at the
individual robot level. Being able to use actual hardware in research of
Swarm Robotics in place of simulations allows researchers to come across
and resolve a lot more issues and thus, broadens the scope of Swarm
Research greatly.
The goals of these projects is manifold, including but not limited to keeping
the cost of individual robots low in order to be able to make the swarms
scale-able, making each member of the swarm less demanding in terms of
resources and making them more power/energy efficient. One such system
of swarm is the LIBOT Robotic System that involves a low cost robot built
for outdoor swarm robotics. The robots are also made to have enough
provisions for indoor use via Wi-Fi, since the GPS sensors provide poor
communication inside buildings. Another example of such an attempt is the
micro robot (Colias), built in the Computer Intelligence Lab at the
University of Lincoln, UK. This micro robot is built on a 4 cm circular

Dept of ECE, NCET

Page 1

SWARM ROBOTS USING RF COMMUNICATION

1.1.2

chassis and is low-cost and open platform for use in a variety of Swarm
Robotics applications.
Functionalities:
It can be switched to master and slave mode.
Slave robots works on the commands which are transmitted by
the master robot.
Abstacle avoidance.

1.2 Requirements:
1. Requires a microcontroller to control all the actions.
2. A master communication module to send commands and to receive
information to monitor their presence.
3. Slave communication module to send its availability.
4. Communication medium.
5. Slider switch setup.
6. Push button setup.
7. RF communication medium.
8. Power supply system.

1.3 Report organisation:


Chapter 1: Describes about the Introduction of the project, scope and of the project.
Chapter 2: Describes the literature survey; here it compares the different microcontrollers
and selecting best components suitable for application. Also describes some of the specific
reasons for selecting every component in the design.
Chapter 3: Describes the over view of the system with block diagrams of the base
modules, also describes features of each and every component and tools used in the
design.
Chapter 4: Describes the design and implementation of Swarm robots by mention sequence
of design steps which are followed while designing. Also scribes the circuit diagram.
Chapter 5: Describes about the problems faced while designing and also shows the
results.
Chapter 6: Describes about the conclusion and future work of the project.
Finally, references are given and at the end source code of the project which is
simulated using code composer studio is shown.

Dept of ECE, NCET

Page 2

SWARM ROBOTS USING RF COMMUNICATION

CHAPTER-2
REQUIREMENT ANALYSIS
Introduction:
Communication Technology:

Communication is giving, receiving or exchanging ideas, information, signals or


messages through appropriate media, enabling individuals or groups to persuade, to
seek information, to give information or to express emotions.

2.1 Selecting Microcontroller:

Microcontroller definition:

A microcontroller is a computer present in a single integrated circuit which is


dedicated to perform one task and execute one specific application.

It contains memory, programmable input/output peripherals as well a processor.


Microcontrollers are mostly designed for embedded applications and are heavily used
in automatically controlled electronic devices such as cellphones, cameras,
microwave ovens, washing machines, etc.

The important features that every microcontroller must have are as following:
1. Size of CPU.
2. Frequency of operation.
3. Power consumption.
4. Required interfacing features.
5. Number of input and output pins.
Requirements of the designs are
6. Less power consumption.
7. Portability.
8. Speed in operation.
9. Less complex design.
10. Small in size.
Dept of ECE, NCET

Page 3

SWARM ROBOTS USING RF COMMUNICATION

There are many microcontrollers available in the market like ARM microcontroller,
PIC microcontroller, 8051 microcontroller and AVR microcontroller. But for swarm
robotics we are using the microcontroller from AVR family i.e., ATMEGA-16
microcontroller.
Size of the memory is 16K bytes.
32 programmable input & output lines.
Operating voltage ranges from 4.5V-5.5V.
Speed of the microcontroller is 0-16MHZ.
Power consumption:
Active : 1.1mA.
Idle mode : 0.35mA.
Power mode down: <1A.
2.1.1 Main features of 8051, AVR, ARM and PIC microcontroller:
8051 Microcontroller: 8051 needs external 3Mhz clock and reset to be
connected.8051 has no internal ADC .
AVR microcontroller: AVR controller contains internally 1MHz of clock and
external clock can also be connected. Has inbuilt PWM signal. And has inbuilt 8
channel ADC.
ARM Microcontroller: ARM microcontroller has low power i.e., 3.3V.
PIC Microcontroller: PIC microcontroller has inbuilt library and has background
code.
2.2 Motor driver:
A motor driver is required to run the robot. We are using L239D motor driver.
L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current
amplifiers since they take a low-current control signal and provide a higher-current signal.
This higher current signal is used to drive the motors.

L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two
DC motors can be driven simultaneously, both in forward and reverse direction. The motor
operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input

Dept of ECE, NCET

Page 4

SWARM ROBOTS USING RF COMMUNICATION

logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise
and anticlockwise directions, respectively.

Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start
operating. When an enable input is high, the associated driver gets enabled. As a result, the
outputs become active and work in phase with their inputs. Similarly, when the enable input
is low, that driver is disabled, and their outputs are off and in the high-impedance state.
Pin No
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Function
Enable pin for Motor 1; active high
Input 1 for Motor 1
Output 1 for Motor 1
Ground (0V)
Ground (0V)
Output 2 for Motor 1
Input 2 for Motor 1
Supply voltage for Motors; 9-12V (up
Enable pin for Motor 2; active high
Input 1 for Motor 1
Output 1 for Motor 1
Ground (0V)
Ground (0V)
Output 2 for Motor 1
Input2 for Motor 1
Supply voltage; 5V (up to 36V)

TABLE: Table for motor driver (L239D)

2.3 Push button:


A push-button (also spelled pushbutton) or simply button is a
simple switch mechanism for controlling some aspect of a machine or a process. Buttons are
typically made out of hard material, usually plastic and metal. The surface is usually flat or
shaped to accommodate the human finger or hand, so as to be easily depressed or pushed.
Buttons are most often biased switches, though even many un-biased buttons (due to their
physical nature) require a spring to return to their un-pushed state. Different people use
different terms for the "pushing" of the button, such as press, depress, mash, hit, and punch.

2.4 Slider Switch:

Dept of ECE, NCET

Page 5

SWARM ROBOTS USING RF COMMUNICATION

Slide switches are one of the most common switches used in electrical
devices. Compact sized and operable with only a finger, slide switches are important as their
absence can render the device useless in absence of the capability to switch ON and OFF
without having to pull the mains cord. It is uncanny to list all the applications where slide
switch is used. From electrical chimneys to hand blender in the kitchen, from lamp to the toy
car in the living room, slide switches are almost omni present.We are used to see switches
and use it as a black box.
2.5 Software:
To proceed with above selected components, there is a need of softwares to
simulate, debug the code. For that we require a very good debugging tool which is easy to
understand and easy to work out.
Here we use following software to stimulate the code and debug the
software. We use:
1. Proteus
2. AVR studio -4.

1. AVR Studio-4:
AVR studio-4 is a software used to code the program as required from the
function of our application. Coding the program in AVR studio-4 is very easy to write and
also very easy to understand. The code can be understand easily by anyone.

Fig:2.5.1: shows editor window of AVR studio-4


Dept of ECE, NCET

Page 6

SWARM ROBOTS USING RF COMMUNICATION

2.Proteus:
Proteus is a software used for real time stimulation. In proteus we get all the
components which are required for the stimulation of our application.

Figure.2.5.2:shows the stimulation window in proteus software

CHAPTER-3
SYSTEM OVERVIEW
Introduction:
Swarm robot means group of robots communicating with each other and
working on one particular goal together. The group of robots working on one particular goal
on the instructions of on master robot. The robots are divided in two modes one robot will
be in master mode and other will be in slave mode. All the slave robots works according to
the instruction of master robot.
The components required to build Swarm robots are a ATMEGA-16 Microcontroller, L239D
motor driver,HT12E(encoder which is at transmitter side),HT12D decoder(which will be at
receiver side), transmitter and receiver module, LEDs, Push button, Slider switch etc.

3.1 Block diagram:

Power supply

Dept of ECE, NCET

Page 7

SWARM ROBOTS USING RF COMMUNICATION

Sensors

MICROCONTROLLER
(ATMEGA16)

RF Transmitter
Mode select
(Master and
Slave)
RF Receiver

Figure 3.1: block diagram of swarm robots

3.2 Components Description:


3.2.1 Architecture of ATMEGA-16:
3.2.1.1 Pin Diagram of ATMEGA-16:

Dept of ECE, NCET

Page 8

SWARM ROBOTS USING RF COMMUNICATION

Figure:3.2.1 pin diagram of ATMEGA-16

3.2.1.2 Pin description of ATMEGA-16:

Dept of ECE, NCET

Page 9

SWARM ROBOTS USING RF COMMUNICATION

Pin No. Pin name

Description

Alternate Function
T0: Timer0 External Counter Input.

(XCK/T0)
PB0

I/O PORTB, Pin 0

(T1) PB1

I/O PORTB, Pin 1

(INT2/AIN0)
I/O PORTB, Pin 2
PB2

(OC0/AIN1)
PB3

I/O PORTB, Pin 3

(SS) PB4

I/O PORTB, Pin 4

(MOSI) PB5

I/O PORTB, Pin 5

In System Programmer (ISP)

(MISO) PB6

I/O PORTB, Pin 6

Serial Peripheral Interface (SPI)

(SCK) PB7

I/O PORTB, Pin 7

RESET

Reset Pin, Active


Low Reset

10

Vcc

Vcc = +5V

11

GND

GROUND

12

XTAL2

Output to Inverting Oscillator Amplifier

13

XTAL1

Input to Inverting Oscillator Amplifier

14

(RXD) PD0

I/O PORTD, Pin 0

15

(TXD) PD1

I/O PORTD, Pin 1

16

(INT0) PD2

I/O PORTD, Pin 2

External Interrupt INT0

17

(INT1) PD3

I/O PORTD, Pin 3

External Interrupt INT1

18

(OC1B) PD4

I/O PORTD, Pin 4

19

(OC1A) PD5

I/O PORTD, Pin 5

20

(ICP) PD6

I/O PORTD, Pin 6

Timer/Counter1 Input Capture Pin

21

PD7 (OC2)

I/O PORTD, Pin 7

Timer/Counter2 Output Compare Match


Output

22

PC0 (SCL)

I/O PORTC, Pin 0

23

PC1 (SDA)

I/O PORTC, Pin 1

Dept of ECE, NCET

XCK : USART External Clock I/O


T1:Timer1 External Counter Input
AIN0: Analog Comparator Positive I/P
INT2: External Interrupt 2 Input
AIN1: Analog Comparator Negative I/P
OC0 : Timer0 Output Compare Match
Output

USART Serial Communication Interface

PWM Channel Outputs

TWI Interface

Page 10

SWARM ROBOTS USING RF COMMUNICATION

24

PC2 (TCK)

I/O PORTC, Pin 2

25

PC3 (TMS)

I/O PORTC, Pin 3

26

PC4 (TDO)

I/O PORTC, Pin 4

27

PC5 (TDI)

I/O PORTC, Pin 5

28

PC6
(TOSC1)

I/O PORTC, Pin 6

Timer Oscillator Pin 1

29

PC7
(TOSC2)

I/O PORTC, Pin 7

Timer Oscillator Pin 2

30

AVcc

Voltage Supply = Vcc for ADC

31

GND

GROUND

32

AREF

Analog Reference Pin for ADC

33

PA7 (ADC7)

I/O PORTA, Pin 7

ADC Channel 7

34

PA6 (ADC6)

I/O PORTA, Pin 6

ADC Channel 6

35

PA5 (ADC5)

I/O PORTA, Pin 5

ADC Channel 5

36

PA4 (ADC4)

I/O PORTA, Pin 4

ADC Channel 4

37

PA3 (ADC3)

I/O PORTA, Pin 3

ADC Channel 3

38

PA2 (ADC2)

I/O PORTA, Pin 2

ADC Channel 2

39

PA1 (ADC1)

I/O PORTA, Pin 1

ADC Channel 1

40

PA0 (ADC0)

I/O PORTA, Pin 0

ADC Channel 0

JTAG Interface

Table:3.2.1.2 : Table for pin description of ATMEGA-16

3.2.1.3 Block diagram of ATMEGA-16:


The AVR core combines a rich instruction set with 32 general purpose working registers. All
the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two
independent registers to be accessed in one single instruction executed in one clock cycle.
Dept of ECE, NCET

Page 11

SWARM ROBOTS USING RF COMMUNICATION

Fig:3.2.1.3: Internal architecture of microcontroller


The Idle mode stops the CPU while allowing the USART, Two-wire interface, A/D
Converter, SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning.
Dept of ECE, NCET

Page 12

SWARM ROBOTS USING RF COMMUNICATION

The Power-down mode saves the register contents but freezes the Oscillator, disabling all
other chip functions until the next External Interrupt or Hardware Reset. In Power-save mode,
the Asynchronous Timer continues to run, allowing the user to maintain a timer base while
the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O
modules except Asynchronous Timer and ADC, to minimize switching noise during ADC
conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the
device is sleeping. This allows very fast start-up combined with low-power consumption. In
Extended Standby mode, both the main Oscillator and the Asynchronous Timer continue to
run. The device is manufactured using Atmels high density nonvolatile memory technology.
The Onchip ISP Flash allows the program memory to be reprogrammed in-system through an
SPI serial interface, by a conventional nonvolatile memory programmer, or by an On-chip
Boot program running on the AVR core. The boot program can use any interface to download
the application program in the Application Flash memory. Software in the Boot Flash section
will continue to run while the Application Flash section is updated, providing true ReadWhile-Write operation. By combining an 8-bit RISC CPU with In-System SelfProgrammable Flash on a monolithic chip, the Atmel ATmega16 is a powerful
microcontroller that provides a highly-flexible and cost-effective solution to many embedded
control applications. The ATmega16 AVR is supported with a full suite of program and
system development tools including: C compilers, macro assemblers, program
debugger/simulators, in-circuit emulators, and evaluation kits.
VCC: Digital supply voltage.
GND :Ground.
Port A (PA7..PA0): Port A serves as the analog inputs to the A/D Converter. Port A also serves
as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide
internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical
drive characteristics with both high sink and source capability. When pins PA0 to PA7 are
used as inputs and are externally pulled low, they will source current if the internal pull-up
resistors are activated. The Port A pins are tri-stated when a reset condition becomes active,
even if the clock is not running.
Port B (PB7..PB0): Port B is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port B output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port B pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not running.
Port C (PC7..PC0): Port C is an 8-bit bi-directional I/O port with internal pull-up resistors
(selected for each bit). The Port C output buffers have symmetrical drive characteristics with
both high sink and source capability. As inputs, Port C pins that are externally pulled low will
source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset
condition becomes active, even if the clock is not running. If the JTAG interface is enabled,
the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a
reset occurs. Port D (PD7..PD0): Port D is an 8-bit bi-directional I/O port with internal pullup resistors (selected for each bit). The Port D output buffers have symmetrical drive
characteristics with both high sink and source capability. As inputs, Port D pins that are

Dept of ECE, NCET

Page 13

SWARM ROBOTS USING RF COMMUNICATION

externally pulled low will source current if the pull-up resistors are activated. The Port D pins
are tri-stated when a reset condition becomes active, even if the clock is not running.
RESET: Reset Input. A low level on this pin for longer than the minimum pulse length will
generate a reset, even if the clock is not running. The minimum pulse length is given in Table
15 on page 38. Shorter pulses are not guaranteed to generate a reset.
XTAL1: Input to the inverting Oscillator amplifier and input to the internal clock operating
circuit. XTAL2 :Output from the inverting Oscillator amplifier.
AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter.
AREF: AREF is the analog reference pin for the A/D Converter

3.3 DC Motor Driver (L239D):

Fig:3.3 : figure for motordriver(L239D) pin diagram


The L293D are quadruple high-current half-H drivers.. The L293D is designed to
provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both
Dept of ECE, NCET

Page 14

SWARM ROBOTS USING RF COMMUNICATION

devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar
stepping motors, as well as other high-current/high-voltage loads in positive-supply
applications. All inputs are TTL compatible. Each output is a complete totem-pole drive
circuit, with a Darlington transistor sink and a pseudo Darlington source. Drivers are enabled
in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When
an enable input is high, the associated drivers are enabled, and their outputs are active and in
phase with their inputs. When the enable input is low, those drivers are disabled, and their
outputs are off and in the high-impedance state. With the proper data inputs, each pair of
drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications
The driver IC L293D is quad push-pull drivers capable of delivering output currents to 1A
per channel respectively. Each channel is controlled by a TTL-compatible logic input and
each pair of drivers (a full bridge) is equipped with an inhibit input available at pin 1 and pin
9. The motor will run only when chip inhibit is at high logic i.e. chip inhibit is enabled. The
connection diagram is shown below:

Fig:3.3.1: Pin description of L239D


3.4 Communication system:
3.4.1 Transmitter and Receiver module:
We use a transmitter and receiver module. To reduce noise near transmitter and receiver side
we connect to other components to transmitter and receiver modules. To transmitter we
connect a encoder i.e., HT12E and a decoder to receiver i.e., HT12D. These two components
helps to reduce noise and transmitter and receiver.

Dept of ECE, NCET

Page 15

SWARM ROBOTS USING RF COMMUNICATION

3.4.1.1 Encoder at Transmitter(HT12E):

Fig:3.4.1.1 : figure of HT12E encoder


HT12E is an encoder integrated circuit of 212 series of encoders. They are paired with
212 series of decoders for use in remote control system applications. It is mainly used in
interfacing RF and infrared circuits. The chosen pair of encoder/decoder should have same
number of addresses and data format.
Simply put, HT12E converts the parallel inputs into serial output. It encodes the 12 bit
parallel data into serial for transmission through an RF transmitter. These 12 bits are divided
into 8 address bits and 4 data bits.

HT12E has a transmission enable pin which is active low. When a trigger signal is received
on TE pin, the programmed addresses/data are transmitted together with the header bits via an
RF or an infrared transmission medium. HT12E begins a 4-word transmission cycle upon
receipt of a transmission enable. This cycle is repeated as long as TE is kept low. As soon as
TE returns to high, the encoder output completes its final cycle and then stops.

Dept of ECE, NCET

Page 16

SWARM ROBOTS USING RF COMMUNICATION

3.4.1.2 Pin Description of HT12E:

Pin No

Function

1
2
3
4

8 bit Address pins for input

5
6
7
8
9

Ground (0V)

10
11

4 bit Data/Address pins for input

12
13
14

Transmission enable; active low

15

Oscillator input

16

Oscillator output

17

Serial data output

18

Supply voltage; 5V (2.4V-12V)

Table:3.4.1.2 : Table for HT12E encoder


3.4.1.3 Decoder at receiver module(HT12D):
HT12D is a decoder integrated circuit that belongs
to 2 series of decoders. This series of decoders are mainly used for remote control system
applications, like burglar alarm, car door controller, security system etc. It is mainly provided
to interface RF and infrared circuits. They are paired with 212 series of encoders. The chosen
pair of encoder/decoder should have same number of addresses and data format.
12

Dept of ECE, NCET

Page 17

SWARM ROBOTS USING RF COMMUNICATION

In simple terms, HT12D converts the serial input into parallel outputs. It decodes the
serial addresses and data received by, say, an RF receiver, into parallel data and sends them to
output data pins. The serial input data is compared with the local addresses three times
continuously. The input data code is decoded when no error or unmatched codes are found. A
valid transmission in indicated by a high signal at VT pin.

HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data bits. The
data on 4 bit latch type output pins remain unchanged until new is received.

3.4.1.4 Pin Description:

Fig:3.4.1.4: figure of HT12D decoder

Dept of ECE, NCET

Page 18

SWARM ROBOTS USING RF COMMUNICATION

PIN DESCRIPTION :

Pin No

Function

1
2
3
4

8 bit Address pins for input

5
6
7
8
9

Ground (0V)

10
11

4 bit Data/Address pins for output

12
13
14

Serial data input

15

Oscillator output

16

Oscillator input

17

Valid transmission; active high

18

Supply voltage; 5V (2.4V-12V)

Table:3.4.1.4 : Table of HT12D pin description

3.5 Mode select (Master and Slave mode):


A robot can either be in master mode or slave. If it is in
master mode then the slave robots works on the commands of master robot i.e., the slave
robots follows the swarm robots, and if a robot will b in slave mode than if receives all the
data and command from the master robot. The process of selecting master mode or slave
mode is called as mode selection, and it can be done by slider switch.

Dept of ECE, NCET

Page 19

SWARM ROBOTS USING RF COMMUNICATION

3.5.1 Slider switch:


Slide switches are one of the most common switches used in electrical
devices. Compact sized and operable with only a finger, slide switches are important as their
absence can render the device useless in absence of the capability to switch ON and OFF
without having to pull the mains cord. It is uncanny to list all the applications where slide
switch is used. From electrical chimneys to hand blender in the kitchen, from lamp to the toy
car in the living room, slide switches are almost omnipresent.
We are used to see switches and use it as a black box.

Fig:3.5.1: slider switch


If it is in ON mode i.e., slider switch=1 then it is in Master mode.
If it is in OFF mode i.e., slider switch=0 the it is in Slave mode.

Dept of ECE, NCET

Page 20

SWARM ROBOTS USING RF COMMUNICATION

CHAPTER-4
DESIGN AND IMPLEMENTATION
Introduction:
In previous chapter we discussed about the components which are required for the design of
swarm robots. But only selecting components is not enough, the interfacing each and every
component should be done very carefully, interfacing enhances the project. In this chapter we
interface and connect the components with each other. After designing we write the required
code or program for our project by using AVR studio-4 according to our need. For testing our
project we use Proteus for stimulation.

4.1 Design:

4.1.1 Interfacing of ATMEGA-16 microcontroller with L239D motor driver:


DC Motor Driver is a L293D based motor driver interface board from ABLab
Solutions. The main aim of interfacing DC motor with any microcontroller is to control the
direction and speed of a DC motor. But due to high voltage and current requirement of DC
motors, it cannot be interfaced directly with microcontrollers. So, to interface DC motor with
any microcontroller, you need a motor driver.
Motor driver is basically a current amplifier which takes a low-current signal from the
microcontroller and gives out a proportionally higher current signal which can control and
drive a motor. L293D is a dual H-Bridge motor driver IC. With one L293D IC we can
interface two DC motors which can be controlled in both clockwise and counter clockwise
direction.
In this project, we will learn How to interface a L293D based DC Motor Driver in 5V mode
with AVR ATmega16 microcontroller. The 5V mode is used to run a DC motor at constant
speed in clockwise and anti-clockwise direction. In 5V mode, 5V is given to two enable pins
of L293D. Here, we will use the DC Motor Driver to control the direction of two DC motor
mounted on a Robot at constant speed.
The ATmega16 microcontroller will provide the necessary signal to the DC Motor Driver to
run the robot in forward, left, right, reverse direction and to stop it respectively each for 2
minutes. The below table shows the different directions of DC motor with different signals to
DC Motor Driver.

Dept of ECE, NCET

Page 21

SWARM ROBOTS USING RF COMMUNICATION

Input 1

Input 2

Direction of DC Motor

Stop

Anti-Clockwise

Clockwise

Stop

Table:4.1.1: Direction of DC motor


The direction of movement of the DC motors depends on the connection of DC motors with
the DC Motor Driver.
Hardwares Required:

AVR Trainer Board-100-1pc

AVR USB Programmer-1pc

12V, 1A DC Adapter-1pc

DC Motor Driver-1pc

1 to 1 Connector-1pc

10 to 10 FRC Female Connector-2pcs

Robot-1pc

USB AM-AF Cable (Optional)-1pc

Softwares Required:

AVR Studio 4

WinAVR -2010

SinaProg Hex Downloader

USBasp Driver

Dept of ECE, NCET

Page 22

SWARM ROBOTS USING RF COMMUNICATION

Circuit Diagram:
Circuit diagram showing connections from ATMEGA 16 to motors through L293D motor
driver.

: Fig:3.4.1:Circuit diagram of L293D DC motor driver interfacing with ATMEGA-16

Connection Guide:
The step-by-step connection guide for L293D based DC Motor Driver Interfacing with
ATmega16 in 5V Mode project is as follows:

Insert the DC Pin of 12V, 1A DC Adapter to the DC Socket of AVR Trainer Board-100.

Connect PortB header of AVR Trainer Board-100 with Input header of DC Motor Driver
with a 10 to 10 FRC Female Connector.

Dept of ECE, NCET

Page 23

SWARM ROBOTS USING RF COMMUNICATION

Connect the 12V pin of PWM & Motor Voltage header of DC Motor Driver with the 12V
header of AVR Trainer Board-100 with a 1 to 1 Connector.

Connect the Robot connector to the Output header of the DC Motor Driver.

Switch off the Mode Switch of DC Motor Driver.

Connect the ISP header of AVR Trainer Board-100 with AVR USB Programmer header of
AVR USB Programmer with a 10 to 10 FRC Female Connector.

Connect the AVR USB Programmer to the PC/Laptops USB Port directly or with the help
of USB AM-FM Cable.

Switch on the power with the help of Power Switch of AVR Trainer Board-100.

Download the L293D based DC Motor Driver Interfacing with ATmega16 in 5V Mode
Hex file to AVR Trainer Board-100 with the help of SinaProg Hex downloader and AVR
USB Programmer.

See the result

4.1.2 RF Based Wireless Remote using RX-TX Modules (434MHz.):


Summary of the project This circuit utilizes the RF module (Tx/Rx) for making a wireless
remote, which could be used to drive an output from a distant place. RF module, as the name
suggests, uses radio frequency to send signals. These signals are transmitted at a particular
frequency and a baud rate. A receiver can receive these signals only if it is configured for that
frequency. A four channel encoder/decoder pair has also been used in this system. The input
signals, at the transmitter side, are taken through four switches while the outputs are
monitored on a set of four LEDs corresponding to each input switch. The circuit can be used
for designing Remote Appliance Control system. The outputs from the receiver can drive
corresponding relays connected to any household appliance.

4.1.2.1 Description :
This radio frequency (RF) transmission system employs Amplitude Shift
Keying (ASK) with transmitter/receiver (Tx/Rx) pair operating at 434 MHz. The transmitter
module takes serial input and transmits these signals through RF. The system allows one way
communication between two nodes, namely, transmission and reception. The RF module has
been used in conjunction with a set of four channel encoder/decoder ICs. Here HT12E &
HT12D have been used as encoder and decoder respectively. The encoder converts the parallel
inputs (from the remote switches) into serial set of signals. These signals are serially
transferred through RF to the reception point. The decoder is used after the RF receiver to
decode the serial format and retrieve the original signals as outputs. These outputs can be
observed on corresponding LEDs.
Dept of ECE, NCET

Page 24

SWARM ROBOTS USING RF COMMUNICATION

Encoder IC (HT12E) receives parallel data in the form of address bits and control bits. The
control signals from remote switches along with 8 address bits constitute a set of 12 parallel
signals. The encoder HT12E encodes these parallel signals into serial bits. Transmission is
enabled by providing ground to pin14 which is active low. The control signals are given at
pins 10-13 of HT12E. The serial data is fed to the RF transmitter through pin17 of HT12E.
Transmitter, upon receiving serial data from encoder IC (HT12E), transmits it wirelessly to
the RF receiver. The receiver, upon receiving these signals, sends them to the decoder IC
(HT12D) through pin2. The serial data is received at the data pin (DIN, pin14) of HT12D. The
decoder then retrieves the original parallel format from the received serial data.
When no signal is received at data pin of HT12D, it remains in standby mode and consumes
very less current (less than 1A) for a voltage of 5V. When signal is received by receiver, it is
given to DIN pin (pin14) of HT12D. On reception of signal, oscillator of HT12D gets
activated. IC HT12D then decodes the serial data and checks the address bits three times. If
these bits match with the local address pins (pins 1-8) of HT12D, then it puts the data bits on
its data pins (pins 10-13) and makes the VT pin high. An LED is connected to VT pin (pin17)
of the decoder. This LED works as an indicator to indicate a valid transmission. The
corresponding output is thus generated at the data pins of decoder IC. A signal is sent by
lowering any or all the pins 10-13 of HT12E and corresponding signal is received at receivers
end (at HT12D). Address bits are configured by using the by using the first 8 pins of both
encoder and decoder ICs. To send a particular signal, address bits must be same at encoder
and decoder ICs. By configuring the address bits properly, a single RF transmitter can also be
used to control different RF receivers of same frequency.
To summarize, on each transmission, 12 bits of data is transmitted consisting of 8 address bits
and 4 data bits. The signal is received at receivers end which is then fed into decoder IC. If
address bits get matched, decoder converts it into parallel data and the corresponding data bits
get lowered which could be then used to drive the LEDs. The outputs from this system can
either be used in negative logic or NOT gates (like 74LS04) can be incorporated at data pins.
4.1.2.2 Circuit diagram for HT12E with Transmitter module:

Dept of ECE, NCET

Page 25

SWARM ROBOTS USING RF COMMUNICATION

Fig:4.1.2: Circuit diagram of transmitter module with HT12E

4.1.2.3 Circuit diagram HT12D with Receiver module:

Dept of ECE, NCET

Page 26

SWARM ROBOTS USING RF COMMUNICATION

Fig:4.1.2.3: Circuit diagram of receiver module with HT12D

4.1.3 RF Modules (434MHz) :


The RF module, as the name suggests, operates at Radio
Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF
system, the digital data is represented as variations in the amplitude of carrier wave. This kind
of modulation is known as Amplitude Shift Keying (ASK).
Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals
through RF can travel through larger distances making it suitable for long range applications.
Also, while IR mostly operates in line-ofsight mode, RF signals can travel even when there is
an obstruction between transmitter & receiver. Next, RF transmission is more strong and
reliable than IR transmission. RF communication uses a specific frequency unlike IR signals
which are affected by other IR emitting sources.
This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver
(Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter receives serial data and
transmits it wirelessly through RF through its antenna connected at pin4.
The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received by an
RF receiver operating at the same frequency as that of the transmitter.
The RF module is often used along with a pair of encoder/decoder. The encoder is used for
encoding parallel data for transmission feed while reception is decoded by a decoder. HT12EHT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair ICs.

Dept of ECE, NCET

Page 27

SWARM ROBOTS USING RF COMMUNICATION

4.1.3.1 Pin Diagram of Transmitter and Receiver module:

Fig:4.1.3.1: Transmitter and Receiver module


4.1.3.2 Pin Description:

a) Transmitter Module:
Pin Number

Function

Name

Ground (0V)

GND

Serial Data Input Pin

DATA

Supply Voltage(5V)

Antenna Outputpin

VCC
ANT

Table :4.1.3.2(a): Pin description of Transmitter module

Receiver Module:

Dept of ECE, NCET

Page 28

SWARM ROBOTS USING RF COMMUNICATION

Pin

Function

Name

Ground (0V)

GND

Serial Data Output Pin

DATA

Linear Output Pin; Not Connected

NC

Supply Voltage (5V)

VCC

Supply Voltage (5V)

VCC

Ground (0V)

GND

Ground (0V)

GND

8Antenna Input Pin

ANT

Number

Table:4.1.3.2(b): Pin description of Receiver modul


4.1.4 Regulated DC Power supply:
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of fixed linear
voltage regulator ICs. The voltage source in a circuit may have fluctuations and would not
give the fixed voltage output. The voltage regulator IC maintains the output voltage at a
constant value. The xx in 78xx indicates the fixed output voltage it is designed to provide.
7805 provides +5V regulated power supply. Capacitors of suitable values can be connected at
input and output pins depending upon the respective voltage levels.
Pin diagram of 7805:

Dept of ECE, NCET

Page 29

SWARM ROBOTS USING RF COMMUNICATION

Fig:4.1.4: Pin diagram and Block diagram of LM805 Regulated DC power supply
4.1.4. Pin Description:

Table:4.1.4.1: pin description of LM7805 DC Power Supply


Component List :
1. Step down transformer
2. Voltage regulator
3. Capacitors
4. Diodes
Voltage regulator :
As we require a 5V we need LM7805 Voltage Regulator IC.
7805 IC Rating :

Dept of ECE, NCET

Page 30

SWARM ROBOTS USING RF COMMUNICATION

Input voltage range 7V- 35V

Current rating Ic = 1A

Output voltage range VMax=5.2V ,VMin=4.8V

Transformer :

Selecting a suitable transformer is of great importance. The current


rating and the secondary voltage of the transformer is a crucial factor.

Fig:4.1.4.1(a): Centre tapped Transformer


Dept of ECE, NCET

Page 31

SWARM ROBOTS USING RF COMMUNICATION

The current rating of the transformer depends upon the current required for the load to
be driven.

The input voltage to the 7805 IC should be at least 2V greater than the required 2V
output, therefore it requires an input voltage at least close to 7V.

So I chose a 6-0-6 transformer with current rating 500mA (Since 6*2 = 8.4V).

NOTE : Any transformer which supplies secondary peak voltage up to 35V can be used but as
the voltage increases size of the transformer and power dissipation across regulator increases.
Rectifying circuit :
The best is using a full wave rectifier

Its advantage is DC saturation is less as in both cycle diodes conduct.

Higher Transformer Utilization Factor (TUF).

1N4007 diodes are used as its is capable of withstanding a higher reverse voltage of
1000v whereas 1N4001 is 50V

Capacitors :
Knowledge of Ripple factor is essential while designing the values of capacitors
It is given by

Y=1/(43fRC) (as the capacitor filter is used)

1. f= frequency of AC ( 50 Hz)
2. R=resistance calculated
R= V/Ic
V= secondary voltage of transformer

V=62=8. 4

R=8.45/500mA=16.9 standard 18 chosen

Dept of ECE, NCET

Page 32

SWARM ROBOTS USING RF COMMUNICATION

3. C= filtering capacitance
We have to determine this capacitance for filtering
Y=Vac-rms/Vdc
Vac-rms = Vr/23
Vdc= VMax-(Vr/2)
Vr= VMax- VMin

Vr = 5.2-4.8 =0. 4V

Vac-rms = .3464V

Vdc = 5V

Y=0 .06928

Hence the capacitor value is found out by substituting the ripple factor in Y=1/(43fRC)
Thus, C= 2314 F and standard 2200F is chosen
Datasheet of 7805 prescribes to use a 0.01F capacitor at the output side to
avoid transient changes in the voltages due to changes in load and a 0.33F at the input side
of regulator to avoid ripples if the filtering is far away from regulator.

Circuit Diagram:

Dept of ECE, NCET

Page 33

SWARM ROBOTS USING RF COMMUNICATION

Fig: 4.1.4.1(b):Simple DC Regulated Power Supply Sys

CHAPTER -5
SENSORS
A device that detects the changes in electrical or physical or other quantities and
thereby produces an output as an acknowledgement of change in the quantity is called as a
Sensor. Generally, this sensor output will be in the form of electrical or optical signal.
Dept of ECE, NCET

Page 34

SWARM ROBOTS USING RF COMMUNICATION

5.1. Criteria to choose a Sensor:


There are certain features which have to be considered when we choose a sensor. They are as
given below:
1. Accuracy
2. Environmental condition - usually has limits for temperature/ humidity
3. Range - Measurement limit of sensor
4. Calibration - Essential for most of the measuring devices as the readings changes with
time
5. Resolution - Smallest increment detected by the sensor
6. Cost
7. Repeatability - The reading that varies is repeatedly measured under the same
environment

5.2. Classification of Sensors:


The sensors are classified into the following criteria:
1. Primary Input quantity (Measurand)
2. Transduction principles (Using physical and chemical effects)
3. Material and Technology
4. Property
5. Application
In swarm robots IR SENSORS were used. This device emits and/or detects infrared radiation
to sense a particular phase in the environment.

Fig:5.2: IR Sensor
Generally, thermal radiation is emitted by all the objects in the infrared spectrum.
The infrared sensor detects this type of radiation which is not visible to human eye.

Advantages:

Easy for interfacing

Dept of ECE, NCET

Page 35

SWARM ROBOTS USING RF COMMUNICATION

Readily available in market

Disadvantages:

Disturbed by noises in the surrounding such as radiations, ambient light etc.

5.3. Working:
The basic idea is to make use of IR LEDs to send the infrared waves to the object. Another IR
diode of the same type is to be used to detect the reflected wave from the object.

Fig:5.3: Working of IR sensor

When IR receiver is subjected to infrared light, a voltage difference is produced across the
leads. Less voltage which is produced can be hardly detected and hence operational
amplifiers (Op-amps) are used to detect the low voltages accurately.

Measuring the distance of the object from the receiver sensor. The electrical property of IR
sensor components can be used to measure the distance of an object. The fact when IR
receiver is subjected to light, a potential difference is produced across the leads.

5.4. Applications:

Thermography According to the black body radiation law, it is possible to


view the environment with or without visible illumination using thermography

Dept of ECE, NCET

Page 36

SWARM ROBOTS USING RF COMMUNICATION

Heating Infrared can be used to cook and heat food items. They can take away

ice from the wings of an aircraft. They are popular in industrial field such as, print
dying, forming plastics, and plastic welding.
Spectroscopy This technique is used to identify the molecules by analysing the

constituent bonds. This technique uses light radiation to study organic compounds.
Meteorology Cloud heights, calculate land and surface temperature is possible

when weather satellites are equipped with scanning radiometers.


Photobiomodulation This is used for chemotherapy in cancer patients. This is

used to treat anti herpes virus.


Climatology Monitoring the energy exchange between the atmosphere and

earth.
Communications Infrared laser provide light for optical fibre communication.
These radiations are also used for short range communications among mobiles and
computer peripherals.

CHAPTER-6
RESULTS

Dept of ECE, NCET

Page 37

SWARM ROBOTS USING RF COMMUNICATION

6.1. Module Working Setup:


The below diagram shows the setup of all the components
interfaced with microcontroller with transmitter and receiver module, push button, motor
driver and slider switch.

Fig:6.1: Module setup

CHAPTER-7
CONCLUSION & FUTURE WORK

Dept of ECE, NCET

Page 38

SWARM ROBOTS USING RF COMMUNICATION

7.1. Conclusion:
The swarm robot is designed for obstacle avoidance and also as light follower.
ATMEGA-16 microcontroller has been interfaced with different components as L239D motor
driver, HT12E encoder along with the transmitter module, and HT12D decoder along with
the receiver module and also with a push button and slider switch. We use AVR Studio-4 for
coding the program and Proteus to stimulate it.

7.1.1. Future work:


The swarm robots can be extended for great extent in future for many purposes
such as following:

Bomb detector in military field.


For also oil spills clean up and the seashore.

References

Dept of ECE, NCET

Page 39

SWARM ROBOTS USING RF COMMUNICATION

ATmega16 _ Mega16 AVR Microcontroller Datasheet & PIN Description EngineersGarage.html.


www.eXtremeElecronics.co.in
www.atmel.com
www.Holtek.com
www.futurelec.com
Texas instruments
www.AbLab Solutions.com
www.rakeshmondal.info
www.STrobotix.com

Appendix
#ifndef F_CPU
#define F_CPU 1000000UL
Dept of ECE, NCET

Page 40

SWARM ROBOTS USING RF COMMUNICATION

#endif
#include <avr/io.h> //initialising AVR GPIO library
#include <util/delay.h> //initialising delay library
void forward()
{
PORTB|=(1<<7); //motor pins 1001
PORTB&=~(1<<6);
PORTB&=~(1<<5);
PORTB|=(1<<4);
PORTB|=(1<<3); // transmitting 1001
PORTB&=~(1<<2);
PORTB&=~(1<<1);
PORTB|=(1<<0);
}
void backward()
{
PORTB&=~(1<<7); //motor pins 0110
PORTB|=(1<<6);
PORTB|=(1<<5);
PORTB&=~(1<<4);
PORTB&=~(1<<3); //transmitting 0110
PORTB|=(1<<2);
PORTB|=(1<<1);
PORTB&=~(1<<0);
}
void left()
{
PORTB&=~(1<<7); //motor pins 0101
PORTB|=(1<<6);
PORTB&=~(1<<5);
PORTB|=(1<<4);
PORTB&=~(1<<3); //transmitting 0101
PORTB|=(1<<2);
PORTB&=~(1<<1);
PORTB|=(1<<0);
}
void right()
{
PORTB|=(1<<7); //motor pins 1010
PORTB&=~(1<<6);
PORTB|=(1<<5);
Dept of ECE, NCET

Page 41

SWARM ROBOTS USING RF COMMUNICATION

PORTB&=~(1<<4);
PORTB|=(1<<3); //transmitting 1010
PORTB&=~(1<<2);
PORTB|=(1<<1);
PORTB&=~(1<<0);
}
void stop()
{
PORTB&=~(1<<7); //motor pins 0000
PORTB&=~(1<<6);
PORTB&=~(1<<5);
PORTB&=~(1<<4);
PORTB&=~(1<<3); //transmitting 0000
PORTB&=~(1<<2);
PORTB&=~(1<<1);
PORTB&=~(1<<0);
}
int main()
{
DDRB=0XFF; //initialinsing PORTB as outputs : Lower nibble for RF Transmitter, Higher
nibble for Motor driver
PORTB=0X00;
DDRD=0X00; //initialising PORTD as inputs : Lower nibble for RF receiver, PD4
make it Master or Slave
PORTD=0XFF;
DDRC=0X00; //initialising PORTC as outputs : PC0 and PC1 for sensor inputs
PORTC=0x03;
while(1)
{
if((PIND & 0X10) == 0X00) //PD4 HIGH: Robot acts as Master
{
if((PINC & 0X03)== 0X03) //LEFT and RIGHT side has Object
{
forward(); //Robot moves forward and transmits 1001
}
else if((PINC & 0X03)== 0X00) //LEFT and RIGHT side has no Object
{
stop(); //Robot stops and transmits 0000
}
else if((PINC & 0X03)== 0X01) //LEFT side has Object
{
left(); //Robot moves left and transmits 0101
}
else if((PINC & 0X03)== 0X02) //RIGHT side has Object
{
right(); //Robot moves right and transmits 1010
Dept of ECE, NCET

Page 42

SWARM ROBOTS USING RF COMMUNICATION

}
else
{
stop();
}
}
else if ((PIND & 0X10) == 0X10) // PD4 LOW : Robot acts as Slave
{
if((PIND & 0X0F)== 0X09) //Received 1001, when master moving forward
{
forward(); //Robot moves forward
}
else if((PIND & 0X0F)== 0X00) //Received 0000, when master is not
moving
{
stop(); //Robot stops
}
else if((PIND & 0X0F)== 0X05) //Received 0101, when master moving left
{
left(); //Robot moves left
}
else if((PIND & 0X0F)== 0X0A) //Received 1010, when master moving
right
{
right(); //Robot moves right
}
else
{
stop();
}
}
}
}

Dept of ECE, NCET

Page 43

Potrebbero piacerti anche