Tuesday, 30 July 2013

Hardware Guide for AIS reception

What is Software Defined Radio / RTL-SDR?

In Software Defined Radio your computer is doing the hard work; an RTL-SDR is a small TV-tuner stick, which you can use to receive signals between 50 MHz and 1700 MHz. 
MHz is the number you see on your car radio, it is the frequency of the signal. When you listen to Radio 96FM you are “tuning” to 96 million Hertz (M is million).
You can use the stick for AIS reception, weather satellite reception, scanning marine channels, local music radio and many other uses.

What is AIS?

AIS tells the world the vessel’s name, where they are, where they’re going (destination), speed, heading (which direction they’re going)  and a few extra info. More and more targets of interest are also equipped, e.g. buoys.
If you have an AIS transmitter, big commercial ships see you from about 15-20 miles as a green triangle on their radar screen, even if you do not show up on radar. It is good for them (they can go around you) and good for you (they don’t hit you).

AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide
AIS information, Port of Cork, RTL-SDR and Coax Collinear antenna

How does it work?

AIS transmitters sends out a signal 161.975 MHz and/or 162.025 Mhz; this signal is digital so if you listen you only hear a small blip.
Your existing antenna for VHF can receive this signal, but it is easier / cheaper than a splitter to build a dedicated AIS antenna.
From your antenna, cable brings the signal into your RTL stick. This eats the analogue signal from the antenna, chews it so it becomes digital, and gives it to the laptop for processing.
A software called SDRSharp shows you the received signal, then sends it to a free software called AISMon, which shows you ships' data or forwards it to your chart plotter software. It can also send this data to your navigation instruments e.g. Chart plotter.
All software used are free, but basic. Alternatively, you can buy Shipplotter with more features, which is reasonably priced at 25 euros.

What you need

1.            Computer / Laptop
2.            USB cable and RTL Stick
3.            Antenna adaptors
4.            Coaxial cable
5.            Antenna
6.            (Optional) Items to reduce radio interference / noise

If you wish to get a ready-made package, do not want to make an antenna or interested in radio scanning, get the following items:
-              RTL-SDR stick
-              MCX-SMA adaptor
-              SMA-BNC adaptor
-              Scanning antenna
This is enough to receive AIS and marine channels, plus basically all frequencies, all modes between 30 and 1100 Mhz. About 50 euros total.

1.            Computer / Laptop

It can be a laptop or a desktop, all it needs is an USB port. For example, I tested all equipment and software on a 7-year old Dell laptop with Windows 7 - all works fine. 
On my main laptop the fully functioning setup uses around 1 GB Ram with 7-10 % processor usage. If you bought your laptop in the last 3-4 years, chances are all software will run smoothly.
The word “laptop” is used as most likely you will have one.

2.            RTL – SDR Stick (RTL2832U & R820T Tuner)

The RTL stick puts the signal into your computer using your USB port. The one you need is the R820T tuner, from Nooelec. Other sellers on Ebay also sell it, the Nooelec version has extra protection (= read Safety). It is 2-3 dollars more expensive.
-              You need this: Newsky TV28T v2 USB DVB-T & RTL-SDR Receiver, RTL2832U & R820T Tuner, MCX Input.
-              The company is called Nooelec, and they will help you if you have problems. Delivery to Ireland took 8 working days. Jeff is the name of the problem-solving guy.
-              An USB extension cable, so the stick is away from your computer. A one-metre one is OK, but use less than 2 metres. It is recommended, everything will work better with it.

3. Antenna Adaptors / Cable ends

Adaptors connect the dongle, cables and the antenna to each other.
If you want to disconnect the antenna you will need adaptors.
You can meet the following types:
MCX: This is the one used on the dongle. You push it in. If you have no adaptor you can cut the small antenna cable you have with the stick, and splice it into your antenna cable – see below.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

BNC: Bayonet type, ready-made scanner antennas use this. You push, then turn this. CCTV also uses this, so if you have a wholesale / electrical shop in town they might have them.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

F-type: Screw-type, used for satellite TV, UPC/Sky modem connectors. 
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

SMA: Screw-type, used on marine radios, Icom equipment etc.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

Others (SO-239 and N-type): myriad variations exist, most common are SO-239 and N-type. They are super-sized screw-type connectors. If you can get them, use them.
BNC and F-Type can be bought everywhere because they are used for CCTV, TV and Satellite installations.
PAL is not discussed here as it easily comes apart.

Difference between male and female:
Male: you see wire in the middle inside.
Female: you see a hole, where the wire in male goes into.

Use what you got or available in your area. If you have nothing or you have to, use the following trick:
-              The stick comes with a small antenna. Cut that it half, so now you have a piece of cable with the small adaptor that goes into the RTL stick on one end.
-              About 7.5 cm/3 inches from the other end (this is the one with no connector) cut the plastic cover along its length.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

-              Take off the plastic outer connector. 
-              The small wires you see are called the braid. They surround the center wire, which carries the signal.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

