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

LP-IV Lab Manual

This document provides assignments for a pervasive computing laboratory course. It includes 5 assignments from Group 1 and 1 mini project from Group 2. Group 1 assignments include developing an indoor library positioning system using a mobile device, designing a remote health monitoring application, developing a parking availability application, and developing an activity recognition application for Android. Group 2 involves designing and building a sensing system using a microcontroller like Arduino or Raspberry Pi to sense the environment and trigger actuators.

Uploaded by

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

LP-IV Lab Manual

This document provides assignments for a pervasive computing laboratory course. It includes 5 assignments from Group 1 and 1 mini project from Group 2. Group 1 assignments include developing an indoor library positioning system using a mobile device, designing a remote health monitoring application, developing a parking availability application, and developing an activity recognition application for Android. Group 2 involves designing and building a sensing system using a microcontroller like Arduino or Raspberry Pi to sense the environment and trigger actuators.

Uploaded by

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

410247 : Laboratory Practice – IV

Pervasive Computing

By,
Prof. R. L. Paikrao,
Head of Department, Computer Engineering
Amrutvahini College of Engineering, Sangamner
(These are suggested assignments however faculty member can also
choose different but related practical assignment)
Assignments to be covered

Five assignments from Group – 1

One mini project from Group - 2


Group - 1
1. Develop an indoor location/positioning system to Library guide system where it
can direct a user to the bookshelf from a mobile device.

What is Indoor Positioning System (IPS)?


• An Indoor Positioning System (IPS) is a network of devices used to locate people or
objects.

•  GPS and other satellite technologies lack precision or fail entirely, such as inside
multistory buildings, airports, alleys, parking garages, and underground locations.

• A large variety of techniques and devices are used to provide indoor positioning
ranging from reconfigured devices already deployed such as:
- smartphone inbuilt sensors, WiFi, WiMax, ZigBee, Bluetooth antennas etc.
Continued…

• Students have to develop an Android application which will search for the
required book on website and once he clicks on show direction button,
App should show a complete path to reach to specific rack/cupboard
where that book is placed.
• Additionally all navigations (Left/Right/Straight) must be shown to the
user.
• Extra features like voice based assistance, can be added.
Continued…
• The book search is to take place on the smartphone with the website
offered by the library.
• Afterwards the way to the book is to be represented on a map.
• It is much easier for the user to use his own smartphone because he is
familiar with it and does not have to find his way into a custom
development
Tasks to do:
Here, the presentation of a website, extraction of desired data, linking to a
database containing information between semantic and topological
information of the book, localization and tracking of the smartphone and
presentation of the route and the environment on a map are used.
Sample workflow of a system

Sensors required: Accelerometer (implement a step counter), Gyroscope


(for rotations) and a Barometer(Vertical calculations – e.g. steps climbed)
available in any Cell phone.
Continued…
1. The user searches for the desired book via a web interface which is integrated in the
application.
2. We can use JavaScript code to select the details of the borrowable books.
3. Once a details are identified, the appropriate routing node can be searched for using an SQL
query.
4. The user is then asked to initialize his starting point. This is done by scanning a QR code with a
camera. This contains the location information (position and elevation coordinates and
orientation of the smartphone).
5. A routing is now calculated with the help of the two nodes. For this case the Dijkstra’s
algorithm can be used, where each following node after the current get a weighting, based on
its distance to the current node.
6. The next node picked is the one with the lowest weight.
7. This continues until the destination is found. As soon as the routing is known, the user is
shown the corresponding route in a map
2. Design a pervasive application in which remote computer monitors our health
statistics & will determine when one is in trouble & will take appropriate action for
rescue.

What is Remote Patient Monitoring?


• It is also called as Telemonitoring
• In remote monitoring, the medical professional monitors the emergency cases of
patients remotely, as well as provides real-time data analysis and instant feedback
to patients.
• The domain of remote monitoring includes studies that are categorized in three
areas:
 Patient triage/casualties
 Provision of services to the patient
 Patient prioritization.
