User Tools

Site Tools


2m0iig-ads-b-journey

My ADS-B Reception Journey

Introduction

The last time I tried ADS-B reception I had to put my antenna inside, receiving signals through several walls and floors of a big Scottish tenement block, and it was absolutely awful. I’d receive basically no positions, just some basic data, and I literally only had one, single plane in a day with a full position track in any particular direction. I tried making a 8 segment coax collinear antenna out of some RG59 for it and a 1/4 ground plane, but owning no VNA at that time I couldn’t tell how good the antennas were.

Now that I’ve finally got a mortgage and can drill holes in walls that I actually own I thought I’d give this another go. I have a NanoVNA now which helps as well as a lot more knowledge and experience of radio more generally. I was hoping as well that my new place being in a more open space and relatively close to Edinburgh Airport would help as well. These reasons and more have absolutely made my second go a complete success, and after bothering the OARC Discord with it for the best part of a month I thought I’d document everything here with some interesting notes, graphs, and analysis.

I’ll also add some tips I’ve picked up along the way in areas such as software and hardware setup, including how to keep the CPU usage and temperature down on the Raspberry Pi, which is what I ended up selecting as the computer to run the setup - although I did also use an RSP1A on a Windows 10 laptop for some additional testing.

The eventual goal with this is to get an antenna up on the roof of the flat or possibly a fully external setup in a waterproof enclosure, but for now the antennas are set up on a bracket at the front of the house approximately 2-3 metres off the ground, basically between the ground and first floors of the building. This isn’t ideal, but as I’ll demonstrate later this was still perfectly adequate for a very wide reception range, although the building did block signals behind it quite significantly.

Raspberry Pi Setup and Optimisation

  • RPi Zero W - stock @ 1000 MHz to start with
  • Nooelec NESDR SMART v3 RTL-SDR Dongle - it’s a good one, but has no bandpass filter or any kind of pre-amp like others you can get
  • 2A USB power adapter - enough to give everything enough juice, which will be useful when overclocking

An RPi Zero W is perfectly reasonable for the task of ADS-B reception, but you may need to make some changes to get the most out of it, particularly if you are in a very high traffic airspace. There’s a bunch of things you can do to maximise spare memory, lower CPU usage, and generally thin down the already-quite thin Raspbian Lite default setup. They are well documented, but I’ll briefly summarise here, along with some links for more info.

  • Disable HDMI
  • Disable sound
  • Disable Bluetooth
  • Disable interfaces like SPI/I2C if not disabled by default (they were for me)
  • Decrease VRAM to minimum for headless operation
  • Disable unneeded services
  • Disable on-board LED to save power
  • Overclock the CPU
  • Heatsinks and other cooling methods

By far I found that disabling Bluetooth and HDMI gave the biggest reductions in CPU usage, but I also was able to save a bit more by dropping some services such as the avahi-daemon that enables hostnames (IP address-only access from now on!). I checked every service and a ton of processes to see where I could kill some - and did a lot of Googling to assist with this. Decreasing the VRAM is an absolute sitter as it’s left at a rather-high 64 MB by default when 16 is more than adequate for SSH-only access.

Overclocking is a good idea if you have a good PSU and I was able to increase the arm_freq and the core_freq both by 50 MHz. 100 made it stop booting and I couldn’t be bothered to spend any more time tweaking that. Overclocking did bring CPU usage down a little bit - at the expense of a tiny increase in CPU temperature. Nice.

All of this tweaking was done over the course of the whole project and various points where optimisation occurred are clearly visible on the overall CPU usage and temperature graphs over the duration. You can also see later increases as I used this headroom to install and run other software and make configuration changes to the overall setup to try to boost performance or add features. It's also worth saying that I didn’t investigate any tricks to lower SD Card read/writes, logging, or anything about booting without an SD Card.

Radio/Feeder Software Setup and Optimisation

