Taking a "Selfie" from space

Decoding images from weather satellites with a homemade antenna and open source software

On October 4th 1957 the Soviet Union launched the world’s first man-made satellite, Sputnik 1. The achievement caught the world’s attention and spawned almost twenty years of competition between the United States and the Soviet Union. At the time, wonder and awe over the technological advancements were at the forefront of the public’s imagination (alongside a healthy amount of paranoia).

Today there are around 3,372 (source) vastly more complex satellites, continuously whizzing over our heads. Despite many of us relying on them daily to navigate, entertain and connect us (GPS, TV and Telecoms satellites to name a few), it’s a rare thought to consider them as tangible objects that fellow humans carefully shot into orbit aboard giant rockets. Sadly, I think, we end up taking these achievements for granted.

Sputnik 1 - Credit: Don Mitchell

So, in an attempt to rekindle some of that shiny awe and wonder that was once rife in 1957, I stumbled on an idea for a great home project where the goal is to “take a selfie from space” using one of those satellites (of course, in the loosest sense of word “selfie”).

What are we doing?

What may come as a surprise, is that a few of the satellites orbiting our planet are constantly transmitting signals that anyone with the right equipment can receive and decode. Hidden in these signals are large amounts of scientific data, such as sea surface temperatures, cloud formations and even the locations of arctic foxes in Canada (source). Crucially some of these encoded signals contain live high-resolution images of the earth’s surface.

It turns out that we can build a cheap antenna which is capable of receiving these signals from three US Weather Satellites NOAA 15, 18, 19 satellites and a Russian Meteor M2 weather satellite. Combine this with a receiver and some open-source software, and we can decode the data into a live picture beamed directly from space. So, here goes.

Step 1. Designing an antenna

All the weather satellites mentioned above transmit signals at a similar VHF frequencies (VHF : Very High Frequency), around 137 MHz, so building an antenna that can receive these signals is the first step in obtaining the image data. The antenna we will build is largely based on an original design by a blogger, Adam 9A4QV (here is a link to his original guide), but with a few modifications.

Antenna design basics

As a engineer in product design, it’s not uncommon to hear clients mention that they need an antenna for a new connected product. Now my usual response is to duck away from the topic until I can find someone who actually knows what they are talking about. I am referring to these people who are best described as RF wizards. Appropriately named, as the actual process of designing an effective antenna is not a straight forward one, and involves no small amount of “wizardry”.  

The RF wizard I ask for help often responds to my requests in what seemed to be cryptic Latin, along the lines of ,”Well Steve, what’s the gain, radiation pattern, impedance, bandwidth, resonant frequency and polarization you seek?” This was enough to scare me off, back to the safe and comfortable world of mechanical engineering, where we use real numbers, and generally things make sense. 

However, during this project I thought enough is enough, and I decided to actually learn what some of that gibberish means and maybe even apply some of the theory. So for reference, here is my basic understanding of why our homemade antenna does what it does. If it all sounds terribly boring click below to skip this section and just build the thing.

Frequency

First lets consider “Frequency” and how it relates to the shape of our antenna. As we now know that the weather satellites transmit their signals at frequencies at around 137 MHz, we therefore need to factor this into the design, and it turns out that this a major consideration when we calculate the antennas length. 

Length is important, as our antenna relies on the “resonance principle“. Essentially, the incoming radio waves induce a small voltage in the conductor of our antenna, which causes a small current to flow. When the current reaches the end of the conductor it reflects (causing a 180-degree change in phase). The aim here is to increase the current flow at the end of the conductor and this can be maximized by designing a half wave dipole antenna (pictured).

The oscillating currents (black arrows) flow down the transmission line and through the receiver (represented by the resistance R). As the length of the antenna is one half that of the incoming wave, the oscillating field induces standing waves of voltage.

Designing this type of antenna involves placing two conductors end-to-end, each is one quarter the wavelength of signal (total length = half a wavelength, hence half wave dipole). The trick here, is that this arrangement places the induced current 180 degrees out of phase in each leg, meaning that one conductor is always driving current into the receiver, therefore resonating. 

See left for the Half Wavelength Calculation.

Impedance

