Anda di halaman 1dari 28

A PROJECT REPORT ON

mCricket- IOT Based Demonstration Platform

SUBMITTED TO C-DAC HYDERABAD IN PARTIAL FULFILLMENT OF THE


REQUIREMENT FOR THE AWARD OF

Submitted By:

GUPTA AAKASH
JATIN KUMAR KHILRANI
JYOTI
KAPIL

CENTRE FOR DEVELOPMENT OF ADVANCED COMPUTING


HYDERABAD
website: www.cdachyd.in

1
CERTIFICATE

This is to certify that this is a bonafied record of project work mCricket-IOT


Based Demonstration platform done by GUPTA AAKASH, JATIN KUMAR,
KHILRANI, JYOTI and KAPIL under the guidance of Mr. TAPAS in partial
fulfillment of the requirement of Diploma in Embedded System Design at C-
DAC Hyderabad for academic session of February 2016.

Guided By:

Mr. Tapas

2
ACKNOWLEDGEMENTS

It gives us great pride to present the project report for our project entitled
mCricket- IOT Based Demonstration Platform which is culmination of our
efforts. It gives us great pleasure in conveying our sincere thanks to all those
who have helped us in the successful completion of this project.
We would like to thank our mentor, Mr. Tapas for everything hes done,
for all supervising our project.
We would like to extend our gratitude towards Mr.
Vishant Garg (Course Co-ordinators, ACTS) & the staff members of ACTS,
Hyderabad.

3
ABSTRACT

The mCricket is an IOT device for Cricket players. The device will capture
motion relevant data from the Players Physical activities during play and
transfers over a Wifi and Xbee Link to a Target Laptop/Tablet/Mobile for post
processing and derive meaningful information for the player.

On Raspberry Pi a mCricket Client Application will run to process the data real-
time. If real- time processing is not possible the Player can carry a Mobile Phone
in her/his pocket to capture data and store it. Further it can send email to
registered users. Device can also store some data in its Local Storage using
parallax data acquisition if no communication target is available for post-
processing also it is used to play audio , video at different states.

Further the user can upload the data to Cloud to be reviewed and commented by
experts, trainers, coaches and also for future reference.

A modified version of this device can be used an Implant in Cricket Gears like
Bat, Ball and Gloves. These implants will transfer data as behavior of the Gear.
Software can be used to derive useful Information from these data.

With right Software Design mCricket can help to improve Cricket players
performance. The device can also bring in more information from the game and
add more Fun and Entertainment value to audience of the game.

Further this wearable device can be used in any other sports like Football,
Hockey, Baseball, Rugby, Golf, Lawn Tennis, Badminton, Volley Ball, Basket
Ball, Table Tennis, Discuss Throw, Hammer Throw, Javelin Throw, Pole Vault,
Shot Put, Archery, Fencing, Boxing, and some others sports also.

This device can improve the quality of any sports it is used in along with extra
Fun values. This can become de facto necessity for any sports

4
TABLE OF CONTENTS

Page Number
1. Introduction
A. About Project 6
B. Scope of Project 6
C. System Requirements
I. Hardware Requirements 7
II. Software Requirements 7
2. Literature Survey 8
3. mCricket Section 12
4. Data Processing Unit 19
5. Conclusion and Future Enhancements 25
6. References 27

5
1. Introduction

1.1. About Project

An interactive platform which can be deployed in cricket field.This comprises of


three units:-
1. Bowler: - ARDUINO is responsible for taking ADC readings from
accelerometer and sending it to Data Acquisition Unit(D.A.U) through
UART.

2. Batsman: - Responsible for sending IR sensor data to DAU via TCP


Socket.

3. D.A.U:- In this Raspberry Pi is responsible for taking reading from Bowler


(UART) and Batsman (TCP Socket), E-mailing and playing audio as per
different states of bowler and batsman based on embedded Linux.

1.2. Scope of the project

The project aims motivating street cricket and adding more fun and
entertainment to cricket. The components that are used in this demo can be
integrated to a high extend to provide statistics of different components of cricket.
mCricket helps in providing real-time on-field actions, thereby helping its user of
the current actions happening on field. This project helps in broadcasting the on-
field events by email as well.

1.3. System Requirements