Here’s a summary of my top tips in terms of getting the most from the Pi Zero. I talk about them in the diary below, but the long and short of it is:

  • tar1090 is really CPU-heavy, so if you can do without it it’s definitely recommended. It’s so good though…
  • graphs1090 is also quite heavy on the CPU, although this can be mitigated somewhat by reducing how often the graphs are actually drawn
  • For dump1090-fa you want to keep the gain down as much as possible as this seems to help, maybe because of a lower noise level. And you will certainly want to disable AGC. Weirdly I couldn’t fully disable it when I had the gain set to the maximum possible value, although this may be because of bugs relating to RTL-SDR gain in the software
  • Every feeder increases system load, so pick the ones you REALLY want first. You may not be able to do them all if you’re in a high traffic area
  • Same with MLAT. Do you actually NEED it? It does increase load a bit, depending on how much traffic it is needed for

Progression Diary

3rd October 2022

Day 1. I decided to make a very simple 1/4 wave ground plane antenna using the typical design adapted from a chassis-mount socket of whatever “end” you want (I chose BNC as I had some leads handy). Initially I set this up using the RSP1A and laptop and hung the antenna from my curtain rail, attached to a coat hangar (my indoor antenna holder of choice).

I left it going for the late afternoon, evening and overnight hours and had a look in the morning, and it’d honestly done pretty well. Lots of local traffic off the runway on takeoff (we're a mile or so off the runway centreline, I think). A surprising amount of overflights (signal through the roof and first floor) and some other stuff circling locally. The range was pretty awful though. But as a first test this was absolutely a success, so it was time to try something else the next day.

4th October 2022

I popped the antenna fairly low down on the window sill on the outside and ran the cable back into the room and closed the window on it. And it was like night and day: so many positions from those planes I’d been receiving, including some on the landing approach and way more overflights. I only left it for an hour and decided immediately that I needed to get something up a bit higher and set something more permanent up.

Recently we had cable installed and the nice man from Virgin Media accidentally left behind some 75 Ohm RG59 cable. It’s not perfect for the job, with the dongle being 50 Ohm, but the loss at 1090 MHz is much better than with RG58. I also had access to an unused hole in the wall to feed the coax in to the workshop. I grafted the 1/4 wave ground plane antenna onto the end of the RG59 lead and ran it back in and terminated it with a short length of RG58 that I hacked onto the end, followed by a BNC plug. This isn’t really a good way to go if you’re trying to match the impedance, but on receive these things matter less.

A spare hanging basket bracket on the wall near the workshop window was the mount for the antenna, approximately 2-3 metres off the ground (I haven’t measured it yet) and I made it all neat and tidy by reusing some wall clips already stuck in to the outer wall. I had previously prepped the RPi Zero W with the dump1090-fa software and some software to feed some tracking websites and basically just went for it. An SMA adapter was the final link in the chain to get it onto the dongle. From this point on the uptime has basically been 99+ percent.

5th October 2022

One thing I’ve noticed is that that tar1090, despite being the best viewer available in my opinion, uses a surprising amount of CPU time, particularly when it’s archiving tracks which is a thing it can do (more later). So I’ve disabled it. I miss it already, but I did lower the CPU a fair bit. I’ve done a lot to lower the CPU use overall, as the graph here demonstrates.

It's also very amusing to see the CPU usage go up and down in a predictable pattern during the day as traffic increases and the load on the system increases as a result. More data = more processing = more data to upload (multiplied by the number of services you're feeding, of course).

10th October 2022

End of the first week, and I’ve been so pleased with the results. I’m feeding 5 websites: ADS-B Exchange, FlightRadar24, FlightAware, and the OpenSky Network and I’ve managed to keep the load averages between 1 and 2. Not ideal but better. I’m getting around 5-600 planes a day.

One thing I have read about is that the dynamic range of the RTL-SDR dongle is from about 0 to -35 ish dB and that ideally you want planes just on the absolute fringe of reception to tend towards that lower figure by lowering the gain a bit. This increases the dynamic range of your receiver at possibly the expense of reception range. Dynamic range increases may make for a better decode, and thus possibly better data quality.

I discovered that the AGC in dump1090-fa had pumped the gain of the dongle to an apparently erroneous maximum value of 58.6 dB when the maximum is supposed to be 48.7. So I knocked it back one step, which is then 48.7 and disabled the AGC altogether. If it needed it at max all the time then there's no benefit to keeping AGC on. The CPU usage dropped, the dynamic range of signals DID increase, but I did lose some signal strength at the maximum end. From -2 to -3 dB. That -3dB measurement is seen as a “strong” signal and should account for about 5% of your tracks to ensure you’re receiving everything decently, both close by and far away. The decrease in CPU usage makes me think that higher noise levels may increase the amount used by the demodulator as it digs out signals.

