The Raspberry in my lunchbox
AIS
(automatic identification of shipping ) is the system whereby larger
vessels are required to continuously transmit their position, course
speed etc along with ID information and is a major advantage in
collision avoidance.
This
project started as an attempt to get real time AIS data to be shown
on an Android device on my boat.
CVB_T RTL SDR Dongles are electronic devices that
were originally produced in large volumes as converters for digital
television broadcasting. However as new TVs came with the required
hardware ready installed there is a glut of these devices on the
market and they are therefore very cheap.
It
was then discovered that these very powerful bits of electronics had
a host of other potential uses, particularly Software Defined Radio,
in which role it emulates the gear that radio hams have been playing
with in lofts throughout the world for many years.
It was then discovered that they could be tuned
(by the software) to receive the AIS frequencies in the VHF range of
161.975 MHz (AIS1, or channel 87B) and 162.025 MHz
(AIS2, or channel 88B).
As these Dongles are very cheap, and they can be used to replace
proprietary equipment costing many hundreds of pounds, my Scottish
antennae were raised and I bought one.
I downloaded several android apps that purported to interface with
the CVB_T RTL SDR device. However I could not get
any of them to work. One of the issues might have been that each
Dongle needs to be calibrated to take account of its receiving
offset, measured in PPM (parts per million).
I downloaded various bits of radio ham software to
play with the device on my desktop. The best is a program called
HDSDR written by a German chap called by Mario Täubel. Using
this I managed to confirm the device I had bought was working and I
calculated the PPM offset (29 for my device).
However I could still not get it to show any signs of receiving with
any of the Android apps I tried, including trying each on several
devices.
I wondered if the tiny antenna that came with the Dongle was up to
the task, even though I received signals using HDSDR on my desktop.
So I constructed a full scale antenna (vide infra) and connectors.
This confirmed the device was OK but the android approach was not
working.
A few months previously I had bought myself a Raspberry Pi computer
to play with. These remarkable little devices are now very powerful
computers with Quad core processors running at 1.4 GHz, 1Gb of RAM,
Wifi, Bluetooth, Ethernet and 4 USB ports for connectivity. All for a
bargain price.
I decided to investigate whether the Raspberry Pi and CVB_T
RTL SDR might form the basis of a stand alone AIS receiver.
The
Raspberry Pi can run a range of operating systems but the most
developed is Raspbian which is an extrapolation of the Debian flavour
of Linux. So I entered the world of Linux terminal command code! This
mostly involves searching forums and websites dedicated to the
subjects and following other peoples instructions. As often as not
this results in the system turning into a brick so it is a good idea
to have a series of SD cards with copies of the last good iteration
of the project available to rescue the situation.
The
guys who inhabit this world are different. Mostly geniuses, some are
a bit obtuse and it can be difficult to follow them as a novice
however others are brilliant at giving instructions that lay people
can follow. This project has served as a rapid induction into the
world of Linux code, although I am still at the foothills of a steep
and long learning curve.
This guy gave me the secrets that worked
http://pysselilivet.blogspot.com/2018/06/ais-reciever-for-raspberry.html
.
So
the equipment for the project:
RASPBERRY Pi 3 B PLUS
£28.50
DVB-T DAB FM RTL2832U & R820T Tuner
Mini USB RTL-SDR Receiver Stick FT
£7.40
MCX MALE RIGHT ANGLE to UHF Female
SO-239 Jumper pigtail RG316 Cable 15cm
£1.62
This
is required to connect the boat’s VHF antenna to the tuner Dongle.
A RC Ubec 5V 6V BEC Full 5A Shielding
Antijamming Switching Regulator New MK
£3.14
I
found the standard micro usb phone charging connectors were not
supplying enough juice to run the Raspberry Pi plus the GPS Dongle
plus the RTL-SDR Dongle.
This
adaptor is primarily for model aircraft servos and delivers a
regulated 5V at up to 3 amps. It connects direct to the GPIO
connectors of the Pi, pin 2 is 5v and pin 6 is ground. This means the
wires going into the connector have to be adjusted and then it plugs
straight in. This seems to have solved the 12v powering issues.
Mini 8GB Micro SD Card TF Flash Slim
Memory
£2.72
The
SD card was loaded with Raspbian (Jessie Stretch version) and then
the most recent version of Open CPN open source chartplotter added.
The
port setting and network address need to be added at the OpenCPN
“connections” page to coincide with the setup entered under
Pyssel’s instructions.
You
can test the Dongle is running by entering a command in Terminal (
Sudo systemctl status AIS) - good eh!
The
whole lot fits quite neatly into a Tupperware found under the sink,
also using a 12v connector from the garage soldered to the 5v
regulator and a GPS dongle I happened to have for the boat laptop.
RG58 Coaxial Cable 20 Meter
Fitted PL259
and BNC Plug
£15.98
pack of 3 x Conduit Rigid 1 meter length
White 20mm PVC Heavy Gauge
£5.98
I
got this kit to construct an antennae. The plan is to have a separate
antenna on the pushpit rail which will act for the AIS and also as a
reserve in case of dismasting!!
Basically
you measure out the required length of cable. VHF is in the 2m range
so most antennae are 1m length in total to be ½ wave receivers.
The
outer insulation of the coax is removed from the top 0.5m. The inner
insulated core is then teased out from the outer shielding and the
shielding pulled back down and taped to the lower 0.5m. The whole lot
can then be passed up inside the white plastic tube and the ends
sealed. There are no connectors to reduce signal and my preliminary
experiment shows it works really well.
This
lot will make two antennae.
Coax antenna - No connectors! |
I am pleased to say it is all working fine.
I have also set up the Raspberry Pi with VNC host and an old android
tablet with VNC viewer. The tablet then acts as a Wifi hotspot and
access the Pi directly so there is no need for another screen.
This is (I think) the minimum power usage to get an AIS receiver
working. It is also pretty much the minimum cost at £53.36.
The tablet can run the Navionics at the
same time as headless control of the Raspberry Pi in the cupboard,
and playing music. I have picked up vessels 16nm away,and several dangerous approaches before I had seen the ship.
Comments
Post a Comment