0% found this document useful (0 votes)
74 views

Chapter 1: Introduction: 1.1 Project Overview

The document discusses interfacing an Xbee module with a Raspberry Pi 2 for wireless communication. It describes connecting an Xbee dongle to each device's USB port and pairing the Xbees with matching baud rates to transmit data between the Raspberry Pi and a computer.

Uploaded by

RAJU VALLEPU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Chapter 1: Introduction: 1.1 Project Overview

The document discusses interfacing an Xbee module with a Raspberry Pi 2 for wireless communication. It describes connecting an Xbee dongle to each device's USB port and pairing the Xbees with matching baud rates to transmit data between the Raspberry Pi and a computer.

Uploaded by

RAJU VALLEPU
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 27

Xbee interfacing with raspberry pi model 2

CHAPTER 1: INTRODUCTION

1.1 PROJECT OVERVIEW

XBee is a communication device used for the data transfer between the
controllers, computers, systems, really anything with a serial port. As it works with low
power consumption, the transmission distances is limited to 10–100 meters line-of-sight.
XBee devices can transmit data over long distances by passing data through a mesh
network of intermediate devices to reach more distant ones. XBee is typically used in low
data rate applications that require long battery life and secure networking. Its main
applications are in the field of wireless sensor network based on industries as it requires
short-range low-rate wireless data transfer. The technology defined by the XBee
specification is intended to be simpler and less expensive than other wireless 
networks.by using RPI and Xbee we are transmitting the information and receiving the
information by the help of xbee co ordinator and Router .

1.2 INFORMATION TRANSFER

The interface of Xbee with Raspberry Pi2 for a proper wireless communication.
Raspberry Pi2 has got four USB ports, so it is better to use a Xbee Dongle for this
interface.The two Xbee must be paired with the same baudrate (for Ex: 9600) with X-
CTU Software. Attach the two xbee’s to the two dongle’s and connect one pair on the
USB port of the Raspberry Pi2. Connect the other pair to the USB port of a computer or a
Laptop. Install the FTDI Driver on the Computer /laptop to provide usb communication.
Create a hyperterminal, select the corresponding com port and the baudrate for the
connected device.for the transformation of information from RPi to xbee

ADVANTAGES:
Works anywhere
If your Raspberry Pi is connected to the internet, you can access it via Dataplicity. You
can even connect to devices behind firewalls.

Department of ECE, VBIT 1


Xbee interfacing with raspberry pi model 2

Easy access via browser


Log in to Dataplicity, select the device you want and access your remote shell. It's that
simple!

Simple and secure


Dataplicity connects using client-initiated HTTPS, so it's safe, encrypted and you don't
need to make specific firewall exceptions.

APPLIATIONS :
The raspberry pi boards are used in many applications like
1. Media streamer,
2.Arcade machine,
3.Tablet computer
4.Home automation,
5. Carputer,
6.Internet radio,
7.Controlling robots,
8.Cosmic Computer,
9.Hunting for meteorites,
10.Coffee and also in raspberry pi based projects

Department of ECE, VBIT 2


Xbee interfacing with raspberry pi model 2

CHAPTER 2:LITERATURE SURVEY

The Raspberry Pi is a very powerful computer having the dimensions of a business card.
In this paper we review Raspberry Pi whose popularity has taken the learning process and
application of ideas to a whole new level. We also discuss some of the best projects that
have come up so far.

Keywords: Raspberry Pi, Business card etc

INTRODUCTION :

The engineers with a pragmatic approach are the biggest boon to a society. The
application of ideas, theories, new innovations is what drives them. For years the work
was done on Arduino boards but with the launch of the very cheap Raspberry Pi it all
changed. Raspberry Pi’s inception began in 2006 it was finally released on 19 February
2012 as two models: Model A and Model B. After the sale of 3 million units in May
2014, the latest Model B+ was announced in July 2014. It contains many minor
improvements based on the user suggestions without any increase in price.

TECHNICAL SPECIFICATIONS

The following are specifications for Model B+: 

1. Broadcom BCM2835 SoC processor with 700MHz ARM1176JZF-S core

512MB RAM 

2. Videocore 4 GPU supports up to 1920x1200 resolution 

3. MicroSD card slot

4. 10/100Mbps Ethernet port

