Escolar Documentos
Profissional Documentos
Cultura Documentos
HOME MONITORING
By
Jayanth
Alangar
Gene
Shiue
Tam
Tran
7
May
2015
Project
No.
28
Abstract
The
Thermal
Home
Monitoring
project
provides
homeowners
with
a
surveillance
system
that
will
involve
a
thermal
live
feed,
human
counting
and
an
Android
application
for
use.
Home
owners
will
be
able
to
view
(on
their
Android
phone)
how
many
people
are
in
each
room,
what
the
room
will
look
like
on
a
thermal
camera
and
will
only
need
one
outlet
to
power
the
system.
In
this
project,
we
find
that
this
thermal
home
monitoring
project
can
count
up
to
two
people
within
a
room
at
a
time,
and
the
data
and
camera
live
feed
can
be
viewed
on
an
Android
application.
ii
Table
of
Contents
1.
Introduction
.............................................................................................................................................
1
1.1
System
Block
Diagram
....................................................................................................................
1
1.2
Block
Descriptions
..........................................................................................................................
2
1.2.1
Power
Supply
..........................................................................................................................
2
1.2.2
Thermal
Camera
......................................................................................................................
2
1.2.3
myRIO
......................................................................................................................................
2
1.2.4
Raspberry
Pi
............................................................................................................................
2
1.2.5
Android
Application
................................................................................................................
2
2
Design
...................................................................................................................................................
3
2.1
Power
Supply
.................................................................................................................................
3
2.1.1
Schematics
..............................................................................................................................
3
2.1.2
Calculations
.............................................................................................................................
4
2.1.3
Simulations
..............................................................................................................................
5
2.2
Thermal
Camera
.............................................................................................................................
6
2.3
DSP
.................................................................................................................................................
6
2.3.1
Training
the
Classifier
..............................................................................................................
6
2.3.2
Alternative
Method
for
Human
Detection
..............................................................................
6
2.3.3
Detection
Implementation
......................................................................................................
6
2.4
Raspberry
Pi
...................................................................................................................................
7
2.5
Android
App
...................................................................................................................................
8
3.
Design
Verification
............................................................................................................................
11
3.1
Power
Supply
...............................................................................................................................
11
3.2
myRIO
...........................................................................................................................................
11
3.3
Raspberry
Pi
.................................................................................................................................
12
3.4
Android
App
.................................................................................................................................
12
4.
Costs
..................................................................................................................................................
13
4.1
Parts
.............................................................................................................................................
13
4.2
Labor
............................................................................................................................................
13
4.3
Total
Cost
.....................................................................................................................................
14
5.
Conclusion
.........................................................................................................................................
15
iii
Appendix B
Appendix C
iv
1.
Introduction
Current
home
monitoring
systems
lack
capabilities
of
providing
meaningful
data
to
the
user
other
than
them
just
looking
at
a
camera
feed.
With
the
use
of
a
thermal
camera
in
a
home
monitoring
system
along
with
an
application
of
human
detection
algorithms,
a
user
can
get
information
that
they
find
useful,
such
as,
where
their
children
are
and
what
they
are
doing.
The
way
the
user
can
access
this
data
via
the
Internet
is
through
an
Android
developed
phone
application.
1.1
Figure
1:
Block
Diagram
of
Implemented
System
1.2
Block Descriptions
The
project
consists
of
several
modules,
with
each
of
these
modules
integrated
together
to
form
the
final
product.
This
section
describes
each
of
the
individual
modules.
1.2.1
Power
Supply
The
power
circuit
consists
of
AC/DC
and
DC/DC
converters
to
provide
a
steady
voltage
source
at
different
levels
for
the
thermal
camera.
Isolation
was
included
as
a
protection
mechanism.
1.2.2
Thermal
Camera
This
module
serves
as
the
image
capture
for
the
project.
Its
responsible
for
capturing
thermal
images
of
a
room.
The
camera
will
capture
an
image
and
send
it
to
the
Raspberry
Pi,
which
will
be
sent
to
the
myRIO
for
processing.
The
camera
will
be
powered
by
the
power
supply.
1.2.3
myRIO
This
block
serves
to
perform
the
human
detection
algorithms.
The
myRIOs
tasks
are
to
receive
an
image
from
the
Raspberry
Pi,
process
the
image
to
detect
any
humans,
and
then
to
output
a
text
file
stating
how
many
humans
are
in
the
image.
1.2.4
Raspberry
Pi
This
module
works
as
a
server
of
the
project.
It
is
responsible
for
transferring
images
taken
from
the
thermal
camera
to
our
Android
app
and
myRIO,
storing
computed
data
from
the
myRIO,
keeping
track
of
user
settings
specified
from
the
Android
app,
and
sending
out
email
notifications
to
users
if
needed.
1.2.5
Android
Application
This
block
is
the
user
interface
of
the
project.
It
allows
our
users
to
add
and
remove
rooms,
set
thresholds
for
different
rooms,
specify
users
email
addresses
to
receive
notifications,
and
most
importantly
view
information
about
users
rooms.
The
users
will
be
able
to
use
these
functionalities
over
the
Internet.
Design
This
section
will
discuss
the
design
procedures
that
were
taken
throughout
the
project.
Once
again,
the
sections
will
be
split
into
each
module
that
was
described
in
the
block
diagram.
2.1
Power Supply
An
integral
part
of
the
power
supply
design
is
converting
the
120
Vac
from
a
wall
outlet
to
the
different
DC
voltage
levels
that
the
camera
needs.
This
section
will
discuss
the
mechanism
by
which
this
was
solved.
2.1.1
Schematics
In
order
to
begin
producing
the
necessary
voltage
levels,
a
wall
adapter
was
used
to
convert
the
120
Vac
to
5
Vdc
to
remove
current
spikes
[1].
From
this
5
Vdc
level,
a
buck
converter
was
used
to
take
the
voltage
down
to
the
necessary
level
of
3.3
V
[2].
The
buck
converter
is
shown
in
Figure
2.
Figure
2
shows
the
generic
components
for
the
passives
within
the
buck
converter.
We
will
discuss
the
true
values
of
these
components
in
the
following
section.
Also
in
Figure
2,
the
MOSFET
is
treated
as
a
switch,
used
to
connect
5
V
to
rest
of
the
circuit.
We
were
able
to
control
the
MOSFET
through
the
signal
that
was
sent
to
the
gate.
Figure
3
shows
the
circuit
we
used
to
provide
this
control.
The
gate
signal
was
produced
with
a
pulse-width
modulation
(PWM)
IC.
In
order
to
produce
the
signal,
an
isolated
12
V
input
source
was
needed.
Not
only
does
this
circuit
provide
a
square
wave
output
signal,
designated
as
the
Gate
Signal
in
Figure
3,
but
provided
us
external
control
over
the
frequency
and
duty
ratio
of
the
square
wave.
This
can
be
seen
in
the
top
left
corner
of
Figure
3.
The
components
labeled
as
Frequency
and
Duty
Ratio
are
potentiometers
that
allowed
us
to
adjust
in
order
to
provide
the
correct
output
voltage.
2.1.2
Calculations
In
order
to
ensure
that
the
voltage
and
current
specifications
of
the
camera
were
met,
we
had
to
perform
calculations
for
individual
passive
components.
Sample
calculations
are
performed
here
for
the
5
V
to
3.3V
DC/DC
converter.
As
seen
in
the
schematic,
the
buck
converter
that
was
used
has
an
inductor
and
capacitor.
These
values
control
the
variability
of
the
current
and
voltage.
Overall,
there
were
four
parameters
we
had
to
control
for.
These
parameters
were
frequency,
duty
ratio,
inductance,
and
capacitance.
There
were
three
equations
that
we
used
to
evaluate
each
of
the
four
parameters
so
one
had
to
be
fixed.
For
the
purposes
of
our
power
supply,
the
value
we
chose
to
fix
was
the
frequency.
We
chose
a
value
of
50
kHz
(a
value
greater
than
the
human
auditory
threshold
of
20
kHz)
for
our
circuit,
primarily
because
this
value
is
typically
used
in
power
applications.
The
first
parameter
that
needed
to
be
set
was
the
duty
ratio
of
the
MOSFET
that
was
used.
For
a
buck
converter,
Equation
1
sets
the
duty
ratio.
=
=
!!"#
!!"
( 1 )
3.3
= 0.66
5
Using
the
duty
ratio,
the
passives
can
be
evaluated.
The
first
is
the
capacitor
of
the
system.
The
capacitor
controls
the
output
voltage.
Equation
2
shows
the
relationship
of
capacitance
to
voltage.
To
evaluate
for
the
capacitance
needed,
constants
were
taken
from
the
specifications
and
a
frequency
of
50
kHz
were
assumed.
The
current
through
the
capacitor
is
evaluated
as
the
output
current.
! =
0.093 =
=
!"
!"
( 2 )
(2 0.150)
(0.093 0.66)
= 4.1
(0.30 50,000)
The
final
passive
component
is
the
inductor.
The
inductor
provides
a
means
of
controlling
the
variability
of
the
current.
Once
again,
all
constants
are
evaluated
through
the
specifications
and
with
a
frequency
of
50
kHz.
The
voltage
across
the
inductor
is
calculated
to
be
the
difference
between
the
input
and
output
voltages.
Equation
3
shows
this
relationship.
4
! =
(5 3.3) =
=
!"
!"
( 3 )
(2 0.017)
(1.7 0.66)
= 660
(0.034 50,000)
2.1.3
Simulations
Using
values
greater
than
what
we
obtained
with
the
calculations
for
the
buck
converter,
a
Simulink
model
was
created.
This
Simulink
model
was
used
to
provide
us
a
baseline
for
our
future
design
and
to
prove
that
is
a
viable
means
to
produce
the
3.3
V
needed
for
the
FLiR
thermal
camera.
In
addition,
we
added
parasitic
inductances,
capacitances,
and
resistances
(obtained
from
datasheets)
in
order
to
provide
a
more
accurate
Simulink
model.
Figure
4
shows
this
output
voltage.
The
output
at
100
ms
is
marked
on
the
plot
and
is
shown
to
be
3.298
V,
well
within
the
specifications
we
need
for
the
thermal
camera
input.
One
potential
issue
that
arose
was
the
overshoot
seen
at
approximately
7
ms.
However,
because
this
was
a
momentary
voltage,
protection
was
built
into
the
thermal
camera
circuitry
to
handle
this
event.
Because
the
voltage
ripple
was
nearly
zero,
and
the
current
ripple
is
simply
a
resistive
load,
we
were
able
to
meet
the
specifications
provided
for
current
as
well.
Because
the
simulations
were
successful,
the
buck
converter
topology
was
used
for
the
final
circuit.
2.2
Thermal Camera
A
FLiR
development
kit
thermal
camera
module
is
used
here
due
to
its
active
technical
support
and
low
cost.
PureEngineering
LLC.
provided
the
protocol
for
communication
used.
[3]
2.3
DSP
A
DSP
will
be
necessary
for
performing
human
detection.
It
will
need
a
file
I/O
system
to
store
a
trained
classifier
model
and
to
store
the
camera
live
feed
from
the
Raspberry
Pi
for
processing.
The
DSP
will
be
handled
by
the
myRIO,
where
the
Vision
Development
Module
will
be
used.
The
myRIO
runs
on
Linux,
so
file
I/O
can
be
easily
handled
by
SSH
and
SFTP
protocols.
Communication
with
the
Raspberry
PI
will
be
handled
via
SFTP
since
the
myRIO
has
Wi-Fi
capability.
For
human
detection,
we
used
NIs
particle
classification
trainer
and
the
Vision
Development
Module
VIs.
2.3.1
Training
the
Classifier
For
developing
a
classifier,
we
used
sets
of
86
images
with
zero
people
in
a
room,
85
images
of
one
individual
in
different
positions,
postures,
places
in
a
room,
and
17
images
of
two
individuals.
We
trained
the
classifier
to
have
three
class
labels
of
0,
1
and
2.
The
classifier
performs
feature
extraction
by
analyzing
a
shape
of
bright
pixels
that
denote
a
high
temperature
entity.
This
shape
of
pixels
will
be
used
as
feature
vector
for
the
classifier.
NI
describes
the
feature
vectors
in
[4].
The
NI
Particle
Classification
Training
program
outputs
a
trained
classifier
model
file
that
we
send
to
the
myRIO
via
an
SFTP
put
command.
Once
the
myRIO
has
the
file
on
its
directory,
we
created
a
VI
to
load
the
classifier
and
to
test
images
against
it
for
human
detection.
2.3.2
Alternative
Method
for
Human
Detection
Previously,
we
used
HOG
feature
extraction
VI
that
was
developed
to
perform
the
human
detection.
However,
a
third
party
Linear
SVM
VI
[5]
that
was
needed
for
classification
was
not
compatible
with
the
myRIO
because
the
necessary
software
libraries
were
not
on
the
myRIO.
The
HOG
algorithm
does
an
edge
detection
of
truncated
smaller
pictures
(cells)
of
the
original
picture.
After
edge
detection,
the
gradient
of
the
edges
will
be
calculated.
A
histogram
of
these
edge
directions
will
be
computed
for
these
cells
and
then
by
using
all
the
histograms
generated
by
the
cells
of
the
image,
a
descriptor
can
be
made
to
describe
what
is
human
or
not.
The
HOG
feature
extraction
that
was
implemented
is
shown
in
Figure
5.
2.3.3
Detection
Implementation
Once
a
classifier
model
is
trained,
images
are
sent
from
the
Raspberry
Pi
using
an
SFTP
put
command,
to
the
myRIO
where
the
myRIO
will
load
the
image,
test
it
against
the
classifier
and
the
classifier
testing
VI
will
output
the
class
label
for
that
image.
For
our
purposes,
the
classifier
will
output
0,
1
or
2,
where
the
integers
denote
the
number
of
people
that
the
myRIO
can
see.
This
output
is
stored
onto
a
text
file
called
info.txt.
2.4
Raspberry Pi
The
Raspberry
Pi
needs
to
be
able
to
connect
to
Wi-Fi
to
do
useful
work.
However,
the
module
itself
does
not
have
built-in
Wi-Fi.
RaspberryPiHQ
suggested
getting
an
Edimax
EW-7811UN,
an
USB
Wi-
Fi
adapter,
since
it
is
cheap,
small,
and
compatible
[7].
However,
the
same
USB
Wi-Fi
adapter
was
already
with
the
Raspberry
Pi
when
we
checked
it
out
from
the
lab,
so
we
didnt
need
to
buy
one.
From
RaspberryPiHQs
tutorial,
we
were
able
to
configure
the
Raspberry
Pi
to
connect
to
wireless
Internet.
For
the
Raspberry
Pi
to
act
as
a
server,
it
needs
a
static
IP
so
it
can
communicate
with
other
modules
through
the
same
procedure
every
time.
We
used
Wicd-curses,
a
tool
that
helps
connecting
to
wireless
networks
with
specific
configurations,
to
set
a
static
IP
with
the
help
of
[8].
The
final
step
to
set
up
a
web
server
is
to
install
MySQL
and
PHP.
This
will
allow
the
Raspberry
Pi
to
store
data
and
communicate
with
the
Android
app
with
json
objects
as
parameters.
[9]
explains
how
to
install
MySQL
and
PHP
on
the
Raspberry
Pi
and
make
those
two
parts
interact
with
each
other.
That
website
also
covers
how
to
make
PHP
pages
on
Raspberry
Pi
public
in
order
to
allow
other
subsystems
like
the
Android
app
to
communicate
information
across
the
internet.
The
flowchart
of
the
module
is
shown
in
Figure
6.
There
are
two
branches,
receiving
a
query
from
the
Android
app
or
acquiring
data
from
myRIO.
When
receiving
a
query
from
the
Android
app,
it
executes
the
query
and
returns
the
query
results.
After
acquiring
data
from
myRIO,
it
updates
the
database
and
checks
if
email
notification
needs
to
be
performed
as
well.
To
output
human
detection
data
from
the
myRIO,
the
Raspberry
Pi
will
initiate
an
SFTP
protocol
with
the
myRIO
using
a
Python
script
with
a
Paramiko
library.
Once
this
SFTP
protocol
successfully
connects,
the
Raspberry
Pi
will
continuously
send
an
image
and
retrieve
a
text
file
from
the
myRIO
in
a
while
loop
until
a
break
command
is
sent
as
shown
in
Figure
7.
The
retrieving
process
will
involve
a
get
command
for
the
info.txt
file
where
the
Raspberry
Pi
will
read
the
text
file
to
see
the
output
of
myRIO.
For
the
email
notification,
we
used
a
Python
script
with
SMTP.
[10]
shows
the
exact
code
that
we
needed
to
make
the
protocol
work.
2.5
Android App
The
main
purpose
of
this
Android
application
is
to
allow
the
user
to
interact
with
the
other
subsystems
without
knowing
many
technical
details.
The
flowchart
is
shown
below
in
Figure
8.
The
app
sends
a
request
to
the
server
(Raspberry
Pi),
waits
for
the
response,
and
displays
the
response.
The
main
functionalities
of
the
app
include
viewing
rooms,
adding/removing
rooms,
setting
rooms
thresholds,
and
setting
users
email
address.
Each
of
the
mentioned
functionalities
above
has
a
unique
tab
in
the
application.
The
menu
of
the
application
is
shown
in
Figure
9
below.
The
first
functionality
is
viewing
rooms.
For
each
room
that
the
user
added,
there
is
a
page
like
shown
in
Figure
10.
The
page
shows
the
name
of
the
room,
buttons
to
go
to
the
next/previous
room
(only
available
for
more
than
one
room,
hence
not
shown
in
the
figure),
the
number
of
people
in
the
current
room,
and
a
button
to
show/hide
live
feed.
The
number
of
people
in
the
room
and
the
live
feed
automatically
refresh
themselves
once
every
second.
The
second
functionality
is
adding/removing
rooms.
The
user
interface
for
this
functionality
is
shown
in
Figure
11.
This
requires
the
user
to
enter
a
room
name
and
the
IP
address
of
the
Raspberry
Pi
that
corresponds
to
the
room.
We
have
implemented
an
IP
address
check.
The
check
will
make
sure
the
user
has
entered
in
a
valid
IP
address
after
the
user
hits
the
Add
button.
There
is
also
a
check
that
the
room
name
should
not
exceed
30
characters.
The
next
functionality
is
setting
rooms
thresholds.
Figure
12
is
an
example
of
how
the
tab
of
this
functionality
looks
like.
This
functionality
is
very
simple;
it
asks
for
a
number
for
each
room
as
the
threshold
for
the
room.
The
final
functionality
is
setting
users
email
address.
Figure
13
shows
what
this
tab
looks
like.
We
implemented
an
email
format
check
for
this
tab
to
make
sure
the
user
entered
a
valid
email
address.
10
3.
Design Verification
3.1
Power
Supply
Requirements
Verification
Results (Y/N)
Y
The
output
of
the
power
supply
had
an
average
voltage
of
3.3
V
with
a
ripple
of
20
mV.
Verification
Results (Y/N)
Y
We
confirmed
the
result
by
going
into
the
directories
via
SSH
and
seeing
the
files
were
there.
We
opened
up
the
files
in
both
systems.
Y
We
confirmed
the
live
updates
by
viewing
new
images
on
the
on
the
Front
Panel
display
of
the
myRIO
code.
Y
We
took
a
set
of
15
images
with
0,1,
or
2
people
and
the
myRIO
was
correct
on
12
images
for
a
missed
rate
human
detection
of
20%.
Y
We
timed
the
runthrough
of
taking
a
picture
to
receiving
an
info.txt
file
to
be
3
seconds
on
average.
3.2
myRIO
Requirements
11
3.3
Raspberry
Pi
Requirements
Verification
Results
(Y/N)
Y
We
used
a
ping
program
to
ping
google.com
and
received
packets
back
to
verify
the
connection.
3.4
Android App
Requirements
Verification
Results (Y/N)
Y
We
created
a
dummy
Python
script
to
output
3
people
in
a
room.
The
stats
page
of
the
room
showed
3
people
in
the
room
after
one
second.
Y
We
set
the
e-mail
address
to
our
e-mail
and
set
the
threshold
to
2
people.
After
using
the
same
dummy
program
as
before
to
output
3,
we
received
an
e-mail
saying
the
threshold
was
exceeded.
12
4.
Costs
4.1
Parts
Table
1:
Parts
Cost
Item
Manufacturer
Vendor
Quantity
Cost
myRIO
National
Instruments
National
Instruments
$200
FLiR
Sparkfun
$349.95
Raspberry Pi
Raspberry
Pi
Foundation
Amazon
$30
Edimax
Amazon
$9
Inductor: 39 mH
API Delevan
Mouser
$6.50
Inductor: 2.61 mH
TDK
Mouser
$1.76
Capacitor: 47 uF
Samsung
Digikey
$1.54
Schottky Diode
MCC
Digikey
$0.56
FETs
Rohm
Digikey
$0.80
Wall Adapter
Phihong USA
Digikey
$6.38
Total
14
$606.49
4.2
Labor
Table
2:
Labor
Costs
Name
Hourly Rate
Total
Hours
Invested
Tam Tran
$27.50
225
$15,468.75
Jayanth Alangar
$27.50
225
$15,468.75
Gene Shiue
$8.25
500
$10,312.50
Total
950
$41,250
13
4.3
Total
Cost
Table
3:
Total
Cost
for
Labor
and
Parts
Section
Total
Labor
$41,250
Parts
$821.49
Grand Total
$42,071.49
14
5.
Conclusion
5.1
Accomplishments
For
our
project,
we
were
able
to
achieve
all
of
our
goals.
We
managed
to
have
a
missed
rate
detection
of
below
the
30%
that
we
were
aiming
for.
We
developed
an
Android
application
that
can
interface
with
the
thermal
home
monitoring
system,
where
the
user
can
see
how
many
people
are
in
a
room,
set
a
threshold
and
emailing
system
and
can
even
view
a
live
feed
of
a
room.
We
were
also
able
to
produce
a
power
supply
that
can
be
powered
by
a
home
outlet,
which
will
power
the
thermal
camera,
Raspberry
Pi,
and
the
myRIO.
5.2
Uncertainties
At
this
time,
we
were
unable
to
fully
integrate
all
of
the
different
modules
for
our
project.
We
found
that
our
project
was
easy
to
access
by
intruders
since
we
lack
encryption
for
the
data
that
we
have.
Another
uncertainty
is
the
limit
of
human
detection,
since
we
were
unable
to
procure
a
large
training
set
with
many
different
numbers
of
people,
we
can
only
count
up
to
2
people.
This
meant
that
the
myRIO
would
just
guess
at
the
number
if
the
image
has
3
or
more
people.
Furthermore,
upon
testing
the
power
supply
on
a
PCB,
we
had
a
blown
part
and
we
had
to
go
back
to
the
breadboard
design.
5.4
Ethical Considerations
Our
project
followed
the
IEEE
Code
Of
Ethics,
taken
from
[11],
because
it
is
the
law
that
electrical
engineers
follow.
Below
we
state
the
relevant
clauses
of
the
IEEE
code
of
ethics
that
relate
to
our
project.
1. To
accept
responsibility
in
making
decisions
consistent
with
the
safety,
health,
and
welfare
of
the
public,
and
to
disclose
promptly
factors
that
might
endanger
the
public
or
the
environment;
o We
will
test
the
power
supply
of
our
circuit
to
make
sure
it
is
functioning
within
spec
and
we
will
put
warnings
where
necessary.
2. To
be
honest
and
realistic
in
stating
claims
or
estimates
based
on
available
data;
o Any
claims
made
by
this
project
will
be
verified
through
statistical
analysis
and/or
following
the
requirements
and
verification
table.
15
From
participating
in
peer
reviews
and
giving
suggestions
in
the
senior
design
lab,
we
as
a
team
can
help
support
others
professionally
and
spread
the
IEEE
code
of
ethics
in
this
way.
16
References
[1]
[2]
[3]
P.
Krein,
Elements
of
Power
Electronics.
New
York:
Oxford
University
Press,
2015.
Sparkfun,
'FLIR
LEPTON
Long
Wave
Infrared
(LWIR)
Datasheet',
2014.
[Online].
Available:
https://cdn.sparkfun.com/datasheets/Sensors/Infrared/FLIR_
Lepton_Data_Brief.pdf.
[Accessed:
12-
Feb-
2015].
GitHub,
'PureEngineering/LeptonModule',
2015.
[Online].
Available:
https://github.com/PureEngineering/LeptonModule.
[Accessed:
09-
Apr-
2015].
[4]
[5]
[6]
N.
Dalal,
Histogram
of
Oriented
Gradients
for
Object
Detection,
1st
ed.
Columbia:
University
of
Missouri,
2015.
[7]
[8]
[9]
Get
MySql
and
PHP
to
Work
Together
in
Raspberry
Pi.
Available
at:
http://www.php5dp.com/get-mysql-and-php-to-work-together-in-raspberry-pi/.
Accessed
May
2015.
[10]
[11]
17
Appendix A
Module
Requirements
Verification Procedure
(Y/N)
myRIO
Raspberry Pi
Android App
18
Appendix B
19
Appendix C
import
paramiko
import
cmd
import
sys
import
os
import
time
t0
=
time.time()
paramiko.util.log_to_file('/tmp/paramiko.log')
#
Open
a
transport
host
=
'192.168.1.164'
transport
=
paramiko.Transport(host)
#
Auth
password
=
'123'
username
=
'admin'
transport.connect(username
=
username,
password
=
password)
#
Go!
sftp
=
paramiko.SFTPClient.from_transport(transport)
var
=
1
while
var
<=
100:
os.system("./leptgraypng
>temp.png
;
convert
temp.png
-normalize
-contrast
-sharpen
5
sample.bmp")
#
Download
filepath
=
'../lvuser/info.txt'
localpath
=
'/home/pi/info.txt'
sftp.get(filepath,
localpath)
#
Upload
localpath
=
'/home/pi/Downloads/LeptonModule-master/flirpi/sample.bmp'
filepath
=
'../lvuser/image.bmp'
sftp.put(localpath,
filepath)
#
Break
while
loop
after
100
iterations
var
=
var
+1
#Close
connection
sftp.close()
transport.close()
#Record
timing
of
code
t1
=
time.time()
total
=
t1
-
t0
print
"Total
Time
Is:
%s
seconds"
%
str(total)
20