Friday, 1 March 2013

How to build a satellite receiving station using a Raspberry Pi

Space and satellites are something that only few people are fortunate enough to interact with. However, this is starting to change due to the rapid growth in capability of consumer electronics. In fact, you can receive and decode transmissions from satellites using only a Raspberry Pi, a USB software-defined radio receiver, and a few other cheap parts.

In this blog post, I'll describe in detail how to put together such a system.

Experimenting with receiving satellite signals is a lot of fun. Also, by receiving data from these satellites and sharing it with the satellite owners, you can help their scientific missions.


Goal

Build a satellite receiving station for amateur radio band cubesats using a Raspberry Pi.


Parts needed

  1. Raspberry Pi
  2. RTL-SDR or FUNcube Dongle Pro+ USB radio receiver
  3. Low-noise amplifier for the 70 cm amateur radio band e.g. DG0VE LNA70-1
  4. Yagi antenna for the 70 cm amateur radio band
  5. Coaxial cable and connectors between the antenna and LNA
  6. Coaxial cable and connectors between the USB radio and LNA
  7. Power supply for the LNA
These parts are available as a kit: click here for the kit info, pricing and ordering.


Background

The satellites we are going to receive are typically orbiting between 300 and 700 km altitude. At these altitudes, satellites orbit the earth every couple of hours or so. A satellite will be within range for only perhaps 2 to 5 minutes per orbit.

The orbits of all satellites are regularly measured by NORAD radar and their orbital parameters (known as TLEs or Keps) are publicly available. Using these orbital parameters, it's possible to predict the position of each satellite. Here's an example map showing 5 hours of FITSAT-1's orbit:

5 hours of FITSAT-1's orbit.
Since there are many satellites, it's useful to know when any of them will be passing above our station. Carpcomm's website has a system for this. For example, here you can see the upcoming passes one afternoon for my station:

Satellite pass predictions at my station in Durban, South Africa.

To get the predictions for your location, sign into the Carpcomm website and create a entry for your station. You will need to specify the location, the elevation, and the direction of your antenna.

Now whenever a satellite passes over, we need to tune the radio to the correct frequency and record the pass. Then we can review the recorded data and decode information from it.


Hardware construction

It's fairly easy to connect the parts together. Here's a diagram:




Plug the USB radio receiver into the Raspberry Pi. Connect it to the low-noise amplifier (LNA) with a coaxial cable and connector adaptor. Connect the LNA to the antenna with another coaxial cable.

The connectors depend on the specific radio and LNA. RTL-SDR radios usually have MCX connectors. The FUNcube Dongle uses SMA-female. The DG0VE LNA has SMA-female connectors on both ends.

It may be possible to use the FUNcube Dongle without an LNA. However, an LNA is definitely needed for the RTL-SDR dongles.


The hardest part is mounting the antenna. It has to be mounted somewhere with a clear view of the sky within its viewing angle. For small Yagi, like the one in the photo below, you'll need a clear view from 30° to 90° degrees elevation and ±30° azimuth. The Yagi should be mounted at roughly 30° elevation. As you can see below, I have attached my antenna to a pole on the roof of a house. However, setting it up on the balcony of an apartment should work too.


Software setup

For the software, we'll use the CarpSD ground station control software. It's an open-source program with the source hosted on GitHub. It runs as a background process and connects to the Carpcomm server, so that you can control your station from the Carpcomm website. Thus, there is no need to connect a display to your Raspberry Pi and you can leave your station running continuously in the background. The instructions below can be executed entirely over SSH.


Preparation

Firstly, make sure you have a recent version of Raspbian on your SD card. Then SSH into your Raspberry Pi.


Setup tmpfs

To avoid wearing out the flash storage, we'll configure CarpSD records radio data to tmpfs. Therefore, we need as much RAM as possible. Run
$ sudo raspi-config
and choose the maximum RAM/video split. Next, increase the tmpfs size by editing /etc/default/tmpfs:
$ nano /etc/default/tmpfs
Find the line "#TMPFS_SIZE=20%VM" and change it to "TMPFS_SIZE=90%VM".


Install CarpSD

CarpSD .deb packages are available from the Carpcomm apt repository. First add the repository public key:
$ wget http://carpcomm.com/apt/public.key$ sudo apt-key add public.key
Then edit /etc/apt/sources.list to add this line:

deb http://carpcomm.com/apt/ lucid main
Now install the package with apt:
$ sudo apt-get update
$ sudo apt-get install carpsd carpsd-fcd rtl-sdr


Check that your USB receiver is detected

First, check that your receiver is being seen correctly by typing
$ lsusb
It should display something like:
Bus 001 Device 004: ID 04d8:fb31 Microchip Technology, Inc.
for the FUNcube Dongle Pro+, or
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
for the RTL-SDR.

To test whether the connected RTL SDR works, run "rtl_test".
To test whether the connected FUNcube Dongle works, run "carpsd-fcd".


Configure CarpSD