1.3.1. Hardware requirements
The selection of hardware is very important in the extension and proper
working of any software. In the selection of hardware, the size and capacity
requirements are also important.

6
Raspberry pi
LED Debug
Speakers
Wifi Module
Router
Arduino
Xbee pro
ESP8266 Wi-fi Module
Accelerometer
IR sensor
Power Supply
Modem

1.3.2. Software requirements
One of the most difficult tasks is that, the selection of the software once
system requirements are known is determining whether a particular software
package fits the requirements. After initial selection further security is needed to
determine the desirability of particular software compared with other candidates.

Linux based raspbian operating system


Android Development tool :- Android Studio,SDK, AVD.
XCTU
ESPlorer
Proteus
Xcode IDE
PLX DAQ parallax

7
2.Literature Survey

2.1 Introduction to Cricket

Cricket is an Outdoor Physical sport played with a bat and ball on a large field,
known as a ground, between two teams of 11 players each; one being the batting
team whiles the other one is the fielding team. It is single combat, in which an
individual batsman does battle against an individual bowler, who has helpers
known as fielders. The bowler propels the ball with a straight arm from one end
of the 22-yard pitch in an attempt to dismiss the batsman by hitting a target
known as the wicket at the other end, or by causing the batsman to hit the ball
into the air into a fielder's grasp, or by inducing one of a number of other
indiscretions. The batsman attempts to defend the wicket with the bat and to
score runs by striking the ball to the field boundary, or far enough from the
fielders to allow the batsman to run to the other end of the pitch before the ball
can be returned. When one of the team has finished batting the teams' roles are
reversed. The total number of runs accumulated determines the winner.

2.2 The Playing Surface

The Cricket is played on an oval shaped field. There are no fixed dimensions
for the field but its diameter usually varies between 450 feet (137 m) and 500 feet
(150 m). In the center of the field is a rectangular strip, known as the pitch. The
pitch is 20.12 m (22 yards) long between the wickets and is 3.0m (10 feet) wide.
The Bowler and Batsman fight on this Pitch surface with Ball and Bat.

8
Batsman and Bowler on Pitch playing against each other

The essence of the Cricket game is that a bowler delivers the ball from his
end of the pitch towards the batsman who, armed with a bat is "on strike"
at the other end.

2.3 The Bat and the Ball


A cricket bat is the equipment used by batsmen in the sport of cricket to hit
the ball. It consists of a cane handle attached to a flat-fronted willow-wood
blade. The length of the bat may be no more than 38 inches (965 mm) and
the width no more than 4.25 inches (108 mm).

A cricket ball is a hard, solid ball used by bowler to bowl the Batsman. It
weighs between 155.9 and 163.0 grams.

2.4 Bowling

The bowler reaches his delivery stride by means of a "run-up. A Fast


bowler needs momentum and takes quite a long run-up, running very fast

9
as he does so. A Spin bowler with a slow delivery takes no more than a
couple of steps before bowling.

The fastest bowlers can deliver the ball at a speed of over 90 miles per
hour (140 km/h) and they sometimes rely on sheer speed to try and defeat
the batsman, who is forced to react very quickly. Other fast bowlers rely
on a mixture of speed and guile. Some fast bowlers make use of the seam
of the ball so that it "curves" or "swings" in flight.

At the other end of the bowling scale is the "spinner" who bowls at a
relatively slow pace and relies entirely on guile to deceive the batsman. A
spinner will often bowl by "tossing one up" (in a slower, higher parabolic
path) to lure the batsman into making a poor shot. The batsman has to be
very wary of such deliveries as they are often "flighted" or spun so that the
ball will not behave quite as he expects and he could be "trapped" into
getting himself out.

In between the pacemen and the spinners are the "medium pacers" who
rely on persistent accuracy to try and contain the rate of scoring and wear
down the batsman's concentration.

10
2.5 Batting

The aim of batting is to score runs; the batter also has to try and stop the
ball from hitting the wicket and therefore getting him out. A batsman can
use a wide variety of "shots" or "strokes" with his bat to hit the ball. The
idea is to hit the ball to best effect with the flat surface of the bat's blade.
There is a wide variety of shots played in cricket. These includes strokes
named according to the style of swing and the direction aimed: e.g., "cut",
"drive", "hook", "pull".

System BLOCK DIAGRAM

Batsman- ESP8266 Bowler- Arduino+


