German versionGerman

For a quick start just download this ZIP-File with all necessary data. It contains a handbook in English language.

ADS-B Decoder and Software

with PIC18F2550

back to my projects , PIC-Microcontrollers , Electronic , Homepage


Introduction
Do you remember the 11st September 2001 ? In the USA some aircraft disappeared from the screens of the air traffic controllers (ATC). The transponders of threes aircraft had been switched off. I asked myself: don't they have radar in the US?

Large areas of the US-airspace are not covered by radar. The ATC depends on "secondary radar". A ground station (interrogator) transmits an interrogation to a special receiver inside the aircraft, a transmitter in the aircraft answers by sending a replay back to the ground station. If the ground station employs a directional antenna and measures the time delay from interrogation to the answer, then it can predict direction and range to the aircraft - like a real radar. Of course this works only,  if the aircraft has the necessary hardware (receiver-transmitter, called transponder) and if this transponder is switched on.

A secondary radar ground station is much cheaper then a real radar. Another feature is, that the answering aircraft can insert additional helpful information into the answer.

For several years a new generation of transponders is in use, they support the new Mode-S. This kind of transponder sends more data (ADS-B-data) then the previous types. And they transmit data even if they are not interrogated. This feature is called squitter. Everybody can receive this squitter-information and create an own virtual radar picture with the position (and additional information) of all squittering aircraft. About 70 ... 80 percent of all aircraft transmit such information. Thus the virtual radar gives you a good idea about the air traffic in your neighborhood.

Why should somebody do this? Because it's fun.



ADS-B
(Automatic Dependent Surveillance–Broadcast)
All aircraft transponders transmit data at the frequency 1090 MHz. To receive this transmissions one needs a receiver for this frequency - an ADS-B-receiver.

1090 MHz is a frequency inside the L-band. Such high frequencies run linear through the atmosphere and are not reflected by the upper atmospheric layers (ionosphere). One can receive this signals only if there is no disturbing object in the line of view between aircraft and receiver antenna. The receive antenna should be mounted at a high position with an undisturbed view in all directions. A place on the roof or at a high post would be ideal, but for the first tries a "sub-optimum" location will do it. My test-antenna is taped at a window on the second floor.

The greatest obstacle for radio waves on our planet is the earth itself. So far we know the earth is round. Aircraft at a large distance are beyond and below the horizon and consequently obscured by the earth. As higher the aircraft altitude as larger the maximum distance to receive signals from this aircraft.Signals from an aircraft flying at 30000 ft altitude (10 km) can be received (at least in theory) over a distance from up to 400 km. This requires a sensitive antenna-receiver-combination and will be difficult to realize in the real world . However, more then 100 km are no problem, even with simple equipment.


To observe air traffic one needs:
  • one antenna for 1090 MHz
  • one ADS-B receiver as frontend (e.g. miniadsb)
  • one ADS-B-decoder
  • one PC with software to display the data
block diagramm

The antenna received the electromagnetic wave, converts it into an electric signals and feeds this through the coaxial cable into the receiver.
The receiver selects, amplifies and demodulates the signal. Its output signal is a so called video-signal.
The decoder converts the analog video signal into a digital signals and detects inside the received signal-chaos the replies from ADS-B-transponders. This data is forwarded to the PC via USB (or RS232).
The PC receives the ADS-B-data and extracts all interesting information. This is used to draw the radar picture.

For all 4 functional blocks different solutions are available in the internet. They are illustrated at http://miniadsb.web99.de/ .



Antenna

The transponder signals are vertical polarized. A vertical polarized antenna tuned to 1090 MHz is required to receive this signals. The simplest solution is a vertical wire or metal stick of 13 cm length , this is the half wavelength of the 1090 MHz signal. Such an antenna is an electric dipole and receives signals from all directions.

To improve the antennas sensitivity multiple electric dipoles can be combined. But if they are placed side by side, then the antenna would not be an omnidirectional antenna anymore. Consequently the individual dipoles have to be placed about each other. Finally the dipoles have to be interconnected, but upper and lower end of each dipole oscillate with 180 degree phase shift. To connect them 130mm long horizontal loops have to be used. They work as 180 degree phase shifter.