Continued…
Continued…
• Tasks to do:
1. Students should be able to interface various sensors such as Oxygen
level, temperature system, blood pressure sensor, EEG /ECG/EMG
signal.

2. Sensors collect the data which is further passed to communication


layer.

3. Further analytics are made on the data and decision is taken by


doctor.
3. Develop an Android application in which car will use the Internet to find
nearby open parking space

• Car parking has become a serious issue in today's congested areas due to a
lack of parking facilities.
• In most metropolitan places, finding a parking spot is extremely tough and
irritating, especially during rush hour.

• Here, students have to develop an Android Application that will allow the
user to view various parking spots as well as determine whether parking
space is available or not. If the space is available, he/she can reserve it for
a certain time frame.
Continued…
• Step 1: User has to do one time registration in the mobile application. Registration requires the
following details name, mobile number, number plate text. Username and password is also
required.

• Step 2: The Users can view the parking slot and book the slots for parking.

• Step 3: Users can set the time for the slot while booking.

• Step 4: The slot will be reserved until the user parks the vehicle. If the user fails to park the
vehicle in the allotted time then the park will be marked vacant.

• Step 5: Once the user parks the vehicle timer starts and timer ends when he/she leaves the slot.

• Step 6: Payment will be on the basis of the parked time period.

• Step 7: Payment can be done by online transaction or using RFID tags


Sample Snapshots
Continued…

Tasks to do:
 Android Application Development
 Interfacing of RFID with Microcontroller
 NodeMCU module programming
 SMPS for power supply
 WiFi module ESP8266 interfacing with Microcontroller
 Bluetooth Interfacing
4. Android User Activity Recognition – Still, Walking, Running, Driving etc.

• Nowadays, everyone is having smartphones, and we use them to do our day to


day lives.
• The best part of Android applications that are present in mobile phones is that
these applications try to know their users more and more.
• Today, many of the applications are taking locations of the users to give a location
related feeds to the users. One common example of this can be a normal news
application, where the app takes your current location and presents the news
according to the location.
• To give your users a better experience of the application, we have to understand
our users in a better way.
• We should know what our users are doing at any instant of time.

• The more we know about our users the better application we can build for our
users. So, here student should develop an Android application that uses this
Activity Recognition of the users.
Continued…
We have to constantly communicate with the sensors of the mobile and after
collecting the data, we have to use some Machine Learning algorithm to find which
activity the user is currently doing. 

What we need to know about is,


Activity Recognition Client and the API will do the rest for you.

The Activity Recognition Client returns a list of activities that a user might be doing
with some confidence percentage. This confidence percentage tells you about the
surety of the activity.

For example, the activity which is having more than 75% confidence, then there is a
probability that the user might be doing that activity. So the confidence parameter
tells you the probability of an activity being done by the user.
Activities detected by the Activity Recognition Client
• STILL: When the mobile device will be still i.e. the user is either sitting at some place or the mobile device is
having no motion, then the Activity Recognition Client will detect the STILL activity.

• ON_FOOT: When the mobile device is moving at a normal speed i.e. the user carrying the mobile device is
either walking or running then the Activity Recognition Client will detect the ON_FOOT activity.

• WALKING: This is a sub-activity of the ON_FOOT activity which is detected by the Activity Recognition Client


when the user carrying the mobile device is walking.

• RUNNING: This is also a sub-activity of ON_FOOT activity which is detected by the Activity Recognition Client
when the user carrying the mobile device is running.

• IN_VEHICLE: This activity detected when the mobile device is in the bus or car or some other kind of vehicle
or the user holding the mobile device is present in the vehicle.

• ON_BICYCLE: When the device is on the bicycle or the user carrying the mobile is on a bicycle then this
activity will be detected.