+ IR Aceelerometer

Wifi
(192.168.0.1:80)

Data Acquision And


Processing Unit

11
3. mCricket Section

3.1 Bowler section:-

Basically consisting ofa hand mounted device which has an accelerometer


embedded inside it. Acquiring the analog data and transmitting it to the
arduino which in turn transmits it to the main D.A.U which does the other
processing.

3.1.1. Sensor Unit.

Accelerometer: - Accelerometers are used to sense both static (e.g.


gravity) and dynamic (e.g. sudden starts/stops) acceleration. One of the
more widely used applications for accelerometers is tilt-sensing. Because
they are affected by the acceleration of gravity, an accelerometer can tell
you how its oriented with respect to the Earths surface. For example,
Apples iPhone has an accelerometer, which lets it know whether its being
held in portrait or landscape mode. An accelerometer can also be used to
sense motion. For instance, an accelerometer in Nintendos WiiMote can
be used to sense emulated forehands and backhands of a tennis racket,
or rolls of a bowling ball. Finally, an accelerometer can also be used to
sense if a device is in a state of free fall. This feature is implemented in
several hard drives: if a drop is sensed, the hard drive is quickly switched
off to protect against data loss.

3.1.2. Transmission Unit:-

The data from the Accelerometer is in the form of analog signal which is
fed to the Arduino by processing it into digital signal. The Arduino is
connected with a xbee pro module which helps in communication between
Raspberry pi and itself.

12
3.2 Batsman Section:-

It is also a hand-mounted device which has a sensor to get data from the
batsman, calibrated to transmit data through wi-fi depending upon the
hand-motion and position of the batsman.

3.2.1. Sensor unit:-

IR sensor: - An IR sensor is a device which detects IR radiations falling


on it. An IR sensor is basically a device consisting of a pair of IR LED and
a photodiode which are collectively called a photo-coupler or opto coupler.
The IR LED emits IR radiation, reception and/or intensity of reception of
which by the photodiode dictates the output of the sensor. Now, there are
so many ways by which the radiation may or may not be able to reach the
photodiode. In mCricket,IR sensor is taking reading of the batsman i.e
hand moment of the batsman and corresponding readings are given to the
ESP8266 wi-fi module which is explained next.

The below diagram shows the working mechanism of IR sensor:-

13
LM358M is a general purpose Dual Operational Amplifier (Op-Amp) which is
used in IR sensor. we use it to compare two voltages, one is fixed and the other
varies with an environmental parameter. If the parameter controlled voltage is
higher than the fixed the voltage, then the IC should give one output, and if it is
lower than the fixed voltage, then it should give another output. So, we see that
the IC gives only two types of outputs, which we design to be 5 Volts and 0 Volts.
This makes our sensor digital which is shown below:

3.2.2. Transmission Unit:-

ESP8266:- The ESP8266 is a low-cost Wi-Fi chip with full TCP/IP stack
and microcontroller capability. This small module allows microcontrollers to
connect to a Wi-Fi network and make simple TCP/IP connections.
Features:

32-bit RISC CPU


64 KiB of instruction RAM, 96 KiB of data RAM
External QSPI flash - 512 KiB to 4 MiB* (up to 16 MiB is supported)
IEEE 802.11 b/g/n Wi-Fi
16 GPIO pins

14
SPI, IC,
UART on dedicated pins, plus a transmit-only UART can be enabled on
GPIO2
1 10-bit ADC

Open source SDKs include:-

A Lua based firmware for ESP8266 Wi-Fi SOC


NodeMCU is an eLua based firmware for the ESP8266 WiFi SOC from
Espressif. The firmware is based on the Espressif NON-OS SDK
1.5.1 and uses a file system based on spiffs
Spiffs is a file system intended for SPI NOR flash devices on embedded
targets.

Spiff is designed with following characteristics in mind:-

Small (embedded) targets, sparse RAM without heap


Only big areas of data (blocks) can be erased
An erase will reset all bits in block to ones
Writing pulls one to zeroes
Zeroes can only be pulled to ones by erase
Wear leveling

The circuit for mCricket:

15
3.2.3. Socket Programming:-

A socket is one of the most fundamental technologies of computer networking.


Sockets allow applications to communicate using standard mechanisms built into
network hardware and operating systems.