Now that’s seems a scary word, all you need to remember that the impedance is what ties the voltage and current in our antenna together. It’s made up of two things, resistance and reactance. Resistance is an easy one, we all should be familiar with the concept of a opposition to current flowing, which is present in all conductors and components called (obviously) Resistors.

Now reactance, that may be new one. It can be thought of as the “inertia” against current flow and is present whenever we store energy in our circuit in the form of electric or magnetic fields. This happens in components like Inductors and Capacitors. When a current is alternating inside our antenna a voltage drop caused by a pure resistance is always in-phase with the current, and a voltage drop caused pure reactance is always 90 degrees out-of-phase with the current. The impedance is the combined effect of these two forces.

Where it goes a little bit squiffy is how we represent impedance as a complex number which has a real and an imaginary component. Just remember that whenever we use imaginary numbers in physics this often represents some kind of phase shift. This is also true for impedance, the imaginary component relates to the “reactance”, which causes a phase shift, and the real component relates to the “resistance” which does not.

Let’s reflect on how this relates to our antenna design. What is important to realize is that real part of the impedance represents the actual power that is absorbed by the antenna (which is good). And the imaginary part representing all the power that is stored in the field near the antenna (which is bad). Also don’t forget that the impedance of the antenna is very frequency dependent, and we refer to an antenna as “resonant” (an optimum state) when the imaginary part of the impedance is zero.

It turns out that because of you know, physics, a half wave dipole has an impedance of 73+j43 ohms. Well hold on a minute, looks like there’s a 43 in front of that imaginary component! Therefore, by definition a physical half wave dipole isn’t resonant, since the reactance is non-zero? Annoyingly this is true, so how can we rectify this? Well, we could include some additional “matching” components to remove the reactance, but there is an easier way.

It turns out that you can simply make the antenna just a little shorter. At slightly less than a half wavelength the reactance drops to zero and the antenna becomes resonant, no matching device required – awesome.

Source - Antennas in practice, Alan Robert Clark Andr´e P C Fourie

To apply this handy hack, we can use the graph shown here, which plots the ratio of a half wave length to diameter of the conductor used against a shortening  factor “K”. As we are going to be using 4mm aluminium rod, and we know that half a wave is 1.09 m we can calculate a ratio of 273, which gives us a K factor of 0.97. Therefore, all we need to do to achieve resonance is reduce the antenna length by 3%.

Impedance matching & transmission lines

So now we have an antenna design, how do we connect it to the receiver? Well, we use a cable which is often referred to as a “transmission line” (TX for short). It’s no surprise that the transmission line also has an impedance (Z0), if the antenna impedance doesn’t match the transmission line impedance, power will be lost at the junction. Also, because we are working with high frequencies the length of these wires quickly become a fraction of the wavelength making the situation a little more complicated. The thing to remember is that if the two are matched, the input impedance does not depend on the length of the transmission line, and no power is lost at the junction.

We know that after adjusting the length of our antenna it’s impedance is 73 ohms (assuming there is no complex reactive component remaining), and we know that our transmission cable (which is matched to the input of the radio) has an industry standard impedance of 50 ohms (most RF systems are designed around a 50 ohms impedance). What’s this? 73 doesn’t equal 50, there appears to be a mismatch.

Before we get too worried, let’s check what effect this mismatch is going to have. Now as this is such an important concept in RF electronics its again no surprise that there is a set of dedicated parameters that can be used to help us describe the quality of an impedance match.

Let’s consider “Reflection Coefficient”, “Mismatch loss” and “VSWR”. 

The Reflection Coefficient is the ratio of the (complex) amplitude of the reflected wave to the (also complex) amplitude of the incoming wave. Here we see that in theory this results in 0.186 for our circuit. Now we can use this value to calculate a “mismatch loss” which will give us the actual power loss in decibels due to the mismatch. -0.154 dB, is only about a 3.5% loss in power, so not such a big deal. But there is actually one last trick we can use to help impedance match and improve the overall performance our antenna. Also, for reference another parameter that is used to describe impedance matching is expressed as a voltage standing wave ratio (VSWR). I found this video (link) very helpful for understanding the concept.

Polarization