Sadly I had an immediate drop in the “tracks with only one message seen” graph without much of an increase in data quality (the tracks with more than one message seen) or much increase in positions either which made me think I’d messed it all up. But I did leave it for a week or so. I also thought I’d lost out in overall message rate. Seems that if the receiver wasn’t being overloaded with strong signals then there was no point reducing the gain - anything else was just damaging the maximum range. Just depends where your priorities are.

14th October 2022

At various points in the week I had bent the elements back into shape and fixed any slipping off the bracket, as the wind and rain sometimes gave them a battering. I also tried to do some trimming. I didn’t see any appreciable difference in tracks that could be discerned to anything other than daily traffic.

Recent work to decrease CPU usage has made me reinstall tar1090 again. There’s enough headroom, I think. Especially after I overclocked the CPU. So I’ve done it. Ahhh, that’s better. An immediate, huge jump in CPU as you can see, but worth it. I wish I could disable the other views I don’t need, possibly saving on CPU, but nope - most of the feeders with internal viewers don’t let you disable them. Plane Finder has a nice 3D rotatable range plot view that I’ve come to like, though.

I think the next thing I'd like to do is to try and see how I can dissipate heat more from the entire system. There is a tiny heatsink on the main RPi Zero W core, and there's nothing but the metal outer case on the Nooelec dongle (which runs quite hot). Maybe some fins of some kind on the dongle would help increase the surface area of that, but ultimately any other cooling for the RPi would need to be active rather than passive as there's not much more you can do.

17th October 2022

End of week 2. I’d been analysing my tracks using tar1090’s excellent ?ptracks switch I eluded to earlier which gave quite an insight into the blind spots in my coverage by showing everything from the last 8 hours. I was able to use the altitude filters to make some nice low altitude (0-10k ft) and high altitude (10k+ ft) track plots. This made the arrival and departure routes to Edinburgh Airport really pop out of the data, which looked really nice. Here’s a low and high plot that I took at the end of the day after installing… a new antenna!

Low altitude tracks (0-10k feet)

High altitude tracks (10k+ feet)

I noticed looking at the tracks from earlier in the experiment that planes coming into land over the city and further out over the water were blocked due to some hills and buildings, resulting in a total loss of data or a loss of positional data. I wondered if I could improve this, as well as the maximum overall range, with some more gain. I didn’t want to use a preamp as I knew I had lots more I could try first. I decided to ditch the 1/4 wave ground plane antenna and move to a coax collinear again, although I couldn’t be bothered with an 8 segment one and I also didn’t want something too tall out front that would annoy the neighbours. So I settled on 4 segments and kind of winged it.

Unfortunately I have absolutely no pictures of the construction of the antenna, but I followed a simple guide found online and put it inside a 20mm PVC conduit capped with lots of electrical tape which won’t really hold off the elements for very long, but we’ll see. The cable comes out of the bottom and again the exit hole is wrapped with electrical tape. The plug end is a twist-on F connector which was a bit looser than I’d like, so I taped it up securely. An F-to-SMA adapter finished off the chain, resulting in a fairly clean signal path with just a small amount of loss due to the impedance mismatch.

Hot damn, by the way. Switching the old antenna out for the new one more than doubled my message rate, although there was a small decrease in tracks seen with only one message as you can see, suggesting it wasn’t quite tuned well or wasn’t quite enough to pull in the edge case signals maybe? Or had a slightly different pattern. I also had an immediate and substantial increase in range of about 50 miles. Nuts.

20th October 2022

OK - I’ve had enough, I’m turning the gain back up. I’m convinced over the past week I’ve made things worse. I’ve only had 4-500 aircraft a day, a pretty big reduction from 600. So, back up it goes, dynamic range decreased, but signals and tracks are now back to where they were right at the start of the experiment, pretty much. Only with MUCH better range. My position numbers are through the roof also with the new antenna pulling in much stronger signals all around. I have discovered that with it set to maximum you can’t actually turn off AGC though, so a new theory I have now is that it’s actually the AGC increasing the CPU usage so much and not a higher noise level.

21st October 2022