3.2.3.1. Point-to-Point Communication

In a nutshell, a socket represents a single connection between exactly two pieces


of software. More than two pieces of software can communicate in client/server
or distributed systems (for example, many Web browsers can simultaneously
communicate with a single Web server) but multiple sockets are required to do
this. Socket-based software usually runs on two separate computers on the
network, but sockets can also be used to communicate locally (inter-process) on
a single computer.
Sockets are bidirectional, meaning that either side of the connection is
capable of both sending and receiving data. Sometimes the one application that
initiates communication is termed the client and the other application the server,
but this terminology leads to confusion in non-client/server systems and should
generally be avoided.

3.2.3.2. Libraries

Programmers access sockets using code libraries packaged with the operating
system. Several libraries that implement standard application programming
interfaces (APIs) exist.

3.2.3.3. Interface Types

Socket interfaces can be divided into three categories. Perhaps the most
commonly-used type, the stream socket, implements "connection-oriented"
semantics. Essentially, a "stream" requires that the two communicating parties

16
first establish a socket connection, after which any data passed through that
connection will be guaranteed to arrive in the same order in which it was sent.
Datagram sockets offer "connection-less" semantics. With datagrams,
connections are implicit rather than explicit as with streams. Either party simply sends
datagrams as needed and waits for the other to respond; messages can be lost in
transmission or received out of order, but it is the application's responsibility and not the
socket's to deal with these problems. Implementing datagram sockets can give some
applications a performance boost and additional flexibility compared to using
stream sockets, justifying their use in some situations.
The third type of socket -- the so-called raw socket -- bypasses the
library's built-in support for standard protocols like TCP and UDP. Raw sockets
are used for custom low-level protocol development.

3.2.3.4. Addresses and Ports

Today, sockets are typically used in conjunction with the Internet Protocol,
Transmission Control Protocol, and User Datagram Protocol (UDP). Libraries
implementing sockets for Internet Protocol use TCP for streams, UDP for
datagrams, and IP itself for raw sockets.
To communicate over the Internet, IP socket libraries use the IP address to
identify specific computers. Many parts of the Internet work with naming services, so that
the users and socket programmers can work with computers by name (e.g.,
"thiscomputer.compnetworking.about.com") instead of by address (e.g.,
208.185.127.40). Stream and datagram sockets also use IP port numbers to distinguish
multiple applications from each other. For example, Web browsers on the Internet know
to use port 80 as the default for socket communications with Web servers.

3.2.3.5. Socket Programming

Traditionally, sockets have been of interest mainly to computer programmers. But


as new networking applications emerge, end users are becoming increasingly

17
network-savvy. Many Web surfers, for example, now know that some addresses
in the browser look like http://192.168.0.5:80/ where 80 is the port number being
used by that socket.

The socket APIs are relatively small and simple. Many of the functions are
similar to those used in file input/output routines such as read(), write(), and
close(). The actual function calls to use depend on the programming language
and socket library chosen.

18
4. D.A.U. and processing unit.

Plx Daq is used for loggin real time data from the bowler to excel format.
Raspberry pi application which is based on linux raspbian operating system was
written in C language in this we used 7 different stages of cricket:

Authentication: It will call all the people by email and messaging Lets
play cricket which are registered in the enumerated block. Also the song
Chalo Bulawa aaya hai will be played.

Welcome: In this stage the cricket is triggered by a toss. From this stage
the player can go to either toss win stage or toss loss stage as per the
movement of the accelerometer. The message will be sent to the
registered user via smtp protocol.

19
Toss Win: In this stage the song will be played jay ho, and player has
the chance to do batting first. In batting mode the data from the boller is
discarded and batsman data is taken from the TCP request at
192.168.0.5. If the batsman played a Seep Shot . then it will jump to
sweep shot stage.

Toss Loss: In this Bade chalo song wil be played and sms and email
will be sent to the registered user. Battsman data is discarded and bowler
reading are taken from zigbee wireless module. When bowler detects spin
it will go to spin stage.

Spin: In this stage the new song will be played and after next stage is set
to Game Over.

Shot: In this stage the new song will be played and after next stage is set
to Game Over.

Game Over: All uninitialization take place here and email is sent meet
again.

XBee Configuration:

Table 13-2: Comparison of XBee Models