5.4 x USB 2.0 ports

6. HDMI, audio/video jack 

Department of ECE, VBIT 3


Xbee interfacing with raspberry pi model 2

7.GPIO header containing 40 pins

8..MicroUSB power port providing 2A current supply 

9. DSI and CSI ports

10. Dimensions: 85.6x56mm

Computers are now utilities essential for communicating, entertainment, and accessing all
kinds of business and government services. But in the process of becoming so crucial,
computers have become increasingly locked-down. It’s not impossible to tinker with the
guts of a computer running Windows or Mac OS, but it’s tricky and getting trickier with
every new release. It’s also risky if you depend on the machine to do your homework.
And few kids have the courage to seriously mess with Dad’s computer. But parents
generally condone this behavior.

The Raspberry Pi offers another path: encouraging experimentation by lowering the cost
of accidentally breaking when you’re trying to be making. The computer was conceived
of by Eben Upton, formerly a lecturer at the University of Cambridge, U.K., who created
the Raspberry Pi Foundation to make it a real product. Upton is also a veteran of several
years at chip maker Broadcom, designing the kind of chips that make it possible to sell a
complete computer

Department of ECE, VBIT 4


Xbee interfacing with raspberry pi model 2

CHAPTER 3: SYSTEM DESCRIPTION

This system uses the following descriptions.

2.1.0 Hardware descriptions

The demonstration will require minimum basic components as Raspberri pi2, Xbee
Module,xbee USB Board,

BLOCK DIAGRAM

Department of ECE, VBIT 5


Xbee interfacing with raspberry pi model 2

2.1.1 Raspberri pi
The Raspberry Pi hardware has evolved through several versions that feature variations in
memory capacity and peripheral-device support.

This block diagram describes Model B and B+; Model A, A+, and the Pi Zero are similar,
but lack the Ethernet and USB hub components. The Ethernet adapter is internally
connected to an additional USB port. In Model A, A+, and the Pi Zero, the USB port is
connected directly to the system on a chip . On the Pi 1 Model B+ and later models the
USB/Ethernet chip contains a five-point USB hub, of which four ports are available,
while the Pi 1 Model B only provides two. On the Pi Zero, the USB port is also
connected directly to the system on a chip, but it uses a micro USB (OTG) port.

2.1.2 Processor
The Broadcom BCM2835 SoC used in the first generation Raspberry Pi is somewhat
equivalent to the chip used in first modern generation smartphones(its CPU is an
older ARMv6 architecture), which includes a 700 MHz ARM1176JZF-S
processor, VideoCoreIV graphics processing unit (GPU) and RAM. It has a level 1
(L1) cache of 16 KB and a level 2 (L2) cache of 128 KB. The level 2 cache is used
primarily by the GPU. The SoC is stacked underneath the RAM chip, so only its edge is
visible.
The earlier V1.1 model of the Raspberry Pi 2 used a Broadcom BCM2836 SoC with a
900 MHz 32-bit quad-core ARM Cortex-A7 processor, with 256 KB shared L2
cache.The Raspberry Pi 2 was upgraded to a Broadcom BCM2837 SoC with a 1.2 GHz
64-bit quad-core ARM Cortex-A53 processor, the same SoC which is used on the
Raspberry Pi 3, but underclocked (by default) to the same 900 MHz CPU clock speed .
The BCM2836 SoC is no longer in production

Department of ECE, VBIT 6


Xbee interfacing with raspberry pi model 2

Raspberry Pi 2 included a quad-core Cortex-A7 CPU running at 900 MHz


and 1 GB RAM. It was described as 4–6 times more powerful than its predecessor. The
GPU was identical to the original.In parallelised benchmarks, the Raspberry Pi 2 could
be up to 14 times faster than a Raspberry Pi 1 Model B+

2.1.3 RAM

On the older beta Model B boards, 128 MB was allocated by default to the GPU, leaving
128 MB for the CPU.On the first 256 MB release Model B (and Model A), three different
splits were possible. The default split was 192 MB (RAM for CPU), which should be
sufficient for standalone 1080p video decoding, or for simple 3D, but probably not for
both together.

2.1.4 Peripherals.

Department of ECE, VBIT 7


Xbee interfacing with raspberry pi model 2

The Raspberry Pi may be operated with any generic USB computer


