Technical Report
2021
Internship in Computer
Networks Lab
GROUP MEMBERS:
ABDUL KABIR AHMAD -)
SAMAN BATOOL -)
SAMIULLAH -
BATTERY STATISTICS EXTRACTION USING WEB PAGE
⁘ Experiment: Dynamic Behavior of Sensors / Instruments ⁘
⁘ Objective:
To design experiment for analysis of the charging behavior of laptop and cellphone’s battery
using Web page and to observe other parameters and determination of sources of errors.
⁘ Apparatus:
Visual studio code
Devices:
Laptop (Lenovo).
Cell phone (Redmi Note 9)
⁘ Procedure:
Coding has been done in visual studio code webpage has been developed using navigator.
Get library which would be used to get the charging status and level of the battery. Code is
given below. variation in battery level with time (charging , discharging patterns, time date
) can be seen from the table .First phone and laptop was discharged to 0% then we start
charging it ,restart it and turn on visual studio code open live server with out opening any
app in background we just record data and then click button to get excel file is then imported
to laptop and further analysis is done on excel.
Code:
1. https://drive.google.com/drive/folders/1-lrumJcQWQy1ut3lvfOnspKqN3xfprc?usp=sharing
2. https://drive.google.com/drive/folders/16UdODz_A1WWPFt7rVAGeC8W7UYbxigq
W?usp=sharing
GUI:
1|Page
Table:
2|Page
3|Page
4|Page
5|Page
Recorded data using Laptop:
TIME
22:09:55
22:11:05
22:13:12
22:14:05
22:15:37
22:16:50
22:18:12
22:19:52
22:21:15
22:22:30
22:23:49
22:25:32
22:26:51
22:28:08
22:29:38
22:31:11
BATTERY
LEVEL-|Page
22:32:30
22:33:46
22:35:11
22:36:51
22:38:01
22:39:34
22:40:51
22:42:15
22:43:40
22:45:11
22:46:25
22:48:07
22:49:11
22:50:51
22:52:03
22:53:32
22:55:11
22:56:24
22:57:44
22:59:11
23:00:51
23:02:00
23:03:34
23:04:51
23:06:09
23:07:42
23:09:11
23:10:24
23:11:48
23:13:14
23:14:51
23:16:03
23:17:38
23:18:51
23:20:30
23:21:42
23:23:11
23:24:26
23:26:08
23:27:32
23:28:51
23:30:07
23:31:38
-|Page
23:33:11
23:34:24
23:35:44
23:37:11
23:38:51
23:40:11
23:41:34
23:42:51
23:44:29
23:45:40
23:47:11
23:48:24
23:49:47
23:51:11
23:52:51
23:54:03
23:55:36
23:56:51
23:58:30
23:59:42
0:01:11
0:02:30
0:04:12
0:05:36
0:07:11
0:08:51
0:10:30
0:12:20
0:14:21
0:16:30
0:19:11
0:22:05
0:25:12
0:28:51
0:33:12
0:38:28
0:45:12
0:53:12
-
Graph:
8|Page
Charging behavior of Laptop Battery is linear in our case it is following equation y=x+3
ASSUMPTIONS:
•
•
•
•
•
•
•
First order system with one pole.
No background app running.
Battery as not a battery consumer app.
Temperature is constant.
No effect of time and spatial variations on charging behavior.
Resistance or losses due to charger are considered negligible.
Phone is in good condition (battery health Is good).
Sources of Errors:
•
•
•
•
•
•
•
Temperature does not remains constant.
Battery health is not known properly.
Some applications consume battery in background even if they are not opened.
Environmental conditions also cause errors.
Due to charger, old charger will also cause errors.
Fast charger.
As no app is error free, so battery log is also source of error.
How to minimize errors:
9|Page
•
•
Repeating experiment and considering average value may reduce errors.
Phone with minimum apps or all the apps which without being used consume battery
as they are always running in background will be turned off to get better results.
I.
II.
LOCATION TRACKING USING WEB PAGE
FOOT STEP COUNTER USING WEB PAGE
Objective:
To design experiment which gives track of location and displaying it on web page.
⁘ Apparatus:
Visual studio code
Devices:
Laptop (Lenovo).
Cell phone (Redmi Note 9).
Code:
10 | P a g e
11 | P a g e
WEB PAGE:
12 | P a g e
However, this API never runs on phone due to android encryption.
Accelerometer Api:
Code:
13 | P a g e
14 | P a g e
GUI:
As browser in phone doesn’t allow accelerometer to extract values of coordinates using this
API so further processing was paused here.
I. ANALYZING AND OBSERVING AUDIO SIGNAL IN OSCILLOSCOPE USING
AUX-CABLE
II.
ENCODING AND DECODING MESSAGE SIGNAL AT TRANSMITTER
AND RECIEVER
15 | P a g e
I.
ANALYZING AND OBSERVING AUDIO SIGNAL IN OSCILLOSCOPE
USING AUX-CABLE
Connect one side of aux cable with Laptop and other to the oscilloscope open
online tone generator (Online Tone Generator - generate pure tones of any frequency
(szynalski.com)). And set frequency click on play button start analyzing signal on
oscilloscope. For different shaped waves.
On setting (Sine wave @ 388 Hz)
Analysis:
16 | P a g e
Exact Sine wave is retrieved with frequency 387.9 Hz.
On setting (Square wave @ 1458 Hz)
Analysis:
Exact square wave is not observed Gibbs Phenomenon is observed over here and we
can’t observe upward and downwards straight lines as capacitors rime to charge.
17 | P a g e
So overall time the capacitor needs to charge in our case is 32.21 us.
II.
ENCODING AND DECODING MESSAGE SIGNAL AT TRANSMITTER
AND RECIEVER
Design a Matlab GUI for transmission of message signal and reception of that transmitted signal
at receiver’s end.
For this follow the steps mentioned below.
At Transmission End:
1. Write a matlab code which convert an English alphabet to a binary vector. For
verification of code, convert message text such as Ali to binary vector. Output would
look like this.
2. Write code for BFSK modulation which convert the above binary vector to a signal and
transmit this signal through laptop speaker in the form of voice.
(hint: BFSK modulation is digital modulation technique which convert a binary vector to
a signal. By assigning two different frequencies to 0 and 1. For example Let 10Hz is
assign for bit 0 and 100Hz is assign for bit 1 then if we want to convert the vector [1 0 1 0
1] its BFSK signal should be like this
18 | P a g e
This figure clearly shows the binary vector the first sinusoid representing bit 1 which
have frequency of 100Hz and the second sinusoid representing bit 0 and so on.
3. Now using sound command in MATLAB transmit this signal through laptop speaker in
the form of Audio.
4. Now Make a MATLAB GUI by using ‘guide’ command in MATLAB’s command
window.
The GUI should be look like this.
At Reception End:
1. In order to receive the above transmitted signal, firstly record the transmitted signal with
the help of audio recorder command.
2. Get the recorded signal stored in some variable, play it again at receiver’s side for
confirmation whether signal retrieved is same as transmitted or not.
3. Now we have to convert this recorded signal to binary vector again which should be same
as the binary vector at transmitted side.
19 | P a g e
Hinit: Code for this step. (The recorded signal is stored in variable X. and converted to
binary vector)
4. Write code for conversion of this binary vector to an English alphabet and hence the
transmitted message is retrieved.
for further hints/tips use the link given below:
20 | P a g e
https://www.mathworks.com/help/signal/ug/practical-introduction-to-time-frequencyanalysis.html
5. Exemplary GUI at reception End.
TWITTER API:
Sentiment comparison engine:
Using NLP (Natural Language Processing) and Twitter API we build a sentiment
comparison program.
WORKING:
1. First, a user will input two keywords, e.g., Facebook and Instagram.
2. We will then download the latest, real-time tweets relating to those two keywords
using the Twitter API.
3. Next, we will use the Text Blob library for calculating the tweets'
sentiments (NLP part). This tells us how people feel about our specified keywords at
this moment in time!
5. Lastly, our program compares the scores of the two keywords and tells us what
thing people feel more positively about RIGHT NOW!
Code:
21 | P a g e
22 | P a g e
Output:
23 | P a g e
24 | P a g e
25 | P a g e