To conclude the design of our antenna there are a couple of considerations left to factor in; orientation and polarization.

We should be aware that our satellites are transmitting circularly polarized signals (RHCP signals). To get the best possible antenna performance, instead of a half wave dipole we should really use a helical antenna or something that is specially designed for this type of polarization. However, these are difficult to build, and it turns out that there is only -3Bd loss if we use this much simpler half wave dipole (-3db in vertical or horizontal orientation). See Adam-9A4QV guide for more detail on this.

Orientation

There are a two obvious choices of dipole antenna orientation – we can have either a vertical or horizontal arrangement. To help us understand the implication of either, we can use a handy software tool to simulate the behavior of each antenna and plot in 3D the gain pattern to help us make our decision. (The software used is called 4NEC2 which is available free of charge at: www.qsl.net/4nec2/).

As you can see from the 3D plots, a vertical half wave dipole antenna will have a kind of a donut shape radiation diagram. This means that any signals which come from directly overhead will be greatly attenuated, which is not ideal for receiving signals from satellites.

If we change the orientation to horizontal, we see the radiation diagram change dramatically, it is no longer omnidirectional. This is also not ideal, if viewed from the top the pattern looks a bit like a figure 8. The main advantage however is that this arrangement will attenuate any nearby vertically polarized signals (which are common from commercial radios and other services nearby) by -20dB. Therefore, it makes sense to stick with a horizontal arrangement.

Bending the dipole

One last trick we can use to improve the antenna performance is to bend the Dipole in the middle into a V shape. This has a couple of benefits, firstly the figure 8 radiation pattern is squashed into more of a 0 shape, making it more sensitive to signals arriving orthogonal to the dipole. And secondly when we bend the antenna its impedance changes relative to bend angle.

Looking at the plots shown here as V-angle gets tighter, the impedance actually drops to around 50 ohms which results in a low Standing Wave Ratio (aka VSWR) when used a 50-ohm coaxial cable.  Looking at the SWR curve (orange line) the 50-ohm point occurs with the bend around 120°. (Source of data link)

This is great, however looking at the grey line on the graph we can see a side effect appear. As the bend angle gets tighter the length of the antenna required to maintain resonance, increases. Thankfully at 120° this effect is minimal <1% therefore we can go ahead and ignore it for simplicity. (The gain (dBi) also drops by a small amount from the straight dipole, but again is not significant enough to cause us much concern.)

3D printed support

Now we finally know what shape our antenna should be, I have designed a simple part that can be 3D printed to help us secure the antenna components in the right places, with a few extra features listed below. You can download the part for free by hitting the icon in the top right.

Legs support

There are two grooves in the part with 3mm cable tie mounts that allow you align the securely fasten the dipole legs at the required angle of 120°. There are also cable tie mounts for the transmission line.

Tapered pole hole

The bottom of the dipole antenna should be at least half a wavelength off the ground. So there is a tapered hold in the rear of the part that snugly mates with the end of a standard decorating extension pole (link).

North-South arrow

As our antenna is not omnidirectional (it is more sensitive front to back) we should be controlling the direction in which it points. If we direct it towards either true North or South, our weather satellites will pass over in an arc of maximum sensitivity as they travel on polar orbits (north to south or vice versa). Therefore, I have included a small arrow on the part which we can align with a compass needle.

Step 2. Build the antenna

Prepare materials

Now we have designed an antenna and 3D printed a support, we need to source the additional components required to finish the build. First we need a conductor for the antenna legs, a 4mm aluminum rod is ideal for this (don’t use a ferromagnetic material like steel due to the skin effect ). Local hardware stores sell this stuff by the meter, as we need just over 1m of raw material, we need to buy 2 rods that we can cut to size. Also from the hardware store we also need a pair of terminal blocks that will accept the end of the 4mm rod, a pack of 3mm cable ties and a decorating extension pole (link).

The final item we need to purchase is a software defined radio. I chose a Nooelec NESDR Smart v4 SDR that you can buy from amazon (link). There a lots of alternatives with similar specs which I’m sure will work just fine. If your SDR doesn’t come with a coax extension cable you will also need to source one (50 ohm) with an appropriate SMA connector.

