Decoding RF Link Using A PC Soundcard

[Ray] wanted to use a microcontroller to send signals to some wireless power outlets. Instead of tapping into the buttons on the remote control he is using an RF board to mimic the signals. There are two hurdles to overcome with this method. The first is to make sure your RF module operates on the proper frequency. The second is to get your hands on the codes that are being sent from the remote control unit.

Now you could just hook your oscilloscope up to the transmitter and take a look at the timing of the signals. But most hobbyists don’t have that kind of high-end test equipment in their basement or garage shops. [Ray’s] approach uses something we all have available to us: a sound card and some open source software. He connected the data pin from his RF receiver to an audio plug and inserted it in the line-in jack of his computer. Using Audacity he recorded the signal as he pressed buttons on the transmitter.  This method not only captures the data, but the time stamps native to the audio editing program let him easily work out the timing for each signal.

It’s kind of amazing what you can do with this audio analyation technique. Earlier this year we saw it used to measure response time for DSLR cameras.

26 thoughts on “Decoding RF Link Using A PC Soundcard

  1. I used Audacity to record J1850 before I had an ELM327 and to record the datastream and audio from my Valentine One radar detector.

    Caution! If your sound card is DC coupled you can fry the input.

    But anything within the bandwidth can be logged.

  2. This is a great way to capture signals. If you want to protect your sound card, it’s not a bad idea to install a op-amp as a voltage buffer, provide it +/- 1 volt supply, and ac-couple the output (small value capacitor inline).

    1. That should be possible. But considering the amount of work to program the Arduino for what you need, and the potential limit on the sampling rate, it’s probably easier to use a sound card.

    2. Actually I used ATmega for digital sampling once to get precise timing informations when I was debugging 433MHz on-off modules.

      The problem is sampling rate and communication. I sampled only digital transitions and their times and I had to buffer them because the serial link was too slow.
      So real-time osciloscope from Arduino is not possible IMHO for practical applications.

      1. I’m sure there are simple to implement ready-made chips to do the sampling and reduce the load, and probably from various manufacturers and design.
        After all there are many instances where some sampling is needed and it’s typically something that can be baked in cheap chips.

  3. Neat hack, but “analyation” Wut?

    @NewCommentor1283 – good in theory, except go look at some datasheets – most op-amps simply won’t work with such a low supply voltage.

    1. thats exactly what i wanted to say to the other guy… ive never seen a opamp that will work with less then 4v single or +/- 3v…

      in this case you would want to limit BOTH the input AND the output… only takes 5 passive parts, 6 parts with POWER opamp chip.

      2 clamp diodes and one resistor, resistor for extreme over voltage input protection
      the 6th part is over current protection during output limiting; only for poweropamp

      1. he said “most op-amps simply won’t work with such a low supply voltage”, and the key word is most.

        They exist – you need ~ .7vdc difference unless you want really expensive parts, but I’ve used microvoltage/micropower opamps that worked pretty well.

        For this, I’d just use a resistive pad.

    1. This is actually a perfect application for Software Defined Radio using the RTL_SDR dongles. They can receive the entire band that these consumer electronics operate on, and you have the full power of GNURADIO to analyze the captures. Transmitting is another story, but just analyzing the communications is the first step, and harder step in my opinion.

  4. I’m pretty new to these kind of things..

    Would it be possible to connect a transmitter to the audio out plug, and “play” the signals to interact with the rf receivers?

    1. This is a VERY interesting thought. I just tried it and it actually works! What I did was to use an RF transmitter, provide 5V Vcc, and the data pin is connected to the audio out (either of the stereo channel) from the sound card. Then when I play back the wave it successfully triggers the power socket. The trick, however, is to adjust the volume to a high enough level (I maximized the volume) so that the audio output can drive the RF transmitter.

      1. Thank you for the reply. Could you provide the schematics for the transmitter build?

        I’m considering making something like this, just for the fun of it. However in Europe these things work on 433 Mhz.. :/

        I guess my skills are too limited..

  5. Note that this is a receiver, which receives signals. If you want to send RF signals you need a transmitter.

    I knew _that_, but thanks for mentioning it.

    Thanks for all the help. Will post about my findings. :)

  6. Ray, what band transmitter did you use connected to the audio jack? 315, 433 MHz? This is the most exciting solution I’ve heard of yet. I am trying to automate 6 remote ceiling fans and garage doors in my own home and the only solution I’ve found are cannibalizing weak 304MHz transmitters or building one myself. If you’re using an easily attainable transmitter of a different frequency, the problem has been solved. I’m thinking RPI with sound bites for each remote command driving one transmitter connected to some app like Blynk in conjunction with Alexa.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.