keyboard and mouse. It may also be used with USB storage, USB to MIDI converters,
and virtually any other device/component with USB capabilities.
Other peripherals can be attached through the various pins and connectors on the surface
of the Raspberry Pi.

2.1.5XBEE MODULE

Digi XBee is the brand name of a family of form factor compatible radio modules
from Digi International. The first XBee radios were introduced under
the MaxStream brand in 2005 and were based on the IEEE 802.15.4-2003 standard
designed for point-to-point and star communications at over-the-air baud rates of
250 kbit/s.

Xbee consits of two series of modules

1.xbee series 1 hardware

2.Xbee series 2 hardware

1. X-Bee Series 1 hardware

These radios use a microchip made by free scale to provide simple,


standards- based point-to-point communication as well as implementation of
mesh networking

Fig XBee series 1 module

Department of ECE, VBIT 8


Xbee interfacing with raspberry pi model 2

X-Bee series 2 hardware


The series xbee uses a micro chip from ember networks that enables several different
flavors of standards based zigbee networking

Fig XBee series 2 module

1.5 Breadbords
solderless device for temporary prototype with electronics and test circuit designs. Most
electronic components in electronic circuits can be interconnected by inserting their leads
or terminals into the holes and then making connections through wires where appropriate.
The breadboard has strips of metal underneath the board and connect the holes on the top
of the board. The metal strips are laid out as shown below. Note that the top and bottom
rows of holes are connected horizontally and split in the middle while the remaining
holes are connected vertically.

1.6 X-Bee USB Explorer Board


XBee USB board is used for interfacing any of the series-1 wireless modules with the PC.
Using this USB adaptor board for XBee wireless modules you can communicate between
PC to PC, PC to robot / embedded board. You can also use this module to change
configuration of the XBee devices using PC via USB port using XCTU software from
Digi.

Department of ECE, VBIT 9


Xbee interfacing with raspberry pi model 2

Fig X-Bee explorer module

Fig XBee board with XBee radio

Software Descriptions:

Download and install

This section contains download and install instructions based on operating system. XCTU
is compatible with Linux, OSX, and Windows. It may be necessary to configure your
system prior to installing XCTU for the first time.

XCTU requirements

Operating systems
Department of ECE, VBIT 10
Xbee interfacing with raspberry pi model 2

xctu is competable with following operating systems


Windows
Mac os
linux

Supported RF modules
XCTU supports configuration and communication for most Digi RF modules.
XCTU uses a serial link to interact with these radio modules, providing an easy-to-use
and intuitive graphical interface. The following is a complete list of XCTU-compatible
RF modules:.
Some of them are
XBee SX l
XBee-PRO SX l
XBee 802.15.4 l
XBee-PRO 802.15.4 l
XBee ZB l
XBee-PRO ZB l
Programmable XBee-PRO ZB

Install XCTU - linux


Follow the steps below to download and install XCTU on your computer.
1. Open a terminal console.
2. Execute this command: sudo usermod -a -G dialout where is the user you want
to add to the dialout group.
3. Log out and log in again with your user in the system. Download and install
XCTU Install XCTU - OSX XCTU User Guide 11
4. Visit www.digi.com/xctu.
5. Click Download XCTU.
6. Under Utilities, click the Linux installer link.

Department of ECE, VBIT 11


Xbee interfacing with raspberry pi model 2

7. When the file has finished downloading, run the executable file and follow the
steps in the XCTU Setup Wizard. A “What’s new” dialog appears when XCTU opens the
first time after the installation
2.2 XCTU overview
XCTU is divided into five main sections: the menu bar, main toolbar, devices list,
working area, and status bar.

Fig 2.2.1 basic terminal page of xctu

Next picture shows the configuration of devices of router and coordinator

Department of ECE, VBIT 12


Xbee interfacing with raspberry pi model 2

2.2.2 detection of no. of xbee modules

And finally this picture shows the required out put which will appear on console window

Fig 2.2.3 console window


These were the software specifications for the xbeemodule

Department of ECE, VBIT 13


Xbee interfacing with raspberry pi model 2

2.3 Raspberri- pi
The software for the raspberri-pi is raspbian .
Raspbian is a free operating system based on Debian optimized for the Raspberry Pi
hardware. An operating system is the set of basic programs and utilities that make your
Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over
35,000 packages, pre-compiled software bundled in a nice format for easy installation on
your Raspberry Pi.