Strip and Tin Coax Cable

On the female end on the coaxial cable carefully remove the protective jacket to reveal the braided copper conductor. Expose about 2cm of this conductor and then gather it into a single strand by twisting the strands together. Then remove the inner dielectric insulation to reveal the inner core and also twist this into a single strand. If you can, its best to tin the ends of these wires with solder then secure them into one end of the terminal block.

Measure the antenna legs

If we recall from the design phase, each dipole leg needs to be a quarter wavelength adjusted for resonance. We calculated this length to be 531mm. This length includes the terminal blocks and exposed cable cores, up to the point where the cable splits, then push the rod into the terminal block and mark the required length as shown below. 

Cut and bend 90 degrees

Transfer the measurement to the other metal rod and cut to length. Now we need to bend the last few centimeters of each rod by 90 degrees. I found it quite easy to do this in a vice by hand.

Assemble the components

Now you can fasten the bent portion of each rod into the terminal block and cable tie both legs down to the support part. You don’t need to secure the terminal block, but a pair of cable ties holding the coax cable in place will prevent it from getting accidentally pulled out. 

Antenna performance

How can we tell if our antenna is any good? In theory we know what the resonant frequency, Impedance and VSWR should be, but how can we actually measure these parameters? Luckily, there is a very useful tool called a Vector Network Analyzer or VNA. It works by generating a stimulus signal at a range of frequencies and measures the returning signal amplitude and phase.

Until recently very few people had a VNA at home as they were (as good ones still are) shockingly expensive. However this is no longer the case, thanks to the a clever chap called eddy555 who has designed a much cheaper handheld Vector Network Analyzer called the NanoVNA (Link). I picked one up off eBay and got to work measuring our new antenna. 

The VNA displays our results on a series of plots, the first of which (in green) shows impedance using a Smith Chart. This might look a little scary at first but its a handy concept once you get your head around it. Any point on the circular chart represents an impedance. The point at the very center (AKA prime center) represents a pure 50 Ohm resistance. Moving to the left from this point represents a drop in resistance all the way down to 0 ohms, or a “short circuit” at the very edge. Moving to the right, the resistance increases to infinity, or an “Open Circuit” at the edge of the chart. The Smith Chart can also plot the complex impedance (reactance) with points north of the horizontal reference line representing inductances and points below as capacitive. The thing to remember is that at our desired frequency we want to match the antenna impedance with the 50 Ohm transmission line, therefore we want our measurement at that frequency to show up as close to the center of the Smith Chart as possible.

As the VNA sweeps across a range of frequencies (from 100 to 200 MHz in our case) it displays the impedances on the Smith Chart. This gives us the swirly green line you see above, by placing a marker along the plot at 137 MHz we see the chosen point lands very close to the center, the impedance is almost a pure 50 Ohm, great! The VNA also plots Return Loss across the frequency range, and as you can see at 137 MHz the measured value is -41.5 dB which equates to a VSWR of 1.017.  These results are much better than I had predicted and confirms that this should be a good antenna for picking up 137 MHz weather satellites. 

Step 3. Control System and Software

Now that we have the physical components, all that’s left to do is set up the control software that will help us capture the signals and decode the image data. Thankfully all the software required are free to download and I will provide links and a description for each below. See below for a top level system diagram. 

1. Software Defined Radio Control (SDRSharp / Airspy)

The first piece of software that is required is a SDR controller. SDR# or SDRSharp (also known as Airspy) is the most commonly used SDR program on Windows. Follow the link below to download the latest version.

Follow this quick start guide to get the software up and running in no time. If you are successful, you should see a series of windows that look like the the image to the right.

2. Frequency and Doppler Shift Control (Gpredict)

Gpredict is a powerful tool that can help us track satellites in real-time and predict their orbit. We can use a plugin for SDRSharp to let Gpredict automatically tune our radio to the correct frequencies and compensate for doppler shift.

The software knows where our satellites are by looking up a public database on what is known as a “TLE Data” or a Two-line element set. This data contains a set of parameters which describe a satellites’ orbit at the current point in time. Using Kepler’s equations of orbital motion (TLE data is sometimes referred to as Keplerian data) the position and velocity of each satellite can be calculated at any point in the near future. The prediction accuracy diminishes with time, therefore we should update the TLE data regularly (every few hours). 