PROTOCOL/
XBEE NAME TOPOLOGY DESCRIPTION
Series 2 ZigBee/Mesh Standardized and interoperable with other vendor
ZigBee solutions. This model supports AT and API modes.
There must be one coordinator in each network.
Coordinators and routers cannot sleep.
Series 1 802.15.4/ Good point-to-point and point-to-multipoint
802.15.4 Multipoint support.
Series 1 DigiMesh/Mesh Uses firmware to implement proprietary mesh
DigiMesh networking on Series 1 modules. Only one type of
node is required.

20
Once you have XBee devices, the first step is to configure them using your
desk-top computer and a device such as the SparkFun XBee USB Explorer,
which is illustrated in Figure 13-8(b). The most intuitive way to configure an
XBee device is to use the XCTU software platform from Digi.

XCTU:
XCTU is a full-featured GUI-based confguration platform for XBee devices
that is provided by Digi. It can discover modules that are attached to your
desktop computer using the XBee USB Explorer, as illustrated in Figure 13-
9(a), and confgure the network properties, such as the PAN ID, as
illustrated in Figure 13-9(b). XCTU is available for free on Windows, MacOS
X, and Linux. You can download it from www.digi.com/xctu

Figure 13-9: The Digi XCTU software: (a) device discovery using an XBee USB adapter, and (b) the
device configuration window.

Configuring an XBee Network Using XCTU:

The first thing you should do with XCTU is to update the XBee modules to the
latest firmware. Click the Update Firmware button (see Figure 13-9b) and then
choose the product family, function set, and firmware version. There are different
firmware versions depending on whether you are using AT or API mode, and
21
whether you are setting up a coordinator, router, or end device. These options
are described throughout this section.
To configure an AT or API-based network, you must set a PAN ID. The personal
area network ID is a 16-bit address that allows you to configure a set of XBee
devices to be on the same network. This network ID facility allows you to create
multiple networks of devices that are independent from each other, even at the
same physical location. To establish a network, ensure that all of the devices
have the same PAN ID.
The two examples that follow provide step-by-step instructions on
configuring XBee devices in AT and API mode. Each example identifies and
utilizes different firmware versions, which necessitates the use of XCTU in
reprogramming the firmware of the devices.

(a) (b)

Figure 13-11: Configuring the Arduino XBee to connect to the RPi XBee Device: (a) the RPi XBee,
and (b) Arduino XBee XCTU settings.

22
Figure 13-12: (a) The XBeeA circuit configuration, and (b) the XBeePi circuit configuration

An XBee API Mode Example:-

Unfortunately, XBee AT mode does not provide access to the advanced


features that are available on a ZigBee device. In the last example, the
source and destination points are manually configured for the two devices.
XBee API mode uses data frames, each with a software-configurable
address that allows other modules in API mode to selectively receive the
data.

Setting Up the RPi XBee Device (XBee1):-


In this section two identical XBee S2 ZigBee devices are configured into
API mode by writing new firmware to them. As illustrated in Figure 13-14,
XBee1 is configured as a ZigBee Coordinator (API mode), and XBee2 is
configured as a ZigBee Router (API mode). In this example, the coordinator
is attached to the RPi, but the XBee router is utilized as a standalone
microcontroller, as illustrated in Figure 13-15.

23
Figure 13-14: (a) Configuring XBee1 as a coordinator with PAN ID 1234, and (b) configuring XBee2 as a
router with PAN ID 1234

The PAN ID is set to 1234 for both devices. Once the PAN ID is set for XBee1, it
can be disconnected from the XBee USB Explorer and attached to the RPi, as
illustrated in Figure 13-15(a).

Setting Up the Standalone XBee Device (XBee2):-

The XBee2 can be placed in the XBee USB Explorer and programmed with
ZigBee router frmware. A scan can then be performed by clicking the Wireless
Scan for Devices button (as identifed in Figure 13-14(b)). The XBee1 coordinator
device that is attached to the RPi should be detected, and because the devices
are both in API mode, it is possible to wirelessly change the settings on the
XBee1 device.
In this example, the XBee2 router device is not attached to an Arduino; rather, it
is used as standalone microcontroller, as illustrated in Figure 13-15(b).

Figure 13-15: (a) The XBee1 RPi coordinator circuit, and (b) the standalone XBee2 router circuit
with sample I/O connections

