Академический Документы
Профессиональный Документы
Культура Документы
The
receiver
uses
the
messages
it
receives
to
determine
the
transit
time
of
each
message
and
computes
the
distance
to
each
satellite
using
the
speed
of
light.
Each
of
these
distances
and
satellites'
locations
define
a
sphere.
The
receiver
is
on
the
surface
of
each
of
these
spheres
when
the
distances
and
the
satellites'
locations
are
correct.
These
distances
and
satellites'
locations
are
used
to
compute
the
location
of
the
receiver
using
the
navigation
equations.
Bill
of
Materials
Raspberry
Pi
Model
A
or
B
$25
or
$35
Adafruit
Ultimate
GPS:
$39
USB
TTL
(Terminal)
Cable:
$9
Power
supply:
$10
External
GPS
antenna:
$15
(optional,
but
useful)
SD
card:
$10
Setting
everything
up
The
easiest
way
to
get
the
GPS
module
working
is
by
connecting
it
to
the
Raspberry
Pi
with
a
USB
TTL
adaptor
Cable.
The
module
can
be
hooked
up
via
UART
as
well.
First,
solder
the
header
pins
onto
the
GPS
module.
We
then
connect
the
TTL
cable
to
the
GPS
module
as
follows:
Once
you
plug
the
USB
cable
into
the
Pi,
the
adapter
should
show
up
as
/dev/ttyUSB0
(though
the
'0'
may
be
different
if
you
have
other
ttyUSB
adapters
present).
To
list
the
active
USB
terminal
connections:
ls
/dev/ttyUSB*
You
can
confirm
the
attached
USB
devices
by
typing
sudo
lsusb
To
check
the
data
coming
out
of
the
GPS:
sudo
cat
/dev/ttyUSB0
Next,
run
the
following
command
to
install
the
GPS
Daemon
and
required
packages:
sudo
apt-get
install
gpsd
gpsd-clients
python-gps
Then
we
need
to
tell
the
GPS
Daemon
where
our
module
is:
sudo
gpsd
/dev/ttyUSB0
-F
/var/run/gpsd.sock
Testing
it
out
cgps
-s
Occasionally,
you
may
find
that
you
need
to
restart
the
GPS
service
to
get
a
fix,
use
the
following
command
to
do
so:
sudo
killall
gpsd
sudo
gpsd
/dev/ttyUSB0
-F
/var/run/gpsd.sock
gpxlogger
is
a
tool
for
logging
GPS
output.
Example:
gpxlogger
-d
-f
trip.log"
It
is
easy
to
take
the
output
and
upload
it
to
a
site
like
gpsvisualizer.com
and
come
up
with
a
map
like
this;
A
few
things
to
note
about
using
the
Raspberry
Pi
in
a
car:
Finding
a
suitable
display
can
be
a
little
tricky.
Anything
that
runs
on
Composite
will
have
poor
resolution.
We
got
around
this
with
a
4.3
NTSC
display
and
large
text
output.
With
this
combination,
CGPS
worked
pretty
well.
Here
I
am
at
the
Skyway
McDonalds:
As
we
all
know,
the
Pi
needs
a
good
power
source.
You
can
run
the
Pi
off
a
cigarette
lighter
USB
dongle,
but
these
are
not
all
created
equal.
Make
sure
it
puts
out
1
amp
of
power.
If
you
really
want
a
good
solution,
check
out
MausBerry
Circuits
Kickstarter
project:
http://www.kickstarter.com/projects/1312527055/raspberry-pi-car-power-
supply-ignition-switch?ref=live
The
power
supply
maintains
power
until
the
Pi
has
safely
finished
the
boot-
down
process
and
then
removes
power.
The
supply
is
most
easily
installed
by
connecting
to
3
wires
behind
your
radio:
the
+12V(car
battery),
ground
and
ACC
(switched
ignition)
wires.