-              Peel back these wires so you can see the center wire (it is inside a plastic tube)
-              Twist the braid together. Do this on paper so little bits can be cleaned up easily.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

-              Next, cut the plastic surrounding the center wire with knife very gently, so you can pull this plastic sleeve down.
-              Now you have the braid and the center wire.
-              Do this with the coax going to your antenna too, it is similar but with more braid and thicker center wire. Pictures are of a coax here.
-              Connect the braid to the braid and the center to the center.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

-              Twist them together.
-              Be careful so that the center and the braid so not touch each other.
-              Electrical tape them separately.

3.            Cables (called coaxial cables or coax)

AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

Every cable has numbers written on it, like RG 59U, and/or 75 Ohm. You need 75 Ohm cable to connect antennas to the stick – luckily, satellite and TV cable is fine. Unless you ask specifically for radio cable you will probably get 75 Ohm cable, called RG59.
If the area you’re in has TV you can buy coax cable somewhere. 10 metres/30 foot works out to around 10 - 15 euros, but shops also sell it by the metre. Electrical wholesalers are the cheapest.
The Ohm thing: the resistance of the cable. Try to use 75 Ohm. Scanner antennas, your marine radio and handheld VHF antennas are also 50 Ohm – they work with the stick.
Thicker cable with better shielding/less signal loss is more expensive, and normally used for long cable runs e.g. mast-mounted antennas. If you mount the AIS antenna somewhere around your cockpit it is unlikely you’ll see any difference between 1 and 10 euro cable.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

Do not lose sleep over cable; use what you can afford or get locally.

4.            Antennas / Aerials

NOTE: It is THEORETICALLY possible to transmit with these antennas – I only tested them for reception.

The antenna receives the signal from the AIS station. Your “marine antenna” at the top of your mast is designed to operate between 156 and 162 Mhz, AIS is around 162 Mhz. Your VHF Aerial works fine for AIS, with a splitter, but the splitter costs more than a dedicated AIS antenna.
Testing done 1 nm from the nearest commercial port and 2.5nm from the local VTS, in both cases buildings/trees/power cables in the way, in the heart of a city centre, half a mile from a big transmitter tower, next to a WiFi router.
If an antenna works here, it will work out at sea as there are less electrical noise and less signal loss due to buildings.

DIY / Homemade AIS Antennas - few tips:

-              Use a blunt knife, so you will not cut into the center wire.
-              Place a paper under the cable you’re working on, this catches the small copper wires.
-              Mark lengths with tape. This keeps the coax together and provides a reference point.
-              Only a knife and (electrical) tape is required for construction; permanent installations need more attention, but the above is enough to make a working antenna.
-              If you have no tape measure, an A4 page is 210x297mm.

Collinear Coax AIS antenna - Recommended

AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guideLength about 120 cm, costs 1 euros, works just as good as an 80 euro discone antenna. The antenna and the RTL stick fits into your pocket for AIS reception anywhere you can bring your laptop with you.
The best is that you only need to buy enough coax to reach from your laptop to your antenna site, plus 1 metre for the antenna, and you have a working AIS receiver.
The antenna is basically two 61 cm long coax cables, connected the wrong way for the antenna bit (center to braid and braid to center). You need to make four connections, two in the antenna proper and two at the bottom of the antenna to the coax cable you use to bring the signal to the RTL stick. 
Twist the connections or use quick connectors; both work. For permanent installations you’re advised to use shrink-wrap (plastic tube that melts with a lighter) or lots of electrical tape.
As the antenna is flexible you need some form of support: the bottom half of a two-piece fishing rod or a PVC pipe sealed at one end is a permanent solution.

-              Top section: measure 616 mm from end of coax,
-              Mark with electrical tape, plus about 5 centimetres one end to have enough wire for connections.
-              Bottom section: 616 mm for the antenna, plus enough both ends for connections.
-              Cut the outer plastic cover lengthwise, carefully not to cut the center of the cable.
-              Remove the plastic outer shell.
-              Separate the braid from the center cable.
-              Twist the braid.
-              Cut off enough plastic cover from the center that you can wrap the braid around it. Cut it above the braid end so you can keep them separate.
-              If you bend the center a little bit out from the cable that makes wrapping easier.
AIS, antenna, RTL-SDR, Software Defined Radio, 820T, testing, review, DIY guide

-              Connect braid to center and center to braid.
-              Pay attention for the small wires used in the braid not to be near the center wire.
-              Use electrical tape to insulate the different bits.

Copper wire Whip antenna – cost of 1 metre copper wire.

You need either 1.85m (Full wave), 1.15m (5/8th wave) or 0.925m (half wave) length of copper wire.
I used a 0.9m piece coax conductor as the actual wire and 4 metres of coax to RTL stick. 
AIS signal from 2 vessels in port and VTS 2.5 nm away comes in strong enough for AISMonitor to work.

  1. Measure from the end of the coax the required length.
  2. Cut the insulation lengthwise.
  3. Peel off the braid and outer plastic shell, then cut it off. 
  4. Only the centre wire inside the plastic shell remains. 
  5. Connect the other end to the RTL stick, start receiving signals.