2.3.1 Raspbian Image


A Raspbian image is a file that you can download onto an SD card which in turn can be
used to boot your Raspberry Pi and Via APC into the Raspbian operating system. Using a
Raspbian image is the easiest way for a new user to get started with Raspbian.

2.3.2Raspbian Installer

Ecther :

Etcher

Etcher 1.4.4

Developer(s) resin.io

Stable release 1.4.4

Operating system Cross-platform

License Apache License

Website etcher.io

Etcher is free and open-source cross platform software used for burning images
(ZIP,ISO,IMG). It supports Windows , OSx and GNU/Linux and has been developed

Department of ECE, VBIT 14


Xbee interfacing with raspberry pi model 2

with the help of electron framework and supports hardware such as USB Keys and SD
cards.

And then after flashing just remove the sd card put it on raspberrypi

Department of ECE, VBIT 15


Xbee interfacing with raspberry pi model 2

CHAPTER 4: IMPLEMENTATION OF XBEE AND


RASPBERRY-PI

The components required are Raspberry Pi Model 2, two XBee modules with Explorer
shields and some female-to-female jumper wires
To configure XBee module, connect XBee Explorer shield to a computer via USB.

1.Then run the XCTU software and click on ‘Add Devices’ icon.

2. You will get an ‘Add radio device’ window. Confirm the COM port of the Explorer
and set the baud rate to 9600, data bits to 8, parity to none and click on finish

3. Now click on ‘XBee Module’ on the left of the Radio Configuration screen .

4. to configure it. There are three types of devices in a communication network:


coordinator, end device and Now first, configure XBee as coordinator.

Department of ECE, VBIT 16


Xbee interfacing with raspberry pi model 2

To do that, click on ‘Update Firmware,’ set it to ‘XBee coordinator AT,’ click on the latest
firmware available and then click on ‘Finish.’ Each XBee has two important keys, SH
and SL, which help in transmission and reception of data. SL is unique to each XBee
whereas SH is the same. The bottom view of a typical XBee module is shown in fig 5
along with its SL number as 406F70BEand SH as 0013A200.The coordinator sends the
data, so the XBee connected to Raspberry Pi is set as coordinator.

End device receives the data. Here we will use Console Mode of X-CTU to view received
data, hence, XBee connected to the computer with XCTU should be set as end device.
Router (sort of repeater)is an optional mode; in this, XBee simply receives and then
transmits the same data, and so this mode is used to extend the range of transmitter.To
configure XB2 as end device, repeat the steps done for configuring XB1, update the
firmware and replace its DH and DL values with the SH and SL values of coordinator
XB1, respectively. Now XB1 can transmit data and XB2 can receive it. You can see the
details of coordinator (XB1) and end device (XB2) modules in Fig. and Fig. ,
respectively.

You can see the details of coordinator (XB1) and end device (XB2) modules in Fig. and
Fig. , respectively.

Department of ECE, VBIT 17


Xbee interfacing with raspberry pi model 2

Fig 4.1 setting the modules

The communication between XBee and Raspberry Pi is done through serial


communication. The connections for serial communication between XBee and Raspberry
Pi Model 2 are given below and also shown in Fig. 8.

Department of ECE, VBIT 18


Xbee interfacing with raspberry pi model 2

ig. 4.2: XBee interfacing with Raspberry Pi Model

Fig 4.3 terminal of RPI

Department of ECE, VBIT 19


Xbee interfacing with raspberry pi model 2

Fig. 9: Screenshot of minicom on Raspberry Pi

Rx (Pin 3) of XBee Pin 08 (GPIO14)

Tx (Pin 2) of XBee Pin 10 (GPIO15)

Vcc (Pin 1) of XBee Pin 01 (3.3V DC)

GND (Pin 10) of XBee ® Pin 06 (GND)

You need to reboot the Raspberry Pi board after these connections and the configurations
as explained below.

In order to use the serial port for communication between Raspberry Pi and XBee, some
configurations are required in files cmdline.txt and inittab.txt. Start the ‘Terminal’ on
Raspberry Pi