• TILTING: When the mobile device is being lifted and is having some angle with the flat surface then the
Activity Recognition Client will detect this activity.

• UNKNOWN: The Activity Recognition Client will show this result when the device is unable to detect any
activity on the mobile device.
5. Design and build a sensing system using micro-controllers like - Arduino /
Raspberry Pi / Intel Galileo to sense the environment around them and act
accordingly.

Basically, here we are going to write a code to sense any event in the surrounding
and then actuator will take further action on it. It can be as simple as temperature
sensing system as illustrated below:

An IoT device is made up of a Physical object (“thing”) + Controller (“brain”) +


Sensors + Actuators + Networks (Internet).

An actuator is a machine component or system that moves or controls the


mechanism or the system.
Continued…
• Students can sense any parameter and actuator will take suitable action
accordingly.
• Following are few example:
– Fire detection System
– Auto lighting based on intensity level of light in room.
– LPG leakage detection
– Checking water level in tank on roof
– Auto watering system to plants
– Noise detection
– Air Quality Monitoring & many more
6. Smart Mobile Application with orientation sensing for users to put the phone in meeting / silent
mode- OR- outdoor/ loud mode based on the orientation of the device.

Students should develop an Android application that can be used to set silent mode,
ringer mode, and vibrate mode based on orientation of Android phone.

Requirements:
 Android Studio version 2.3.3
 Little bit XML and Java knowledge.
 Android Emulator (or) Android mobile
What is orientation of phone?

• How does that happen?


How does your smartphone know up from down?
After all, it has no ‘real’ sense of its own orientation, right?

Thanks to a device called an accelerometer.


An accelerometer is a device that measures the proper acceleration or ‘g-
force’ at a given point.
Continued…
Tasks to do:
• Handle the device orientation events.
• The device orientation event fires when the device moves or changes
orientation. It returns data about the difference between the device in its
current position in relation to the Earth Coordinate Frame.
• Based on the type of orientation phone must be put on
ringer/silent/vibrate mode.
Group -2
7. Mini project: Develop Food Ordering System which uses the GPS of an Android-
based Smartphone to record and analyze various locations that could give alert to
the user, then asking the user to select particular food from given hotel list and place
an order.

In this Food Ordering System project, we use the GPS of an Android-based


Smartphone to record and analyze various locations that could give alert to the user,
then asking the user to select particular food from given hotel list and place an order.

Features:
• Uses the GPS from Android mobile to match the current location.
• Automatically sends a message for Order once it is placed.
• Displays on the Screen a message.
8. Mini Project : Design a mobile sensing platform mounted on a glove that
integrates several sensors, such as touch pressure, imaging, inertial measurements,
localization and a Radio Frequency Identification (RFID) reader for fruit classification
and grading system.

• Wearable computing is a form of ubiquitous computing that offers flexible and


useful tools for users. Specifically, glove-based systems have been used in the last
30 years in a variety of applications, but mostly focusing on sensing people’s
attributes, such as finger bending and heart rate.
• Students have to design a glove which can be used to analyze and measure
attributes of fruits by just pointing or touching them with the proposed glove.
410247 : Laboratory Practice – IV

Information Retrieval

By,
Prof. R. L. Paikrao,
Head of Department, Computer Engineering
Amrutvahini College of Engineering, Sangamner
1. To compute similarity between two text documents

• Computing the similarity between two text documents is a common task in


NLP, with several practical applications.
• It has commonly been used, for example - rank results in a search engine or
recommend similar content to readers.
• Compute similarity based on meaning, we call it semantic text similarity.
Traditional text similarity methods only work on a lexical level, that is, using
only the words in the sentence.
• The common way of doing this is to transform the documents into TF-IDF
(Term Frequency-inverse Document Frequency) vectors and then compute the
cosine similarity between them.
Continued…

Sentence 1: AI is our friend and it has been friendly


Sentence 2: AI and humans have always been friendly
2. Page Rank Algorithm