If you haven't already done so, log into the Carpcomm website and create an entry for your station with its latitude, longitude and elevation. On the station page, click the "Get login info" link and note your station's id and secret.

Then edit the configuration file in /etc/carpsd/carpsd.conf so that it looks like this (for the FUNcube Dongle):
[Client]
id: <your station id>
secret: <your station secret>
server: mux.carpcomm.com:1234
ca_certificate: /etc/carpsd/ca_cert.pem 
[FCDReceiver]
recording_dir: /dev/shm
alsa_device: hw:1
or like this (for RTL-SDR):
[Client]
id: <your station id>
secret: <your station secret>
server: mux.carpcomm.com:1234
ca_certificate: /etc/carpsd/ca_cert.pem 
[RTLSDRReceiver]
recording_dir: /dev/shm
device_index: 0
tuner_gain_db: 0.0
sample_rate_hz: 96000


Start CarpSD

Now start CarpSD by running:
$ sudo /etc/init.d/carpsd start
Check the logs to see if it connected successfully:
$ tail /var/log/carpsd/carpsd.latest.stderr
If you go to your station page on the Carpcomm website, it should say "Online".


Testing the station

Now that all the hardware and software is setup, we can finally try it out!

Go to your station page on the Carpcomm website. If the station is online, you should see a "Go to station console" link:



Click on it to get to the station console page:



Tune it to 434 MHz. This is in the ISM band in Europe and Africa so there are likely to be a lot of transmissions there. Click the "Start" button to start the waterfall. You should see something like this:



What does it mean? The x-axis is frequency and the y-axis is time. The color indicates the signal power. The gray part is just background noise. The white blotches are signals. You may see many or just a few  signals depending on how many users of the 434 MHz ISM band there are nearby.


Receiving a satellite

Now that we know the station works, we can try to pick up a signal from a satellite. Some satellites are easier to receive than others. Usually the easiest are ones that have a morse code beacon. Some examples: STRaND-1SwissCube, FITSAT-1, Masat-1.

Check your pass predictions for one of these satellites. Wait until it is about to pass over, then tune to the appropriate frequency (as listed on the satellite page above), start the waterfall and stop it once the pass is finished. The recorded data will then be uploaded to servers and we'll try to decode it. The server will also generate a spectrogram of the recording that you can inspect.

Here's an example spectrogram from FITSAT-1:


Notice that you can read off the Morse code directly! (Also notice how the frequency changes over time. This is due to Doppler shift - more info about that here.)

The decoded telemetry will be displayed on the satellite's page:



Automatic operation

Once you've managed to receive a few satellite manually, you can enable automatic operation for your station. It will then record and try to decode every satellite that passes overhead, without you needing to do anything. This is useful especially for passes during the night or when you're busy with other things.

Automatic operation can be enabled by clicking the "edit" button on your station page:


Concluding remarks

I hope this guide will encourage more people to try building satellite receiving stations. Please do let us know your experiences in the comments.

You should follow @Carpcomm on Twitter+Carpcomm on Google+ or subscribe to this blog for updates.

There is also a mailing list for the CarpSD open source project.

11 comments:

  1. Very impressive.
    Because of the fleeting nature of Sat Passes
    this network stuff just makes sense.
    Rob

    ReplyDelete
  2. Hi, I would like to implement this, but the link to buy the needed parts is broken. Could you please tell me where I can buy the parts?
    Thanks,
    Karim

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. HI,

    Trying to install and get stuck at the public key:

    wget http://carpcomm.com/apt/public.key
    --2013-11-26 13:25:22-- http://carpcomm.com/apt/public.key
    Resolving carpcomm.com (carpcomm.com)... 184.168.221.31
    Connecting to carpcomm.com (carpcomm.com)|184.168.221.31|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://github.com/tstranex/carpcomm//apt/public.key [following]
    --2013-11-26 13:25:22-- https://github.com/tstranex/carpcomm//apt/public.key
    Resolving github.com (github.com)... 192.30.252.131
    Connecting to github.com (github.com)|192.30.252.131|:443... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2013-11-26 13:25:28 ERROR 404: Not Found.


    Any suggestions?

    Jeff

    ReplyDelete
  5. Cable is a very useful thing in all these type of networks. Network may be a simple one or a complicated one but all of them need these cables for the connection. These cables are according to the temperature that has to be bear in the connection so the different types of cables are used for different purposes. GPS is also a type of complicated network. You can refer this for further information http://www.atdcomm.com.au/product/vehicle-tracking

    ReplyDelete
  6. I want to try it, but the carpcomm-website seems to be offline, just this blog is working :(

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. I was looking forward to trying this but http://carpcomm.com just redirects to github, so no server. Doh!

    ReplyDelete
  9. Do you think I can use this to work as a satellite internet receiver?

    ReplyDelete
  10. You Everything does a nice job summarizing where Ergen is taking Dish. Here's some details. dstv installations from PTA dstv

    ReplyDelete