Yeah, definitely better. I’m considering adding another feeder - RadarBox - but the CPU load is quite high now with the gain back up and tar1090 running. I’ve also enabled MLAT as well which adds more processing overhead. So CPU percentage is up to around 80% peak. And temperature at times is now edging towards 50 Celsius in mid-October. I’d hate to see that in June, but it’s still lower than the 53 Celsius from when I booted up Raspbian Lite for the first time and no tweaks carried out.

Also, here’s a nice thing. I don’t need graphs1090 to draw graphs every 2 minutes, which is what I have it set to now. And I’ve also noticed that drawing all the graphs a really seems to take a long time as well. In fact, sometimes it looks like it may collide with the next graph draw a bit. So last night I set it to 5 minutes to see if that reduced CPU usage.

Woah, that’s nice, it seems to have really dropped it. We’ll have to leave it for a few days to be sure, but that’s a nice drop and should lower the temperature a bit too. I do wonder how much I *really* need this to be drawing, but I suspect there are diminishing returns here. I may have hit the limit already if one redraw doesn’t bleed into another now, which is what it looks like.

I’ve also decided to shorten the feedline a bit as I have some leftover length coiled up. So, I’ve found a better location a bit further away from the mains chargers in my workshop, cut the cable and re-terminated the end. This seemed to increase the nearby calibration beacon’s steady signal level a little bit, suggesting I’ve definitely improved the loss. We’ll see how that translates to coverage tomorrow.

22nd October 2022

Ok, that’s Radarbox added. CPU quite high now, approaching 90% at peak, and I’m worried it’s having an effect on the ability to process data (although today went VERY well). So I’m wondering about what to do about that.

Also I tried to improve the network situation today by adding a WiFi booster in the same room as the system, but sadly it kept falling off the network itself and was pretty unusable, so I reverted back.

23rd October 2022

Well, gone for some overclocking today! And trying to find hidden settings for the RPi to do stuff. I’ve disabled composite out (so there’s absolutely no display now) and I’ve also managed to overclock the Zero’s core_freq and sdram_freq from 450 MHz to 500 MHz and increased the voltage to 1.4 Volts. It booted up and remained stable, so I’m going to leave it going and maybe try an arm_freq of 1075 MHz tomorrow after gathering some data. This did reduce the dump1090-fa CPU usage a bit (specifically the USB part) which I found interesting. More work to do here, I think. Temperature increased a tiny bit. JUST over 50 C but it isn’t the height of daytime, so we’ll see tomorrow.

Update: 1085 on the ARM, 550 on the core and sdram. Nice. The CPU graphs are coming down bit by bit. The temperature is still fairly stable. It’ll be really interesting to see if this translates into better performance from dump1090-fa.

And here’s both recent graphs to demonstrate this, you can see that over the course of a few hours’ tinkering I’ve managed to bring both the main CPU load down and the load of dump1090-da specifically. Any decrease is good and should give more headroom during the day tomorrow when traffic is higher.

24th October 2022

Well, a big day today. I’ve got and shortened the coax feedline by another few metres today and stuck the RPi physically to an outer wall. The result is a system that is running a full 2 degrees C cooler than it was and another slight increase in incoming signals. I hit 500 messages/second today for the first time, which is a nice milestone. The new location is also slightly closer to the WiFi too. I think I’ve Moneyballed this as much as possible now. I’ll only get bigger improvements with hardware upgrades I think. There’s not much point forcing more messages into such a slow system though, as it won’t be able to cope. There’s an argument for pairing an antenna upgrade with a replacement RPi 3B or something with a bit more grunt. I’d actually wager that with some judicious use of cable clips I could lose another few cm off the lead, but I may well get a desk unit here so I need to think about that and leave enough cable to sit it on it when I get one.

26th October 2022

Well, I'm having issues with stability on the Pi, including 7 hours of downtime just after I went to bed on the 25th, so I've decided to roll the overclock back a bit. We're now on 1100 for the ARM, and 575 for the SDRAM and Core. We'll see if that helps, and it's a shame that it happened on a day where I was due to break my aircraft per day and messages per day records. So we'll have another go at that another time.

Other than that I have nothing else to report: the system is working well, the antenna seems to be still fixed well to its bracket, and I've had no reduction in performance that would suggest water has entered the tube somehow.

31st October 2022