Now the serial port of Raspberry Pi is disengaged from the boot sequence and can be
used to communicate with XBee module. The default baud rate of the ttyAMA0 is
115200, but a baud rate of 9600 is required for XBee. And run the required code to run
to get the out put

Make sure to run the code in python which was already present in the rasbian software
The transformation of information done via serial communicationAnd run the source

Department of ECE, VBIT 20


Xbee interfacing with raspberry pi model 2

code This code send data ‘hello user’ to the console (refer Fig.

Fig 4.4 console window

CHAPTER 5: TESTING AND RESULTS

5.1TESTING:

Now it is time to test our project. After saving the code and connecting coordinator mode
XBee module to your Raspberry Pi, boot the Raspberry Pi and from the terminal write the
following commands to execute your program.

Department of ECE, VBIT 21


Xbee interfacing with raspberry pi model 2

Fig 5.1.1 detecting the Xbee modules by using xctu software

Department of ECE, VBIT 22


Xbee interfacing with raspberry pi model 2

Fig 5.1.2 connecting modules to RPI

Now to confirm reception of data, hook up your end device XBee module to your
computer, open the console mode in XCTU, start serial communication with XBee
module. You should get the output on your screen

5.2 Result :

According to our attribute we find the result that data is transffered from the RPI to the
xbee modules which will be seen in the terminal of XCTU software
We found data was accorinding our code ‘Hello user’
The transformation of data can be done mutually RPI to XBEE and XBEE to RPI
The following figures to determine the testing

Department of ECE, VBIT 23


Xbee interfacing with raspberry pi model 2

Fig 5.2.1 Transmitting information on router module

Fig 5.2.2 receving information on co-ordinator module

Department of ECE, VBIT 24


Xbee interfacing with raspberry pi model 2

CHAPTER 6: FUTURE SCOPE AND COCLUSION


6.1FUTURE SCOPE :
Raspberry Pi is an innovative technology. The sheer number of users and fan base
support the fact that the device can see an abundant future ahead. The device can
certainly help anyone who really needs to learn electronics and computers. Raising the
processing power can certainly assist the product in the future. Also supply a case and a
appropriate instruction manual will get better the product. Also at present Windows
operating systems are not compatible because of the ARM processor. If the processor is
enhanced or any workaround is found to run Windows directly on the Raspberry Pi then
it can be a great step for the Pi. The Raspberry Pi is a wonderful piece of hardware
because of the combination of the features of a traditional computer and an embedded
device. It supports computer operating systems like Linux and provides easy input/output
lines i.e. the GPIO makes it ideal for controlling almost anything. Programming the GPIO
is much simple and perceptive then a traditional FPGA or microprocessor. Lastly it can
be said that Raspberry Pi can be efficiently used if its processing power is kept in mind. It
can work as a individual computer but cannot swap it.

6.2CONCLUSION :
we used Raspberri-pi and Xbee modules to communicate each other we suceesfully
completed our project first we booted up the raspberri –pi and later dected xbee
modules in the digi software xctu by dumping the small piece of code into the RPI.
we successfully obtained the information which was transformed mutually from to
Xbee to RPI

REFERENCES
https://dzone.com/articles/connecting-xbee-raspberry-pi
https://electronics for u.com Engineering Projects For You
https://www.cooking-hacks.com/index.php/.../xbee-arduino-raspberry-pi-tutorial

Department of ECE, VBIT 25


Xbee interfacing with raspberry pi model 2

Department of ECE, VBIT 26


Xbee interfacing with raspberry pi model 2

APPENDIX - A

import serial
#For Serial Communication
import time
#For Delay Function
ser = serial.Serial(‘/dev/ttyAMA0’)
#Set ser as Object
ser.baudrate = 9600
#Set Baud Rate to 9600
ser.write(“A”)
#Send Character ‘A’
time.sleep(1)
#Give 1 Second Delay
ser.write(“B”)
#Send Character ‘B’
time.sleep(1)
#Give 1 Second Delay
ser.close()
#Close Communication

(Or)

import serial

# Enable USB Communication


ser = serial.Serial('/dev/ttyUSB0', 9600,timeout=.5)

while True:
ser.write('Hello User \r\n') # write a Data
incoming = ser.readline().strip()
print 'Received Data : '+ incoming

Department of ECE, VBIT 27

You might also like