24
5.Conclusion and Future Enhancements
Use of mCricket in Other Sports:-

The advantage of this device is that it is not attached to sports gear. All
the post-processing is done in PC software. So with update of PC
Software this device can be used in almost any sports which involve
physical activities. This will definitely involve advance processing of data
but the challenge will remain there scope of huge exploitation of big
market potential. Below Table list the sports and possible information
derivation from sensors data.

Cricket is fourth-largest sporting event in the world in terms of viewership. It is


watched by an estimated quarter of the world's population - an audience of over
two billion. Around the world people are exploring IOT application in home

25
automation, health care and some other domains. But Sports can be one big
game changer in IOT. Some companies have designed implanted Tennis Racket
and also some other sports products. But none has reached mass market
adaptation. The mCricket can be a new initiative that can be a Mass Market
Device. Today this product is in demonstration stage only. But with support of
CDACs R&D and Devices this can be a reality. CDAC can be pioneer in this field
with introduction of this Innovative product and reap FMA.

Lets play mCricket

26
6.References

1) www.extreme electronics.com

2) ZigBee/IEEE 802.15.4 Summary, http://www.zigbee.com .

3) Various authors, ZigBee Specifications, ZigBee Alliance, 14 December 2004.

4) ZigBee Alliance, http://www.caba.org/standard/zigbee.html .

5) Singh, R.; Mishra, S.; Joshi, P. "Pressure monitoring in wireless sensor network
using ZigBee transceiver module", Computer and Communication Technology
(ICCCT), 2011 2nd International Conference on, On page(s): 225 229

6) Anthony Faustine etal, Wireless Sensor Networks for Water Quality Monitoring
and Control within Lake Victoria Basin: Prototype Development, Scientific
research, Wireless Sensor Network, 2014, 6, 281-290

7) Rajesh Singh etal, Temperature monitoring in wireless sensor network using


ZigBee transceiver module, Power, Control and Embedded Systems (ICPCES),
2010 International Conference, Nov. 29 2010-Dec. 1 2010, On page(s): 1 4.

8) Teja, G.N.L.R. etal, Land Slide detection and monitoring system using wireless
sensor networks (WSN), Advance Computing Conference (IACC), 2014 IEEE
International, 21-22 Feb. 2014,On pages: 149 154.

9) Choudhury, S. ; Singh, R. etal, ARM based real time video streaming using Xbee
for perimeter control in defense application, Computing for Sustainable Global

27
Development (INDIA Com),2014 International Conference, 5-7 March 2014,On
pages: 943 947.

10) Luis M. L. Oliveira etal, Wireless Sensor Networks: a Survey on Environmental


Monitoring, Journal of Communications, VOL. 6, NO. 2, April 2011, on pages:
143-151.

11) M. Anwander, G. Wagenknecht, T. Braun, and K. Dolfus. BEAM: A Burst-


Aware Energy-Efficient Adaptive MAC Protocol for Wireless Sensor Networks.
In Seventh International Conference on Networked Sensing Systems (INSS10),
pages 195 202, Kassel, Germany, June 2010.

12) Anwar and L. Lavagno. Energy and Throughput Optimization of a Zigbee-


Compatible MAC Protocol for Wireless Sensor Networks. In Seventh
International Symposium on Communication Systems Networks and Digital
Signal Processing (CSNDSP10), pages 305 310, Newcastle upon Tyne,
England, July 2010.

13) L. Barardo, R. Oliveira, M. Pereira, M. Macedo, and N. De Lisboa. A Wireless


Sensor MAC Protocol for Bursty Data Traffic. In The 18th IEEE International
Symposium on Personal Indoor and Mobile Radio Communications (PIMRC07),
pages 1 5, Athens, Greece, September 2007.

14) M. Buettner, G. Yee, E. Anderson, and R.Han. X-MAC: A Short Preamble MAC
Protocol for Duty-Cycled Wirelesss Sensor Networks. In The Fourth International
Conference on Embedded Networked Sensor Systems (SenSys06), pages 307
320, Boulder, CO, November 2006.

15) J. Burrell, T. Brooke, and R. Beckwith. Vineyard Computing: Sensor Networks in


Agricultural Production. Pervasive Computing, 3(1):38 45, 2004.

28

Anda mungkin juga menyukai