Oh god, oh god. The Pi has been misbehaving so much over the last few days. Given how much it survived ok before the last few days with things underclocked I think it's the SD Card rather than the Pi misbehaving due to overclocking. So, I'm going to get myself a brand new Class 10+ card, 16 GB or so, and then either clone the current one or set everything up from scratch again, making sure to use the same sharing codes/IDs for the feeders.

This is, it has to be said, a bit frustrating. Maybe it's worth using another drive like an SSD or USB stick, but I am totally out of ports on the Pi Zero, and because of the shortages at the moment Pis are as rare as rocking horse shit or cost an absolute bomb, so the idea of getting a Pi3 to replace this will have to wait a while.

6th November 2022

Well then. It’s been a shitty week for the project. The crashes and corruption got to the stage where I genuinely couldn’t log in via SSH. Like, I’d connect and the window would immediately close after it processed my login. Something was toast. So I dug out a spare 8 gig card and set it all up from scratch.

I haven’t overclocked it at all, because I’m terrified that’s what did it in before, but I can definitely tell that I haven’t done it. Grr. The CPU temp is lower though without the overclock. I’ve also taken the lid off the Zero’s case and the temp dropped a few C. Nice! I don’t think it needs to be covered in the position it is in, so I’m leaving it off for good. I’m honestly going to just skip the overclocking. It’s not worth the hassle.

I am pretty sure we can leave this entry here, although I did just start working on an 8 segment antenna, because I am a glutton for punishment.

7th November 2022

Oh my, the 8 segment version is fantastic! I put it outside and set it up at a similar height, but with more open coverage to the north, previously blocked by my house. I gained two more planes that the 4 segment antenna didn't receive. Very encouraging. I need to get it in some conduit and maybe install it full-time, but it is a fairly long cable run so that has to be considered too. Maybe time to invest in a pre-amp and a bias-T board.

We've also started overclocking again, because I am a glutton for punishment. Slight changes each time, without going overboard. Seems stable so far. I'm learning a lot about the voltages for the ARM/Broadcom chips, that's for sure. In preparation for doing this I also decided to stick a crappy 5V fan that I rescued from an old netbook to the top of the RTL-SDR stick, with the exhaust pointing right at the Pi Zero. The result was a ridiculous 10 degree Celsius drop. It's the most shonky setup ever, held on with Blu Tack (not sure if that is the best thermal transfer material…). It's plugged into the Pi's GPIO pins, 5V and GND, and I'm honestly over the moon with the result.

Finally I adjusted the antenna outside to make it a bit more straighter and not slanting to one side a tiny bit. I don't know how much difference that will make, because signals from the planes are pretty strong anyway, but it can't hurt to make it perfectly vertical. The mount I'm using is already slightly bent so I'm having to accommodate for that.

20th January 2023

Well, where to start… Since the last update the Pi Zero has been replaced by a Pi 3B+, I have written some software to help with automatic installation of all of my custom setup, I have written some software to act as a web-based dashboard with full mobile compatibility, and I've also made a Python app that can keep an ear out for certain planes matching criteria that you specify, or if a plane is over a particular specified area. Basically I've been very busy.

The 8 segment version is inside a conduit with feedline attached, but definitely isn't going to work on the current bracket, so I'll need to think about that a bit more. The wind does tend to blow the 4 segment around a bit and makes it shift or tilt a tad, and every few days I need to shimmy up a ladder and straighten things out, so the 8 segment would be even worse given the extra weight. Maybe a summer project, but I have to be careful to not block upstairs' view (to be a good neighbour and all that).

Plane counts are very up and down, though - I think it is because it is winter and the traffic is much less anyway, but there are still occasions where I think I've broken something, or the antenna has bust somehow. This shouldn't be possible due to me replacing the ends of the antenna recently with proper end caps instead of lots of tape…

I do think this blog is ending here, but it has been fun and I enjoy the fact that I have a somewhat mature system now that has been going for 3 months. I won't challenge any leaderboards, but I have a nice source of data that I can look at. I've picked up lots of military action, such as F15s and Eurofighters, and I've picked up lots of royal flights. I also picked up Elon Musk going to the World Cup. You can't hide outside of America, bucko…

I hope this was helpful for folk, and do please get in touch if you got something from this or need any advice.

2m0iig-ads-b-journey.txt · Last modified: 2023/01/20 09:14 by 2m0iig