Centre-loaded Magnetic Antenna

Works flawlessly; being wide-band means that you can receive from CB radio 30 MHz to Airplane ID signals at 1090Mhz. An antenna for 90% of the signals you want to receive, stealthy. 
Being a ready-made antenna it comes with a BNC connector. Connect to RTL stick with MCX-SMA and SMA-BNC adapters.

Discone antenna

Looks like a hedgehog, but offers the best sensitivity. Windage might be an issue, other than that it is the best / most expensive option for reception. A bit conspicuous, also a good antenna for terrestrial digital TV reception. 

5.            (Optional) Eliminating Radio Interference / Noise / Shielding

1.            Shielding the RTL Stick – you need aluminium cans

Even without an antenna the stick can receive local music radio stations, so you need some kind of metal around it to block radio waves. Aluminium cans work.  
Cut off the ends from an aluminium can (soda can / beer can, the bigger the more material to work with). 3 cans of Coke is enough material. Wrap the stick in several layers of aluminium, leaving the USB connection and the antenna connection free. This significantly improves your signal.
If cutting up aluminium cans is above your paygrade aluminium enclosure boxes can be bought at most electronic shops. But really, 4-5 layers of metal is more than enough and you can finish the job in 5 minutes.

2.            Eliminating interference – you need clamp-on ferrites

Electricity escapes around the ends of electrical cables; that is why you have a small cylindrical shape at the end of your laptop charger. That is called a ferrite bead or clamp-on ferrite; costs around 1-3 dollars each. A ferrite bead is a ring, you slide that onto the cable. Clamp-on ferrites open.

Put clamp-on ferrites on both ends of cables, the more the better. And I mean all cables ideally, if you have only a few fwrrites, treat power lines first, then radio equipment.

3.            Shielding cable and lowering electrical noise 

The cable carrying the signal from your antenna to the RTL stick picks up environmental noise. Even if you buy 10 euros/metre quad-shielded coax cable, chances are you can improve cable shielding and/or the quality of the signal reaching the stick.
-              Mount the stick as close to the antenna as possible. This reduces the amount of coax required. The quality of the signal can be only influence between your antenna and the RTL stick (analog signal), from the stick it is digital (stick sends either 1 or 0). 
-              Try not to have power cables and signal cables next to each other.
-              Coil the coax 4-5 times in a small diameter circle, this helps with noise.

References and Further Reading

(All open in new window)

RTL stick

Largest website with many alternative uses and software installation guide is RTL SDR.com.
Technical details and many more at the Osmocom SDR site.


Read the Wikipedia entry here.

Antennas and cable

Cable characteristics for RG cables are here. Velocity factor is required from the table if you use different cable for the coax collinear.
Coax Collinear construction tips are here
Coax Collinear with diagrams are here. Note that radio amateurs use RG-58 (50 Ohm) cable, but the stick needs 75 Ohm. Also, hams (short for radio amateurs) love to solder.
Coax Collinear, with useful technical info and pictures here.  That is for 1090 Mhz, concept the same. Very intriguing ideas for static protection and 75/50 Ohm transformer, for those of you wishing to impedance match antenna and equipment. 
Frequency calculator is here, if you're into cutting stiff wire into a resonant length. Or divide 300 with Frequency in MHz, get the full wavelength, then decide what antenna you want. 

Legal Disclaimer and Final Thoughts

Safety at sea is the most important factor taken into consideration in the decision-making process; consequently please use the information here with safety in mind. 
My favourite part of the ColRegs, "or of the neglect of any precaution which may be required by the ordinary practice of seamen" applies here: do not rely on anything, especially information from a single source such as AIS information.
The purpose of this blog is to demonstrate the use of a relatively new and inexpensive equipment for marine / yachting purposes; a device designed as a cheap DVB-T tuner will never be equivalent to a professional dual-channel AIS receiver, quad-shielded cable, a quality antenna and professional installation. 
A working RTL-AIS system uses a minimum of four physical connections, and runs a minimum of three separate applications under Windows 7. With one component failure it stops. 
Ideally, use the info here to see what AIS is all about while bobbing along at anchor, in the safety of a marina. 
If you like receiving AIS information, perhaps think that an AIS transmitter might improve the safety of your vessel and your off-watch sleep on passage, buy a professional product and have it installed by a professional. 
I am not responsible for the use, misuse or abuse of the information contained in this guide. 

If you enjoyed this article, or wish to support this blog, 

... go to Amazon and buy my book Tips and tricks in the book will save time and money, reduce frustration with computer settings and help you build the best antenna system from shortwave to microwave. Detailed and illustrated step-by-step descriptions on easy-to-do antennas, from shortwave to microwave.
Basically all you need to know to enjoy radio.