• PageRank is one of the methods Google uses to determine a page’s


relevance or importance.
• Page rank is important because it's one of the factors a search engine like
Google takes into account when it decides which results to show at the top
of its search engine listings – where they can be easily seen.
• It is a “vote”, by all the other pages on the Web, about how important a page
is. A link to a page counts as a vote of support. If there’s no link then there’s
no support.
Continued…

• The PageRank of a web page is calculated as a sum of the PageRanks of all


pages linking to it(its incoming links), divided by the number of out links on
each of those pages(its outgoing links).
• PR (A) = (1-d) + d (PR (t1) / C (t1) + … + PR (Tn) / C (Tn))

Where,
- PR(A) = the pagerank of your page A

- d = damping factor (The probability, at any step, that the person will
continue with the same page is a damping factor d) which is usually 0.85

- ‘t1-in’ = pages linking to page A

- C = outbound links
3. Pre-processing of a Text Document: stop word removal

 Text pre-processing is the process of preparing text data so that machines can use the
same to perform tasks like analysis, predictions, etc.
 Stop words are actually the most common words in any language that does not add
much information to the text.
 Objective - By removing these words, we remove the low-level information from our text
in order to give more focus to the important information.
 For example -
Continued…
Different libraries for StopWord Removal:

1. Natural Language Toolkit (NLTK):

• NLTK is an amazing library to play with natural language. When you will start your NLP

journey, this is the first library that you will use.

2. spaCy:

• spaCy is an open-source software library for advanced NLP. This library is quite popular now

and NLP practitioners use this to get their work done in the best way.

3. Gensim:

• Gensim (Generate Similar) is an open-source software library that uses modern statistical

machine learning. 

4. Scikit-Learn:

• Scikit-Learn needs no introduction. It is a free software machine learning library for Python. It

is probably the most powerful library for machine learning.


4. Map-reduce technique to count the number of occurrences of each
alphabetic character in the given dataset.

• MapReduce is used by Google for much of their processing of large data sets

• In MapReduce char count example, we find out the frequency of each


character. Here, the role of Mapper is to map the keys to the existing values
and the role of Reducer is to aggregate the keys of common values. So,
everything is represented in the form of Key-value pair.

• How it Works
o Map. The input data is first split into smaller blocks.
o Reduce. After all the mappers complete processing, the framework
shuffles and sorts the results before passing them on to the reducers. ...
o Combine and Partition.
Continued…

- Hadoop Framework -
5. Simple web crawler

• A crawler, or spider, is an internet bot indexing and visiting every URLs it


encounters. Its goal is to visit a website from end to end, know what is on
every webpage and be able to find the location of any information. The most
known web crawlers are the search engine ones, the GoogleBot for example.

• Steps to build a crawler:


Step 1: Add one or several URLs to be visited.
Step 2: Pop a link from the URLs to be visited and add it to the Visited
URLs thread.
Step 3: Fetch the page’s content and scrape the data you’re interested
in with the ScrapingBot API.
Step 4: Parse all the URLs present on the page, and add them to the
URLs to be visited if they match the rules you’ve set and don’t
match any of the Visited URLs.
Step 5: Repeat steps 2 to 4 until the URLs to be visited list is empty.
6. Parse XML text, generate Web graph and compute topic specific page.

• Parsing means to read information from a file and split it into pieces by
identifying parts of that particular XML file. Let’s move on further to see how
we can use these modules to parse XML data.
• For example:
Continued…
XML Parsing Modules
1. SAX:
• It is a module that means simple API for XML

2. DOM:
• It stands for document object module. It has all the features of XML
and works by storing data in hierarchical form. This module is used
mainly when dealing with large data as it is faster.

3. ElementTree:
• This module helps us store the data in the XML document in the tree
structure, showing in a hierarchical format. We can parse data, find
elements and also modify the data.

You might also like