Gpredict is a free software licensed under the GNU General Public License. This gives you the freedom to use (and modify) it however you like. Download the latest version of the software below.

Frequency Control and Doppler Shift

We can use Gpredict to automatically tune SDRSharp to the correct frequency, and as the software knows the location and relative velocity of the satellites it can compensate in real-time for any Doppler shift. To do this we need a connector plugin for SDRSharp. Follow the link below to the GitHub page.

Software Setup Guide

To get the SDRSharp and GPredict to communicate with each other, I found the following video a helpful guide. There is a much more detailed user manual if you need further help (link).

3. Virtual Audio passthrough (VB-Cable)

To view a live picture (which is decoded in real-time) we need to feed the audio captured in SDRSharp into the APT decoding software. The easiest way to do this is using a free piece of software called VB-CABLE, which is a virtual audio device working as virtual audio cable. VB-CABLE is a donationware, and free to download and use personally. Follow the link below to download the installer.

With the software installed you can select the Output audio device in SDRSharp as the CABLE Input (VB-Audio) and (when you have installed it) under Options->Recording Options in WXtoIMG, we can select the CABLE Output (VB-Audio) as the recoding device. See below for details.

4. APT data decoding (WX2IMG)

So now we have a setup that should be able listen to these weather satellites, we can wait until one passes overhead and using Gpredict to tune into the correct frequency, SDRSharp should be able record something like the clip below.

Raw Audio Data

Well, to me that just sounds like a bunch of noise with a few beeps and boops, but rest assured the data we want is hidden in there somewhere. What we are actually listening to is a rather old analogue encoding system called APT or “Automatic Picture Transmission” (Wiki). This signal is continuously broadcast as the satellite passes over head, the data includes two image channels side by side (A & B), and a range of telemetry and synchronization data. So, to extract the images from this encoded data we need a final piece of software called WXtoIMG. See below for download link. 

WXtoImg is an automated APT and WEFAX weather satellite signal decoder. It helps to not only decode the image in real time, but also map overlays and color enhancements. The software is fairly straight forward to use, all you need to do is set up a ground station location, and download the satellite pass times (aka Kepler’s). The software can pipe audio directly from SDRSharp (if you use the VB-audio Cable see above) and begin recording automatically.  If you need any help getting set up, follow the WXtoIMG quick Setup Guide Below.

The Results

When I first had all the equipment set up, we made a few attempts at capturing a pass later that day, but the signal was far too noisy to make out much. It turns out patience is the name of this game, so I waited a few days until a NOAA satellite was predicted to pass directly overhead. On the 5th of June 2021, we pointed our homemade antenna at the sky and waited for a satellite to pass over the UK.  As predicted at 10:17, a faint beep appeared as NOAA 18 popped over the horizon, 870km away! As it passed overhead we watched the signal decode in real-time and slowly form the image you see below. 

As you can see from the bands of noise in the image there were a couple of times we lost the signal, but on the whole it’s not a bad attempt. The image shown below is the official NOAA archived image from that satellite pass as proof that this is the real deal. 

Color enhanced decoded image with map overlay - 05/06/2021 10:17 UTC
Archived NOAA Satellite Image - 05/06/2021

Final thoughts

About halfway through our first good satellite pass, as a grainy image appeared on our screen, I thought back to what it must have been like in 1957. When Sputnik launched on October 4th, RCA engineers in Long Island tuned their radios in to Sputnik’s frequency, and for the first time ever heard a sound broadcast from space. They recorded the beeping on to tapes and drove straight to Manhattan, where it was broadcast to millions over NBC radio.

Just like our weather satellites, Sputnik broadcasted a signal on pubic frequencies that was accessible to anyone, merely declaring its existence to the world. This was indeed a turning point in history, a culmination of thousands of years of technological progress boiled down to a simple beep on a radio. Inevitably I think we take these and subsequent achievements for granted, however in the few minutes it took to decode that image live, I developed an appreciation for just how extraordinary it must have been to hear that very first transmission.