Dipoles and loops should be bended from one long piece of wire. Its diameter should be large enough for the necessary stability.. The lowest point of this dipole-group has to be connected to the middle wire of an 50-ohms coaxial cable.

Now we need a "dummy-ground", that has to be connected to the shield of the coaxial cable. A round piece of sheet metal (13 cm radius) would be great, but some radial wires can be used instead. At least 4 wires (90 degree interspaced) should be used (groundplane-antenna). "Dummy-ground" and dipole don't have to touch each other!

This is just a basic design. The impedance of the antenna is not matching the impedance of the cable (but can be modified by bending the "dummy-ground"-wires downwards. Longer or shorter connection loops between the dipoles can change the elevation angle of the antenna ....... Antenna design requires knowledge, experience and luck. 
Antenna

A good starting point for antenna discussions is   http://www.airnavsystems.com/forum/index.php?topic=2226.0
The favorite designs seems to be a groundplane from G-7RGQ  (http://www.kineticavionics.co.uk/forums/viewtopic.php?f=1&t=7489&sid=a97d41478e66511dd5cf715ee7c88df0&start=24) Probably it combines good sensitivity with geed elevation angle.

The unshielded horizontal loops can be replaced by shielded vertical  connections. The result is the Colinear-Coaxial-Antenna. A description is available here:: http://www.nodomainname.co.uk/Omnicolinear/2-4collinear.htm  But this antenna is designed for 2,4 GHz. An ADS-B-version would have to have different measures.
This video demonstrates the assembly on a simple ADS-B-antenna

More important then the optimum antenna design is the optimum location to erect the antenna. My test antenna (mounted behind a window 5 meters over ground) detects aircraft over more then 150 km, but only in directions without disturbing objects (trees. buildings). In other directions the limit was not much more then 10 km. Consequently the antenna should be placed at a high point with a view to all directions.



miniadsb-receiver
To receive ADS-B-signals a 1090 MHz receiver is needed. I use the direct detection receiver miniadsb from jetvision.de. It can be ordered as kit at http://miniadsb.web99.de/ for 45 Euro. To build the kit together requires experience in SMD-soldering. The whole receiver has the size of a textmarker (2cm x 2cm x 8cm). The input is a coax connector for the antenna cable. The output for the received signals is an analog output.
Beside the antenna connector, the decoder has 3 connection-wires only.:
  • power-supply ( +4V)
  • ground
  • analog output
All 3 are connected with the decoder via a 3-wire-cable.

The analog output  can deliver up to 0.4 mA. It should never be connected to any voltage, because it can be easily damaged.

The value of the supply voltage influences the receivers sensitivity. The optimum is 4V. Voltages larger then 5V or voltages of wrong polarity will destroy the receiver. For safety reasons i placed a Schottky diode inside the receiver. It is in line with the power supply wire (prevents wrong polarity) and increases the optimum voltage at the power supply wire to 4,5V. This voltage will be produced by my decoder.
miniadsb-Empfänger
pimp my miniadsb
A perfectly assembled miniadsb-receiver can have the double frame rate of a quick-and dirty assembled receiver. I suggest the study of the  tips for optimization in the miniADSB-forum. Beside a carefully and clean work the following points are important:


Decoder   adsbPIC
My decoder design was inspired by the PIC-based decoder from Bertrand (rxcontrol).(described also by DL4MEA at http://www.qsl.net/dl4mea/picadsb/picadsb.htm). My goal was to simplify the decoder design by optimum use of the PIC-microcontrollers hardware.

The pros of my decoder are:
The decoder interconnects the  miniadsb-receiver with the USB-port of the PC. Consequently, it has two connectors:
The picture at the right site shows the whole decoder on a universal board. It is made up from a small number of parts. With SMD-parts the decoder fits on a 4cm x 4cm PCB (single sided).

The one and only active part is the PIC microcontroller (PIC18F2455 or PIC18F2550). Its comparator converts the analog signal into a digital signal. The comparator needs a reference voltage. This reference voltage is produced by the decoder itself.

The PIC18F2550 searches in the digitized signal for ADS-B-data and reads this data.

Transponders send many different ADS-B-frames. The most valuable frames ate DF17-frames. DF18 and DF19 would be of same value, but are rarely transmitted. The decoder can forward all data to the PC or only DF17/18/19-frames.
Decoder-Prototyp

photo of the decoder
ADS-B frames contain a CRC checksum to identify faulty data. The decoder can check the correctness of DF17/18/19-frames and reject broken frames. (However, I suggest not to use this feature.)

If the decoder is connected to the PC, then it will be identified as additional serial port (e.g. COM-3 or COM-4). (For Windows the Microchip-CDC-driver is necessary.)

The figure below shows the schematic of the decoder.
The supply voltage comes from the USB-connector. L1 and C3 remove noise from the 5V supply voltage. C2 is part of the 3,3V USB-voltage regulator. Q1, C4 and C5 are the clock source for the microcontroller.

D1 & C6 generate 4,5V to pin3 of the miniadsb-connector. This is the receiver power supply voltage. Pin 1 of the miniadsb-connector is ground. At pin 2 the decoder receives the analog signal from the miniadsb-receiver.
Through the safety-resistor R2 the analog signal is fed into the comparator. R2 can be replaced by a wire, if the miniadsb-output contains a safety resistor.

Comparator
The analog comparator of the PIC compares the voltage level at the pins 5 and 2.
The mean output voltage of the receiver is about 700mV. The PIC measures the level at pin 3 (filtered by R1, C1). By the help of a PWM-signal (Pin 24) and a filter (R7, C7) a reference voltage is generated, that is about 100mV above the mean signal voltage. (the offset can be changed in software.)

schematic


The digitized signal leaves the comparator at pin 6 and is immediately fed back into the PIC at pin 11.

Pin 11 is the digital ADS-B input of the micrcontroler. If somebody likes to use a separate comparator, then the connection between pin 6 and pin 11 has to be removed, and the digital signal from the external comparator would have to be fed into pin 11.

LEDs
The LED3 shows the digitized signal. some seconds after the decoder was switched on together with the receiver it should only smoulder a little bit.
The LED1 is flashing up, it the start of a ADS-B-frame was detected.
If the whole frame could be received, then LED2 lights up until this frame was read out by the PC

Switches
Up to 6 switches can be connected to the decoder to control its function. Only 4 switches are contained in my layouts, they can control all important functions. But even they are not really necessary, because the decoder can be controlled via USB (RS232) by my software.adsbScope. If you plan to use only adsbScope, then connect RB0 (pin 21) of the PIC permanently to Vss (ground). If you plan to test Planeplotter as well, then install the 4 default switches of my PCB-layouts.

If the switch at RB0 is closed (remote) then the switches at RB2 and RB4 have no function. The decoder is remotely controlled.
If the remote-switch is in open position then the data flow to the PC is controlled by the switches. For details read the handbook.

Abbildung des Decoders

SMD-Version des Decoders
The figure at the left shows an SMD-layout with a size of 4cm x 4cm. But the size can be reduced, if necessary. By the application of the following simplifications the layout (single sided) can be shrinked down to 2.5cm x 3.5 cm without problems.

possible simplifications and savings
If adsbScope is used, then switches can be removed and pin 21 will be permanently connected to ground.
L1 is not really necessary.
R3,4,5 and the 3 LEDs are not necessary for the decoder function.
R2 can be removed, if the receiver contains a safety resistor. If you are brave then you don't need any safety resistor as well, and you will get e better analog signal.
Jumper JP1 is not necessary, its function is done by adsbScope.

how to use with Planeplotter
To use the decoder with Planeplotter the switch 4 (RB0, pin 21) has to be in closed position while the decoder gets connected to the PC. Now start Planeplotter. As Mode-S-receiver you will have to select "AVR receiver" and to choose the right COM-port for the AVR-receiver. Now click on the button with the green circle to start the work of Planeplotter. Now Planeplotter and the decoder collaborate. (If you use an outdated version of Planeplotter, then it may be necessary to open switch 4 now.)

optional: RS232-Interface
Beside the default USB-interface the decoder supports old-fashioned RS232 (115200bps,  8/1). It will be activated, if switch 3 (RB1/Pin 22) is closed while the decoder will be connected to the PC. RS232 delivers a lower frame rate then USB. I suggest using USB whenever possible. If RS232 is used instead of USB, then the decoder needs a separate 5V power supply. Depending on the length of the RS232-cable a driver circuit may be necessary. For details read the handbook.
The RS232 interface is only operational if the bootloader is flashed into the decoder-PIC. If u like to use RS232, then you will have to install the USB-interface as well to upload the firmware.



GNS 5890 : smallest industrial produced receiver/decoder

GNS5890
Not all aeronautic enthusiasts are electronic hobbyists  too.

There are some industrial products on the market. I just test out the GNS5890-USB-stick. The GNS5890 is smaller then a matchbox and contains the ADS-B-receiver and the decoder. An antenna with 1 meter long antenna cable is included. This set is ideal for mobile use.

The decoder is fully compatible to my adsbPIC-decoder, and will be delivered with the (relabeled) firmware 8. To use it with adsbScope the CDC-driver has to be installed. You can use the driver-CD of the GNS5890 or my ZIP-file (since 16.12.2011). After driver installation the GNS5890 is supported by Planeplotter too.

The GNS5890 is a very strait design without any frills. It has no DIP-switches, RS232-interface or input for external comparator. This made it possible to shrink the size. The result is a capable and reliable device.

During the first tests if outperformed my receive chain (a stocked triple dipole antenna, miniadsb-receiver and adsbPIC-decoder). The frame rate was 20% up to 100% higher, and more aircraft have been tracked.
I pimped my miniadsb-receiver a little bit, and now both systems are comparable.

Source
Global Navigation Systems – GNS GmbH

The GNS-company sold at least 3 different versions of the GNS5890. They all look the same.

1. Version
This is a small size 1:1 copy of the miniadsb-receivers and the adsbPIC-decoder in a small housing. The Decoder runs a relabeled adsbPIC firmware V.8

2. Version
The simple comparator of the adsbPIC-Decoder was replaced by the Comparator developed by DL4MEA (Günter) for his decoder. This is a efficient counter measure against the so called "Donut-effect". The firmware was optimized for a high frame rate and reports the version number V. 9.

3. Version
This version has a slightly modified firmware. It reports firmware version V.128. This was implemented to support a simple way to identify this decoder. However it made it incompatible to my software adsbScope V2.6. Thus i had to upgrade the software to version V. 2.7.
The second problem is, that this version starts to send adsb-frames to the PC as soon as it is connected to the USB-port. It is not waiting for a start command. This caused problems in my test environment (virtual machine under Debian) but is a minor problem for the most users.

All GNS5890 identify themselves at the USB-bus with the Microchip VID (0x4D8) and (i have no idea why) an individual PID (0xF8E8). Consequently the standard Microchip CDC-driver inf-file will not work with this receiver. The ind-file contained in my ADSB-ZIP-file was modified to support the GNS5890.




RTL1090 / ADSB#

RTL1090

And again: not all aeronautic enthusiasts are electronic hobbyists  too.

The fastest and cheapest way to get an own ADS-B-Receiver is the use of an DVB-T-Stick and the free software. This software can convert some DVB-T-sticks into ADS-B-receivers that decode the ADS-B-data and stream this data via network.
AdsbScope can receive this data from the network and visualize it.

Compared to a specialized ADS-B receiver this device will receive less data, but it is a nice cheap way to get an operational ADS-B-receiver.

Two different softwares are available. Both support DVB-T-Sticks with RTL2832U-interface chip and E4000 or R820T tuner-Chip.

  • The software RTL1090 is available at the Jetvision.de-Homepage and the related Yahoo-Group.
  • The software ADSB# is available at http://sdrsharp.com.

WARNING:
If you use RTL1090, then MLAT has to be deactivated. Check the menu point "Config - MLAT clock". The correct setting is "do not use MLAT".

ADSB#




PC-Software   adsbScope (Windows)

The PC-software receives ADS-B-frames from the decoder (via a virtual COM-port) and decodes the data. It identifies the aircraft and calculates there positions. All important parameters are shown in alphanumeric form in a table and/or on a graphic display.
Standard software under Windows-OS is the powerful Planeplotter (25 Euro). But I wrote my own software (freeware).

My software lists all detected aircraft in a table. All aircraft with known coordinates are show in a graphic display. Beside the aircraft the graphic display shows:
The outlines and names of all stated of the world can be overlayed. Some of the necessary files are contained in the ZIP-file, the remaining files can be downloaded and installed automatically by adsbScope.

Runways can be shown as well, if the necessary files are downloaded from jetvision.de.

If then adsbPIC-decoder is used, then the following parameters can be modified/red out:
  • type of data send to the PC (all or DF17/18/19 only,  with or without CRC-check)
  • difference between mean analog signal level and comparator threshold ( 40 .. 200 mV)
  • activation of the bootloader
  • reset of the decoders
  • value of analog signal level and comparator threshold
software adsbScope

rxcontrol and adsbScope
adsbScope can use the rxcontrol-decoder (firmware 2.6 or later). After a click on "Connect"  the  rxcontrol-decoder will be identified and the buttons "Start" and "Stop" become visible. They are used to start or stop the data flow from rxcontrol to adsbScope.

The most functions of rxcontrol can not be remote controlled. the user has to use the switches at the decoder. During tests adsbPIC has reached higher frame rates then rxcontrol.



Appropriation

Antenna
Take a 65 cm long copper wire (1.5 sqmm) and bend it into the shape described before (3 dipoles and 2 horizontal loops in between). Solder the lower and of this stocked dipole to the middle pin of a BNC-connector.
Bend a ring from copper wire, that fits tight around the thread of the BNC connector. Solder 3 or 4 wires (each 13 cm long) to this ring, the wires should point into 4 different directions 90 degree interspaced. Mount the ring with the 4 wires at the thread of the BNC. Place the antenna at a good place. the stocked dipole should be vertical, the ground-wires have to be bend down by approximately 30 degree. (Your first antenna may look as ugly like this example.)
Use a 50-Ohm coaxial-cable with coax connectors to connect this antenna with the miniadsb-receiver.

miniadsb
At the miniadsb-homepage is a detailed description how to build and test the miniadsb receiver. You will need experience with SMD-parts and a good soldering equipment.
After you finished this successfully, then install an additional Schottky diode inside the power-supply wire of the receiver. There is enough place inside the receiver-housing for this diode. Don't forget to replace the output resistor of the miniadsb (during test 4,7 k) by a wire or a 1k-resistor. Solder 3 wires to the miniadsb receiver terminals (power, ground, output) and connect a connector for the decoder at the end of this wires.

Decoder
The decoder is easy to build up (compared to the receiver). Install an IC-socked for the microcontroller, do not solder the PIC  directly into the board! You will have to load the bootloader into the micrcontrollers program memory. Therefore you need a PIC-programmer or a friend with a PIC-programmer.
Close switch 4 (RB0, remote). Plug the PIC (now with the bootloader) into the IC-socket and connect the decoder by USB cable with the PC. Windows will ask you to install a driver for the new detected USB-device. Install the Microchip-MCD-driver.

Now use the software USBoot to load the firmware into the decoder. Then disconnect and reconnect the decoder to reset the device. Windows will now detect another new USB-device, and asks you to install the right driver. Now install the Microchip-CDC-driver, it is responsible for the virtual COM-port the decoder needs to communicate. the installation of the decoder is finished. If you connect the decoder to you PC it will show up as a COM-port.

Check the receiver-power-supply-voltage and -polarity of the voltage at the decoders connector. If the polarity is correct am,d the voltage is roughly  4.5 V, then connect the receiver to the decoder. Measure the voltage level at pin 5 of the PIC, it should be about 700 mV
Connect the antenna to the receiver.

If now (decoder, receiver and antenna are interconnected) the USB-cable will be disconnected and reconnected, then LED3 can light up. But after some seconds (3..5 s) LED3 should start to dim and finally it should only smoulder. This shows the correct function of the automatic comparator-reference-voltage-regulation. (The same should happen if one disconnects and reconnects the cable between receiver and decoder.)

Open now switch 4 (RB0, remote). The LEDs1 and 2 start to flicker, the decoder receives data. With any terminal-program one can now receive and watch the raw ADS-B-data.
If one likes to use adsbScope or Planeplotter, then switch 4 has to be closed and the USB-cable has to be disconnected and reconnected to reset the decoder. Now LED1 and 2 are off again.

Software
The adsbScope-software for Windows can be downloaded as ZIP-file. It has to be unzipped into the desired program folder (including subdirectories). After this the software can be used immediately. If the software don't works in WinVista or Win7, then try the compatibility-mode (right mouse button).
Graphic display: Use the mouse to adjust zoom level and to select the right area of the word.
Use "select COM-port" to choose the virtual COM-port of the decoder. Use "Connect" to start the ADS-B data processing.



Possibilities and Limitations of Decoders
The goal of decoder developers is to detect as many ADS-B frames as possible. However, a microcontroller can never catch all frames because of the following three problems:
  1. The identification of a frame header is done by a program loop. This loop monitors the comparator-output. The probability to be at the right point of this loop during the short pulses of the frame header is never 100%. By the use of an extremely short loop and a high processor clock I reach (under optimum conditions) up to 95% detection probability.

  2. A received frame has to be processed and handed over to the USB-interface. During this time the decoder is deaf  for new frames. This time is in my decoder between 75 and 140 us.

  3. Finally the decoder has to transfer the received data to the PC. During this transfer the decoder can not receive new data. My decoder needs 35 ... 120 us to transfer a block of 1..9 frames to the PC (wit 12 MBit/s).
For every ~100 us long frame the decoder needs ~200 us for processing and transfer. This sounds bad, but is not such a big problem. The theoretical limit is at ~200000 Frames/min (fpm).
In high density areas may be 20000 fpm in the sky. My decoder may pick up~6000 fpm. At this load the decoder is deaf for ~2,5% of the time and will miss 150 frames/s. To prevent this loss a complete different hardware would be necessary (e.g. FPGA). The user has to decide, if this is worth the additional costs.

Under normal conditions every aircraft radiates two DF17-frames per second. In addition to this ~10 other frames are radiated.



Important changes of Version 2.6-test compared to Version 2.5
Important changes of Version 2.5 compared to Version 2.4
Important changes of Version 2.4 compared to Version 2.3
Important changes of Version 2.3 compared to Version 2.2
Important changes of Version 2.2 compared to Version 2.1
  Important changes of Version 2.1 compared to Version 2.0


to-do-list



Downloads

Latest
Version 2.7


Previous Version 2.6




Links


additional files for adsbScope
runways (copy the *apt.out - files from the ZIP-files to /ssb1/ )

industrial Products
GNS 5890

Antennas
Groundplane
ADSB J-Pol antenna
Colinear-Coaxial

Receiver
miniadsb

other Decoders
PIC-Decoder from Bertrand
PIC-Decoder from DL4MEA
BEAST from DL4MEA (FPGA)
Receiver with ATMEL-Decoder
Receiver with FPGA-Chip

other Software
Planeplotter (shareware)




History

19.04.2014
Version 2.7 online
21.03.2013
Bugfix-Version 2.6_f3online

09.02.2013
Bugfix-Version 2.6_f1online

26.01.2013
Version 2.6 is now the regular Version of adsbScope

16.12.2012
Test-Version 2.6 test 8 online

08.12.2012
Test-Version 2.6 test 7 online

adsbPIC-Decoder:
adsbScope-Software V 2.6 test 7

12.11.2012
Test-Version 2.6 test 6 online

adsbPIC-Decoder:
adsbScope-Software V 2.6 test 6

11.05.2012
Test-Version 2.6-test-4 online

adsbScope-Software V 2.6-test-4

18.03.2012
Test-Version 2.6-test-2 online

adsbScope-Software V 2.6-test-2
09.03.2012
Test-Version 2.6 online

adsbPIC-Decoder:
adsbScope-Software V 2.6

19.01.2012
Version 2.5 online

adsbScope-Software V 2.5

25.12.2011
Version 2.4 online

adsbScope-Software V 2.4

16.12.2011
updated ZIP-file: CDC-driver updated to support GNS5890.

10.12.2011
Version 2.3 online

adsbPIC-Decoder:
adsbScope-Software V 2.3

18.10.2011
Version 2.2 online

xx.09.2011
English version of this page

19.07.2011
Version 2.1 online

adsbPIC-Decoder:
adsbScope-Software V 2.1
.. many things happened ...

22.06.2010
first version 0.9 online


back to my projects , PIC-Microcontrollers , Electronic , Homepage
Author: sprut
published: 31.08.2011 (16.06.2010 in German)
last changes: 19.04.2014