I wanted to build a  2 meter Yagi antenna so I could start playing around on 2 meter SSB and CW.

Initially,  I considered the tape measure Yagi.   


I'd helped another ham build one this past summer and I was impressed with it's performance.   There is a downside to the design though.  In even a mild breeze, the tape measure elements vibrate and sometimes flap around in the wind.

Also,  I live in an RV and travel a lot.   My antenna will be up and down often, and packed away every time I travel.  It has to be durable since it will undoubtedly get bumped around from time to time.

I also wanted a fairly wide bandwidth, providing a low SWR across the band so I could operate down in the SSB region or up in the FM area with good performance and no tuning required.

With durability and bandwidth in mind,  I decided to build the structure out of PVC pipe and the elements out of window line.   PVC is cheap and strong.  If the antenna ever broke from an impact, it would be easy and cheap to repair.   The *fat* elements created by the window line should provide for a broader bandwidth.

Initially, my plan was to use a folded dipole for the driven element.   I've seen many commercial Yagi antennas using one.  Folded dipoles are less noisy and a bit better at rejecting out-of-band signals, also providing a nice uniform pattern.

I spent a couple of days working on that idea, but had trouble getting it to work.   A folded dipole presents around 450 ohms of impedance at it's feed point so you need a matching network to match to the 50 ohm feedline.   However, in a Yagi,  the parasitic elements of the reflector and directors change things.  Yagi's usually have a lower impedance at the feedpoint of the driven element and I just couldn't get a good match to 50 ohms using a trombone coaxial match.

Abandoning that approach,  I decided to start with the tape measure yagi design and adapt it.

Pictured here is the resulting antenna and a plot of it's SWR over the 2 meter band.






As you can see, it's a success!  Performance is quite good.  Comparing the yagi, when rotate vertically, to a slim jim, I saw a big improvement in signal strength with a repeater that is 60 miles, or 96 kilometers away.
Slim Jim:  Repeater received signal strength, S3-S4.   Minimum power required to hit the repeater, 3 watts.
Yagi: Repeater received signal strength, S5. Minimum power required to hit the repeater, 1.5 watts.

A single S-unit indicates approximately 6db. That's 6db over the 3db gain of the slim jim, so the gain with the Yagi is around 9db.  Pretty good!  I tuned it to favor the lower end of the band a bit since I would mostly be using it down there for SSB and CW.  You can see by the plot from my Blue VNA that the bandwidth is good and broad as I'd hoped.

Here is the design of my antenna with dimensions. Click image for larger view, right-click on image to save it to your computer.



Design notes:   (Pipe dimensions are in inches, I'm not sure of the metric equivalents,)

The physical structure is common PVC pipe and fittings that you can buy at any hardware store.
The boom is made with 3/4 inch PVC pieces.  The element supports are 1/2 inch pieces.
The T pieces at the ends of the boom are 3/4 to 1/2 adapter T's
I couldn't find a cross part with 1/2 inch and 3/4 inch holes, so I used a 3/4 inch cross and adapters to       go down to the 1/2 inch element supports.
The mast connects to a PVC slip on part used to hang PVC pipe from a ceiling.  It slides onto the 3/4 inch boom pipe and has a threaded opening.  A 3/4 inch pipe to thread adapter allows the antenna to be screwed onto the mast when setting up the antenna. 
I cut the ends of the element supports at a 45 degree angle to eliminate the pipes from whistling when there's wind.  (plus it just looks cool!)   I also put the elements on the inside edge at the ends so I could set the antenna down without damaging the wires.   
*Be sure you cut the boom pieces so the distance between the actual elements are correct!*

Window line:
I suggest first cutting three lengths of window line, using the lengths specified in the drawing.    Then fit them against the element supports, trimming out the middle part where the window line wires go around the boom.   Once that's done, short the ends as shown before mounting them to the supports.   Make sure they are perfectly centered on the supports with exactly the same distance from the center of the boom to each end of the element.

Elements notes:  (It's a finicky antenna, be certain to get all dimensions precisely correct!)

    Director and Reflector:
    Cut the window line middle part out in the center so the wires go around the boom cleanly.
    All elements ends:
    The ends of each element have the two wires of the window line shorted together, electrically making the window line act like one fat conductor.   I found it best to bare a bit of the window line and then make a shorting wire out of a short piece of 14 gauge solid copper wire.  This way, during tuning, if you have to shorten the element, all you need to do is shave a bit more insulation off the window line.  Then heat the solder connections and slide the shorting wire down a bit, trimming off the stub remaining.
    
All elements, mounting to the PVC:
Short screws of any type can be used.   You want the window line tight against the PVC for nice and straight elements.  Use a drill bit just slightly smaller than the diameter of the threads on your screws and you can drill through the window line middle into the pvc, then thread the screw in.  It will bite into the PVC and provide a strong mount.
Also, it is very important to make sure the element is centered on the boom.  The more precise you are here the better the performance.   Measure from the center of the boom out to the end of the element and make sure it's the same distance to each end.
You also want to make sure the window line stays flat and parallel to the other elements.  Make sure your holes are centered in the window line and they follow a straight line along the pipe.

When cutting the 3/4 inch boom pieces, make sure the distance between the window line elements is correct.  The 3/4 pipe will go into the cross and T pieces about 1 inch.

Hairpin match and coax connection to driven element:
Pictured here is the center of the driven element and the connection to the coax and hairpin, notes below the photos.



I used eye ends and ground lugs to make the connection between the coax, hairpin and window line.  (more on the hairpin further down.)
Additionally, there are two short pieces of 14 gauge solid wire to make the connection to the other side of the window line.   The gap there matches the gap at the connections, about 1 inch.
I used a long screw to make the strain relief for the coax.  It also stands the coax off of the antenna when it's vertical.  You don't want the coax in line with the antenna elements.
Also,  it's a good idea to seal up the coax end with silicone or liquid tape to prevent moisture from getting into the coax.  (I hadn't yet sealed it when I took this picture.)

Hairpin:
This is the most finicky part of the antenna.   The tape measure design called for 5 inches or 12.7 centimetres length of 12 or 14 gauge wire.  I used 14 gauge solid copper wire.   You want to use solid wire so it maintains it's shape.
Also,  that length is to the connection point, so if you use eyes like I did, the actual wire will be about 4.75 inches or 12 centimetres.
The shape of the hairpin matters and is part of the tuning. (next section)  I started with a semi-circular shape.  You will end up pinching it down during tuning.

Tuning:
You'll need an antenna analyser to tune it.   The antenna will have to be away from metal objects also.  A short temporary mast of 5 or 6 feet should keep it well up from the ground.
First, we need to make sure the resonant point is where you want it in the band.  To shift it you adjust the length of the driven elements.  If you followed my design precisely, it should be around 145Mhz right off. 
If you need to move the resonant frequency up, you will shorten the elements slightly.
Note!  It doesn't take much change!  Shaving only 1/4 inch off the driven element will shift it by around 1.5 to 2 MHz!
If you do need to change the length of the driven element slightly, you will probably want to also change the reflector and director elements by exactly the same amount.

Once you have the lowest SWR point at the frequency desired, we can fiddle with the hairpin to tweak the match and get the lowest SWR at resonance.
Start to pinch in the shape and check SWR.  You should be able to get it right down to almost 1:1 at the resonant point. This won't change the resonant frequency, just the impedance match.

Additional notes:
For SSB or CW, you'll want the Yagi horizontal.  For FM and repeaters higher up in the band, the orientation should be vertical.   The PVC hanger that I use allows the antenna to easily be rotated.  To lock it in place, I drilled a hole through the hanger into the boom and inserted a screw.   I drilled a second hole into the boom when rotated the other way.  This way you can change the orientation by backing out the screw, rotating the antenna and putting the screw back into the other boom hole to lock it.

I'm very pleased with the operation of the antenna.  I'm sure it will give me many years of use and contacts.   For my use on my RV, I use broom holders to allow me to snap it on the side with a short 3/4 PVC mast and easily rotate it to point in the direction I choose. (pictured below)



I've been able to hit repeaters that I could hardly hear with the slim jim and am starting to play around with making SSB and CW contacts.   I also did a video on this project with some demos of the antenna in action.   Linked below.
10

View comments

  1. Looks Interesting as our group here OnVancouver Island ( West Coast of Canada) have built the Tape measure ones for Fox hunting. But I have wondered about the Gain of something more stable for a fixed antenna. And you answered my question on the Gain. Thanks for the video. I am a former U.S. Hamm KC5YLI9 (Tx) VE7WBC (B.C.)

    ReplyDelete
  2. Great video Kevin, I always enjoy watching what you come up with. This is just another wonderful project I'm just gonna have to do, HI HI. I ahve a friend who is studying for his tech lic. now, so I will definetly get him to help with this. Great first build for a new ham.
    Thanks again for great video and 73 de W7GST Larry

    ReplyDelete
  3. You have done it again. I really have to do this project. Always good to watch your videos.

    ReplyDelete
  4. Thanks for sharing this Kevin. I have a Kenwood TR-9000 2 Meter All Mode (no tone board) in the shack, and I have been wanting to put up a small beam. This is it!! I like that it can be used either horizontal for SSB/CW and vertical for FM.

    ReplyDelete
  5. what ohmage window line 300, 450 or 600

    ReplyDelete
  6. Nice job. I build yagi's too. 10, 2 and 70 centimeters so far. Might build a small one like this for RFI hunting with my new 891. Very portable. That's for sharing.

    ReplyDelete
  7. What kind of cable and connectors are being used to run from the antenna down to the radio?

    ReplyDelete
    Replies
    1. 50 Ohm coax, any type of connector you require for your radio.

      Delete
  8. I can't wait to put one of these together and try my luck! With the help of elevation, I can see LOS 80 miles! Thanks for the great write up, Kevin.

    ReplyDelete
  1.  


        This mini ATS (pocket) receiver is a neat little RX based on the Si4732 receiver on a chip and driven by a ESP32 module.   The 'stock' firmware it came with was ok, but not intuitive, and lacking in features that would make it ideal for ham radio use or SSB/CW reception.  The minimum step was 1 kHz for example.

        Dave Stoney, G8PTN did a re-work of the firmware to something much much nicer, as pictured above.  I won't go into all of the details of his firmware here, there's already plenty of information and demo videos available.   However, every video I've seen on updating the firmware, used a windows application available from ESPRESSIF in China.  No linux instructions that I could find.

       So, here we go.  I'll walk you through flashing the firmware under linux.  My instructions are based on Debian 12, in 2025, and should work on all debian variants like Ubuntu, Cinnamon, Mint and others.  Aside from the software installation instructions, most of the steps are generic enough to be easily adapted to other linux flavors.

      We will be working in the terminal, and I'm assuming you have at least a little experience with command line.  The steps are very simple, just a few commands.  But you should at least know how to navigate directories with a few basic commands like ls, cd, mkdir, etc.

    NOTE:  As with any firmware updates, there is always a risk of bricking the hardware.  In this case, it's very straightforward and I've tested the procedure on my own units with success.  But you proceed at your own risk.

       The windows utility is basically a graphic front-end for a python tool called 'esptool'.  esptool does all of the work, flashing the firmware, and we'll just be using it directly.

       Prerequisites :  We'll need to install a python program and therefore, we need to be sure we have python3 and a couple of modules installed.  We'll need pip and pyserial.  These should be easily installed via apt or synaptic.  We'll be doing this whole process in the terminal, so go ahead and open a terminal. Type the following line to install the two python modules. 

    sudo apt install python3-pip python3-serial

      Next, we'll need to set up a python environment and install esptool.  Copy and paste or type the following three lines.

    python3 -m venv ~/py_envs

    source ~/py_envs/bin/activate

    python3 -m pip install esptool

       Now we should have all the tools we need, next we will download the new firmware.  Visit Dave's github at the following link and download the latest version. 

    https://github.com/G8PTN/ATS_MINI/tree/main/FIRMWARE

       Extract the zip file you downloaded and cd into the directory.  Within, you'll find a directory named "Program_Files_8M".  cd into that directory and type ls -l  to see a list of files.  You should find the following three files..

    ATS_MINI.ino.bin

    ATS_MINI.ino.bootloader.bin

    ATS_MINI.ino.partitions.bin

      These are the actual firmware files that we'll be flashing.  Go ahead and turn on your radio and plug it in via USB.  Now we need to determine the serial device name for the radio.  

    Type ls /dev/tty* to see a list of serial device names on your system.  We're looking for either ttyACM0  or  ttyUSB0.

      Make a note of the serial device name.  In most cases it should be ttyACM0, but you may need to change it in the programming line we're going to paste in next.

      Ok, here's thee actual programming line.  You'll want to copy and paste it in, then compare to make sure it matches.  The only thing you might need to change is the serial device name if yours is ttyUSB0.. 

    esptool.py --port /dev/ttyACM0 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x0 ./ATS_MINI.ino.bootloader.bin 0x8000 ./ATS_MINI.ino.partitions.bin 0x10000 ATS_MINI.ino.bin

      You should see some progress messages as it writes the new firmware in, and after it finishes, your radio should restart with the new firmware.  And that's it.  Not too difficult.  You may want to save these instructions and occasionally check Dave's site for updates.  

      Enjoy your new and improved interface, it's much easier to navigate and work with. 

    73,  Kevin

    1

    View comments


  2.     I've been learning FreeCAD.   What a powerful program!  An incredible value for the price..

        This is my latest project.  A fully parametric project box, lid, and gasket.   You simply plug in the dimensions into the embedded spreadsheet and the whole thing recomputes, ready to be exported and 3D printed.

        Well, you could also modify it further by adding holes, internal features for mounting a PCB, or whatever, before exporting it.   So the next project I do, I won't be looking around for the perfect box, I'll just make it.

         Once I get the file uploaded somewhere, probably github, I'll put a link below where you can download the FreeCAD file and make your own custom boxes.   FreeCAD itself can be downloaded from freecad.org 

        A great set of tutorials can be found on the mangojelly youtube channel also.  It's a really easy program to learn.  They've really come a long way with it in the last two years.

    Github link for download.

    0

    Add a comment

  3.  



      Morse Code, often referred to by Ham Radio folks simply as CW, is usually sent using a hand operated switch called a 'Key'.   You've seen these somewhere, the old telegraph key.   Another device called a 'Keyer' can automatically generate the long and short tones,  the dashes and dots Morse is comprised of.  A keyer will use a set of paddles, two parts that sit between your index finger and thumb.  Press one and a series of long tones is generated, press the other and a series of short tones is generated.

      These two methods are by far the most common way of operating a transmitter to send Morse over the air.  They require a bit of practice to get clean code.  Orderly tones with proper spacing between them, slightly longer spacing between letters, and even longer spacing between words.

      But what if someone has a problem with their hands, loss of dexterity with their fingers, injury, stroke or disease that prevents them from using a key or paddles?   Why not use the voice?

      Every CW operator I've ever met can speak Morse code.  We say the words, "Dah" for a dash, and "Dit" for a dot.   The naturally spoken length of each corresponds to the correct ratio in length of the long and short tones of proper code.   And speaking is one of the most natural things we do.

      Sure, there are other options.   A puff key, consisting of a straw that's blown into to 'key' the transmitter.  A foot switch.  A squeeze switch if you can still clutch your fist reliably.  However, these require retraining your brain, can be clumsy at first, maybe hard to ever get clean code with.

      So I set out to design a voice keyer.  A simple method of following the voice of spoken Morse and keying a transmitter right along with it.

      I had a few design goals in mind.  Keep the circuit simple and cheap.  Easy to build and reliable.  In order to produce the cleanest keying possible, I decided to do the work in software with an arduino, giving me precise control over the keying for nice clean transmission.

      Here is the schematic:  You can right-click on it to download.




    Circuit description:

       The circuit can be powered from a 9 volt battery, it only draws around 30 ma when idle.  The input voltage can be from 7 to 12 volts since we use the voltage regulator on the arduino to provide 5 volts for the rest of the circuit.

       Most headsets use a condenser microphone element which will have a built in preamp that needs a small amount of power to operate.  R1 provides that power.  C1 then blocks the DC but passes the audio to a simple transistor amplifier.

        Q1 is the amplifier.  It takes the small, 80-120 millivolt audio from the mic and amplifies it to around 4 volts peak to peak.   D1 then clamps the negative swings, leaving us with a purely positive waveform. C3 then smooths the audio to a less choppy DC voltage the arduino can sense and operate on.

       R5 is a linear 10K pot that allows us to set the sensitivity of the mic.  You don't want room noise interfering after all.

       Q2 is a simple transistor switch for keying the radio in CW mode.  D2 provides transient protection from any spikes that might come in from the radio.  Likewise C4 provides a bit of RF protection, bleeding any stray RF to ground.

       SW2 cuts off the keying action when it's not needed.  i.e. while adjusting the sensitivity pot, or talking to someone else in the room, etc.

       The LED performs two functions.  It's a power light, at around 40% illumination, and switched to full brightness when the radio is keyed as a visual indicator.  It's also useful for setting the sensitivity without actually transmitting.

    My completed prototype:



       The software is available on my github page linked below.  It's well commented and should be easy to follow.

                    (github arduino software link)

    Software description:

      At the simplest, the software senses audio from the amplifier and turns on the keying line if the threshold of the audio exceeds the sensitivity value read from the pot.   When audio is below that threshold, it turns off the keying line.

      However, in order to assure clean edges, it also uses timing to 'frame' the keyed event.  There is an interrupt routine to provide a timer with a resolution of 1 micro-second.  Each time audio is detected, the timer is reset.  After some experimentation, I settled on a value of 18 micro-seconds.

      The voice tails off at the end of the word.  That would lead to a short period where keying might rapidly switch on and off.  That would be sloppy and probably hard on the transmitter.  having that 18 micro-second hang time cleans up the end of the element for nice clean keying.

    Conclusion:

      It's a simple circuit to put together with commonly available parts.  Should be easy for anyone with basic electronic skills to assemble.  I have done a project video, including demonstration of it in use, linked below.    I hope it will help someone who enjoys Morse but has had that joy lost due to circumstances.   It may also be of interest to CW ops in general.  In use I have discovered that it feels completely natural speaking the code and almost less fatiguing than it is to physically operate a key.  And it's kind of neat and fun too!

           (Full project video with demonstration)

      Thanks for your attention and as we hams say, 73.  (best wishes)

    Kevin, KB9RLW

    0

    Add a comment


  4.     

    (NOTE: there is a commercial version of this transmitter available through Zachtek at the following link.
    https://www.zachtek.com/product-page/cw-flea-transmitter)

    Way back in the early days of Amateur Radio, tinkerers would often build their own simple transmitter to use along with a receiver they probably already had.   They'd scrounge parts where they could and build something like a crystal controlled oscillator with enough power to be heard over the air.

       At the time, the tools available to such tinkering folk were vacuum tubes and they'd put together something like this.


       Usually, they would have an external antenna switch, allowing them to switch their antenna from the receiver to their transmitter, using the receiver as a side-tone to monitor their transmission while sending Morse code.

       In my youth, in the 1970's through early 1980's, we didn't have to work with tubes any more, we had transistors!   Small discrete components that operated at lower and safe voltages.   Some time ago, I built a simple transmitter using the tools I tinkered with, seen here.


      It only puts out a few hundred milliwatts, but that's enough.  I've made many contacts over the air with it.

      These days, the tinkerers have micro-processors mounted on tiny boards with I/O pins and easy software tools.  They build robots, flying drones, all kinds of advanced projects that would look like science fiction to those from earlier times.

       So I had the idea to build that early simple transmitter, only using the modern tools available today.  A way that new hams could make their own simple transmitter with the things they're used to working with.   I call it the CW flea.  CW meaning Continuous Wave.  When keyed down, it produces a continuous RF signal that you switch on and off to send Morse with.

      Here is the block diagram of the flea. (click for larger image, right-click to download.)


      And here is the main schematic. (click for larger image, right-click to download.)

    WARNING:  Although I shouldn't have to say this.   If you build it, be sure you wire the relay right and label your antenna and receiver jacks clearly.   Never plug your receiver into the antenna jack!  Transmitting into your receiver would damage it.   










       I'll build it using the off-the shelf parts available today.  The micro-controller will be an Arduino Nano, widely available and built on a board with pins for all of the I/O right on the PCB.   The Si5351 clock generator will be the VFO, controlled by the Arduino.  It's available on a PCB as well, through adafruit or etherkit.   The power amplifier is novel, borrowed from another design by a small company called Zachtek.   (I'm collaborating with Harry over at Zachtek on this project, he'll be producing a ready-for-air version of the flea.)  The P.A. uses a 74LS244 octal liine driver.  With all 8 stages paralleled, the little chip will produce 300-500 milliwatts of power out.

      Since we're dealing with RF here, a low pass filter will be required and will have to be made with a few toroids and capacitors.  Along with a single NPN transistor to drive the relay, a voltage regulator and a few capacitors and resistors, the hardware build should be fairly simple to put together.

      I'm focusing on simplicity so tuning the transmitter will be a bit different than commonly done.  Instead of a knob and calibrated scale, tuning will be through two push buttons.   

      Tuning:   The Si5351 has three separate clock outputs, I'll be using two of them.   One will go to the P.A. and provide the actual signal to air.   When you depress the code key, the arduino will switch the relay to connect the antenna to the output of the power section, also grounding the receiver output.  However, when you depress one of the tuning buttons,  the second output will be switched on, allowing you to hear the signal from the vfo in your receiver.  One button will move the frequency up, the other, down.

      You'll simply move the frequency with the buttons until you hear it in your receiver.  Adjusting it for the tone pitch you're used to for CW operating, or matching the pitch of the station you wish to call.  Since the CW portion of any of the amateur bands is narrow, it shouldn't take more than a few seconds to dial the transmitter in.

      Since the whole thing is controlled by software, it's easy to build it for the band you wish to operate on.  (It's a single band design)   Since I'm releasing it as Open Source, anyone can extend it in any way they choose.  I could imagine building it for two bands and adding a pair of relays to select the appropriate low pass filter automatically, for example.  

      The software begins with several variables that allow a builder to control how it behaves.  Here's the first few lines:

    // Declare variables and flags we will use in the program

    int tuneup = 2; //pin number used for tuning up in freq

    int tunedn = 3; //pin number used for tuning down in freq

    int keypin = 7; // pin number used for key input

    int relaypin = 4; //pin number used for relay control

    int tunecount = 500; //delay between slow tuning and fast tuning

    int tunestep = 5000; //minimum tuning step in hundreths Hertz

    int tuning = 0; //flag to indicate tuning state

    int tunevfo = 0; //flag to indicate tuning vfo state

    int buttonup = 1; //flag for tune up button

    int buttondn = 1; //flag for tune down button

    int tail = 0;  // The counter for the keying tail delay

    int taildefault = 1000; // Default to 1 second tail, change if you want.

    int keyed = 1; //flag to indicate keyed state

    int keyedprev = 1; //flag to indicate previous key state after a change

    int unkeyflag = 0; //flag for end of timeout switch back to RX

    long freq = 1403000000; //current frequency in hundreths Hertz.

    long bandbottom = 1400000000; //Lowest frequency in hundreths Hertz

    long bandtop = 1407000000; //Highest frequency in hundreths Hertz  


       As you can see, I've commented the code to make it easy to understand and work with.  The bottom three lines there show the default frequency, the bottom and top of the operating range.  If one were building it for 40 meters, they could simply change those to 7030000000, 700000000, and 707000000 respectively. 

       The full arduino sketch will be available on my github page and linked here:

    https://github.com/loughkb/CW-flea-arduino-sketch

      At the point of writing this, I have built the basics on a breadboard and just finished the software.  This blog will continue to grow as the project progresses and I'll be doing videos on my youtube channel about it.   Check back in a few days for updates.

    1

    View comments


  5.     Recently I contacted SDRPlay about obtaining an RSPdx unit.   I wanted to look into simplifying setup under linux.   They were still providing scripts based on my work from a few years ago with the RSP2.  Linux has moved on, however, and the provided scripts were unreliable on recent distributions.

        The old scripts also built several packages from source, which was problematic in some cases and took a long time to complete.

        They responded positively and sent me a unit to play around with.

        Have you ever approached a problem from the wrong angle, spent (wasted) lots of time and only found frustration?    Yep, that's what happened.  

       About a year ago, SDRPlay updated their API to support their newer hardware.   The newer API broke compatibility with the next layer in the software stack on linux.     I found a newer version of the gr-osmosdr module, designed to support the new API and started working down that path.

       This quickly lead to frustration.   It required a newer version of soapysdr, version 0.8.   That, in turn, required newer versions of gqrx, gnuradio, and cubicsdr.    I discovered that even in the latest Ubuntu, the repositories still contained 0.7 of Soapy.

       Not really surprising.   A distribution is going to be built on the newest versions of things that all work together.   It takes time for all packages to catch up to each other, so what we have in the latest release of linux will not necessarily include the absolute latest versions of each component.

       I spent days on what was becoming an increasingly complex project, requiring more and more components to be built from source.    I became quite frustrated and was about to give up and send it back when I had a thought.

       A few years ago, when I first tackled the RSP2 I had,  Soapysdr was fairly new.   Soapysdr is a middle man.   Like printer drivers in a modern os, it's a layer that contains sdr hardware drivers and presents the applications with one software interface.  Soapy then translates things through it's modules for individual hardware sdrs. 

       I realized, it's been a few years, and just over a year since the API was updated.  Maybe someone has created a newer soapy module for the new API.

       YES!   I found one.  And it works!

       So I've developed this one script to get your SDRPlay hardware working on recent debian based linux distributions.   Since Cubicsdr and gqrx are both newer and directly support soapy, this means we only have to build the soapy module from source.  Everything else can be pulled directly from the repositories.

        This greatly simplifies things!

       I've created two versions of the script.  One for X86 machines, and one for Raspberry pi.  You only need to run the script, reboot and you're good to go.

       Below are the scripts.   Choose the one for your machine, select it and copy.  Open an editor on your machine and paste.   Save the file to your machine as something like, "sdrplay setup.sh".

       Now, right-click on the script and select properties.   Under permissions, check the box to mark it as executable.    Open a terminal and run the script.   It will ask for your password to install things from the repositories and during the install of the API and soapy modules.   If no errors are reported, after a reboot both gqrx and cubicsdr will see your SDRPlay and should work fine.

    Script for X86 based machines:

    #! /bin/sh

    echo "First we need to make sure dependancies are installed."

    echo "There may be several packages to install.  This could"

    echo "take several minutes to complete."


    # Install the dependancies

    sudo apt install git cmake build-essential gqrx-sdr cubicsdr libsoapysdr-dev soapysdr-tools gr-osmosdr uhd-soapysdr


    #Install the API

    cd ~/Downloads

    # download the API from the SDRplay website

    wget https://www.sdrplay.com/software/SDRplay_RSP_API-Linux-3.07.1.run

    # change permission so the run file is executable

    chmod 755 ./SDRplay_RSP_API-Linux-3.07.1.run

    # execute the API installer (follow the prompts)

    ./SDRplay_RSP_API-Linux-3.07.1.run


    #Get the sdrplay soapy module and build it.

    cd ~/Downloads

    git clone https://github.com/pothosware/SoapySDRPlay3

    cd SoapySDRPlay3

    mkdir build

    cd build

    cmake ..

    make

    sudo make install

    echo ""

    echo "If there were no errors reported, please reboot your machine."

    echo "Everything should be ready to go."



    Script for ARM based machines. (Raspberry Pi)


    #! /bin/sh

    echo "First we need to make sure dependancies are installed."

    echo "There may be several packages to install.  This could"

    echo "take several minutes to complete."


    # Install the dependancies

    sudo apt install git cmake build-essential gqrx-sdr cubicsdr libsoapysdr-dev soapysdr-tools gr-osmosdr uhd-soapysdr


    #Install the API

    cd ~/Downloads

    # download the API from the SDRplay website

    wget https://www.sdrplay.com/software/SDRplay_RSP_API-ARM32-3.07.2.run

    # change permission so the run file is executable

    chmod 755 ./SDRplay_RSP_API-ARM32-3.07.2.run

    # execute the API installer (follow the prompts)

    ./SDRplay_RSP_API-ARM32-3.07.2.run


    #Get the sdrplay soapy module and build it.

    cd ~/Downloads

    git clone https://github.com/pothosware/SoapySDRPlay3

    cd SoapySDRPlay3

    mkdir build

    cd build

    cmake ..

    make

    sudo make install

    echo ""

    echo "If there were no errors reported, please reboot your machine."

    echo "Everything should be ready to go."


    5

    View comments



  6. It's springtime here,  that time of year where 6 meters occasionally opens up.   And I need a decent 6 meter antenna.    I'd love a beam, but I live in an RV and have very limited space.   So a dipole it is.

    I've long been aware of cage dipoles and their broader bandwidth verses a regular dipole.  So I thought up a way to make a simple four wire cage dipole for 50 MHz.    Here is the design.


                                     (Click on image for full size, then right-click on it to download.)

    In order to test the increase in bandwidth,  I initially just put a singe wire on each leg and swept it with my Blue VNA.   

    (single wire dipole being measured)

    And here is the sweep of the single wire dipole, showing a bandwidth of 2.6 MHz between the 2:1 points.   One interesting point I noticed.   Modeling and literature all point out that a half wave resonant dipole will have ~74 ohms impedance at it's resonant frequency.   We measured 73.8 ohms, how about that!

    Then I finished building the cage and swept it again.

    (The cage version being measured.)

    Here's the result.   The bandwidth has increased by 77% to 4.6 MHz!


    So there we go.  The cage design not only increased bandwidth, but also slightly lowered the impedance and SWR at it's lowest point.    Some might wonder why I didn't trim the antenna to raise the lowest SWR to the center of the band.  Well, 99% of my operation on 6 meters is down at the CW/SSB/digital end of the band, so that's where I wanted the lowest SWR.

    Now I'm all ready for those coming 6 meter openings.



    1

    View comments

  7. I wanted to build a  2 meter Yagi antenna so I could start playing around on 2 meter SSB and CW.

    Initially,  I considered the tape measure Yagi.   


    I'd helped another ham build one this past summer and I was impressed with it's performance.   There is a downside to the design though.  In even a mild breeze, the tape measure elements vibrate and sometimes flap around in the wind.

    Also,  I live in an RV and travel a lot.   My antenna will be up and down often, and packed away every time I travel.  It has to be durable since it will undoubtedly get bumped around from time to time.

    I also wanted a fairly wide bandwidth, providing a low SWR across the band so I could operate down in the SSB region or up in the FM area with good performance and no tuning required.

    With durability and bandwidth in mind,  I decided to build the structure out of PVC pipe and the elements out of window line.   PVC is cheap and strong.  If the antenna ever broke from an impact, it would be easy and cheap to repair.   The *fat* elements created by the window line should provide for a broader bandwidth.

    Initially, my plan was to use a folded dipole for the driven element.   I've seen many commercial Yagi antennas using one.  Folded dipoles are less noisy and a bit better at rejecting out-of-band signals, also providing a nice uniform pattern.

    I spent a couple of days working on that idea, but had trouble getting it to work.   A folded dipole presents around 450 ohms of impedance at it's feed point so you need a matching network to match to the 50 ohm feedline.   However, in a Yagi,  the parasitic elements of the reflector and directors change things.  Yagi's usually have a lower impedance at the feedpoint of the driven element and I just couldn't get a good match to 50 ohms using a trombone coaxial match.

    Abandoning that approach,  I decided to start with the tape measure yagi design and adapt it.

    Pictured here is the resulting antenna and a plot of it's SWR over the 2 meter band.






    As you can see, it's a success!  Performance is quite good.  Comparing the yagi, when rotate vertically, to a slim jim, I saw a big improvement in signal strength with a repeater that is 60 miles, or 96 kilometers away.
    Slim Jim:  Repeater received signal strength, S3-S4.   Minimum power required to hit the repeater, 3 watts.
    Yagi: Repeater received signal strength, S5. Minimum power required to hit the repeater, 1.5 watts.

    A single S-unit indicates approximately 6db. That's 6db over the 3db gain of the slim jim, so the gain with the Yagi is around 9db.  Pretty good!  I tuned it to favor the lower end of the band a bit since I would mostly be using it down there for SSB and CW.  You can see by the plot from my Blue VNA that the bandwidth is good and broad as I'd hoped.

    Here is the design of my antenna with dimensions. Click image for larger view, right-click on image to save it to your computer.



    Design notes:   (Pipe dimensions are in inches, I'm not sure of the metric equivalents,)

    The physical structure is common PVC pipe and fittings that you can buy at any hardware store.
    The boom is made with 3/4 inch PVC pieces.  The element supports are 1/2 inch pieces.
    The T pieces at the ends of the boom are 3/4 to 1/2 adapter T's
    I couldn't find a cross part with 1/2 inch and 3/4 inch holes, so I used a 3/4 inch cross and adapters to       go down to the 1/2 inch element supports.
    The mast connects to a PVC slip on part used to hang PVC pipe from a ceiling.  It slides onto the 3/4 inch boom pipe and has a threaded opening.  A 3/4 inch pipe to thread adapter allows the antenna to be screwed onto the mast when setting up the antenna. 
    I cut the ends of the element supports at a 45 degree angle to eliminate the pipes from whistling when there's wind.  (plus it just looks cool!)   I also put the elements on the inside edge at the ends so I could set the antenna down without damaging the wires.   
    *Be sure you cut the boom pieces so the distance between the actual elements are correct!*

    Window line:
    I suggest first cutting three lengths of window line, using the lengths specified in the drawing.    Then fit them against the element supports, trimming out the middle part where the window line wires go around the boom.   Once that's done, short the ends as shown before mounting them to the supports.   Make sure they are perfectly centered on the supports with exactly the same distance from the center of the boom to each end of the element.

    Elements notes:  (It's a finicky antenna, be certain to get all dimensions precisely correct!)

        Director and Reflector:
        Cut the window line middle part out in the center so the wires go around the boom cleanly.
        All elements ends:
        The ends of each element have the two wires of the window line shorted together, electrically making the window line act like one fat conductor.   I found it best to bare a bit of the window line and then make a shorting wire out of a short piece of 14 gauge solid copper wire.  This way, during tuning, if you have to shorten the element, all you need to do is shave a bit more insulation off the window line.  Then heat the solder connections and slide the shorting wire down a bit, trimming off the stub remaining.
        
    All elements, mounting to the PVC:
    Short screws of any type can be used.   You want the window line tight against the PVC for nice and straight elements.  Use a drill bit just slightly smaller than the diameter of the threads on your screws and you can drill through the window line middle into the pvc, then thread the screw in.  It will bite into the PVC and provide a strong mount.
    Also, it is very important to make sure the element is centered on the boom.  The more precise you are here the better the performance.   Measure from the center of the boom out to the end of the element and make sure it's the same distance to each end.
    You also want to make sure the window line stays flat and parallel to the other elements.  Make sure your holes are centered in the window line and they follow a straight line along the pipe.

    When cutting the 3/4 inch boom pieces, make sure the distance between the window line elements is correct.  The 3/4 pipe will go into the cross and T pieces about 1 inch.

    Hairpin match and coax connection to driven element:
    Pictured here is the center of the driven element and the connection to the coax and hairpin, notes below the photos.



    I used eye ends and ground lugs to make the connection between the coax, hairpin and window line.  (more on the hairpin further down.)
    Additionally, there are two short pieces of 14 gauge solid wire to make the connection to the other side of the window line.   The gap there matches the gap at the connections, about 1 inch.
    I used a long screw to make the strain relief for the coax.  It also stands the coax off of the antenna when it's vertical.  You don't want the coax in line with the antenna elements.
    Also,  it's a good idea to seal up the coax end with silicone or liquid tape to prevent moisture from getting into the coax.  (I hadn't yet sealed it when I took this picture.)

    Hairpin:
    This is the most finicky part of the antenna.   The tape measure design called for 5 inches or 12.7 centimetres length of 12 or 14 gauge wire.  I used 14 gauge solid copper wire.   You want to use solid wire so it maintains it's shape.
    Also,  that length is to the connection point, so if you use eyes like I did, the actual wire will be about 4.75 inches or 12 centimetres.
    The shape of the hairpin matters and is part of the tuning. (next section)  I started with a semi-circular shape.  You will end up pinching it down during tuning.

    Tuning:
    You'll need an antenna analyser to tune it.   The antenna will have to be away from metal objects also.  A short temporary mast of 5 or 6 feet should keep it well up from the ground.
    First, we need to make sure the resonant point is where you want it in the band.  To shift it you adjust the length of the driven elements.  If you followed my design precisely, it should be around 145Mhz right off. 
    If you need to move the resonant frequency up, you will shorten the elements slightly.
    Note!  It doesn't take much change!  Shaving only 1/4 inch off the driven element will shift it by around 1.5 to 2 MHz!
    If you do need to change the length of the driven element slightly, you will probably want to also change the reflector and director elements by exactly the same amount.

    Once you have the lowest SWR point at the frequency desired, we can fiddle with the hairpin to tweak the match and get the lowest SWR at resonance.
    Start to pinch in the shape and check SWR.  You should be able to get it right down to almost 1:1 at the resonant point. This won't change the resonant frequency, just the impedance match.

    Additional notes:
    For SSB or CW, you'll want the Yagi horizontal.  For FM and repeaters higher up in the band, the orientation should be vertical.   The PVC hanger that I use allows the antenna to easily be rotated.  To lock it in place, I drilled a hole through the hanger into the boom and inserted a screw.   I drilled a second hole into the boom when rotated the other way.  This way you can change the orientation by backing out the screw, rotating the antenna and putting the screw back into the other boom hole to lock it.

    I'm very pleased with the operation of the antenna.  I'm sure it will give me many years of use and contacts.   For my use on my RV, I use broom holders to allow me to snap it on the side with a short 3/4 PVC mast and easily rotate it to point in the direction I choose. (pictured below)



    I've been able to hit repeaters that I could hardly hear with the slim jim and am starting to play around with making SSB and CW contacts.   I also did a video on this project with some demos of the antenna in action.   Linked below.
    10

    View comments

    1. Looks Interesting as our group here OnVancouver Island ( West Coast of Canada) have built the Tape measure ones for Fox hunting. But I have wondered about the Gain of something more stable for a fixed antenna. And you answered my question on the Gain. Thanks for the video. I am a former U.S. Hamm KC5YLI9 (Tx) VE7WBC (B.C.)

      ReplyDelete
    2. Great video Kevin, I always enjoy watching what you come up with. This is just another wonderful project I'm just gonna have to do, HI HI. I ahve a friend who is studying for his tech lic. now, so I will definetly get him to help with this. Great first build for a new ham.
      Thanks again for great video and 73 de W7GST Larry

      ReplyDelete
    3. You have done it again. I really have to do this project. Always good to watch your videos.

      ReplyDelete
    4. Thanks for sharing this Kevin. I have a Kenwood TR-9000 2 Meter All Mode (no tone board) in the shack, and I have been wanting to put up a small beam. This is it!! I like that it can be used either horizontal for SSB/CW and vertical for FM.

      ReplyDelete
    5. what ohmage window line 300, 450 or 600

      ReplyDelete
    6. Nice job. I build yagi's too. 10, 2 and 70 centimeters so far. Might build a small one like this for RFI hunting with my new 891. Very portable. That's for sharing.

      ReplyDelete
    7. What kind of cable and connectors are being used to run from the antenna down to the radio?

      ReplyDelete
      Replies
      1. 50 Ohm coax, any type of connector you require for your radio.

        Delete
    8. I can't wait to put one of these together and try my luck! With the help of elevation, I can see LOS 80 miles! Thanks for the great write up, Kevin.

      ReplyDelete
  8.    This year, two new experimental bands became official,  the 2200 meter band and the 630 meter band.

       I wanted to start experimenting with the 630 meter band, 472kHz to 479kHz, but I don't have a radio capable of transmitting on that band.  So I decided to build one.

    Where to begin?  Well, a CW transmitter is the easiest choice.  All you need to do is turn a carrier on and off with a Morse code key, so you only need an oscillator and a power amplifier.

       While searching around for other projects on that band, I found a wonderfully simple power amplifier circuit already designed by Rog, GW3UEP over in Whales.  His original write up can be found here:

    GW3UEP PA

       I've also been looking for a use for an Si5351 clock generator break-out board I was given last year.  It's a versatile little chip, capable of generating up to three simultaneous outputs from 100kHz up to 200Mhz.  It generates a square wave, and the power amplifier expects a square wave, so they should work well together.

       After a couple of weeks of work, I had a completed and working transmitter capable of producing around 6 watts of power.

     


    Theory of operation:

        The arduino and Si5351 will generate a signal within the band, from 472 to 479 kHz.  A Morse code key or electronic keyer will be used to switch the signal on and off. 

        Frequency selection is accomplished by a single potentiometer and a spot tuning push button.  When you press the button, a low level signal will be sent out of the receiver output jack, allowing you to dial the transmitter to your desired frequency.  The band is so narrow, only 7kHz wide, that this tuning method is very quick and easy.

       Keying of the transmitter is accomplished by first switching a relay that grounds the receiver output jack to protect your receiver, waiting a microsecond, switching a T/R relay that powers up the amp and switches the antenna jack to the amplifier, waiting a microsecond, and finally turning on the Si5351 output at the desired frequency.

       Releasing the Key will turn off the Si5351 output.

       A timer is employed for a 'tail',  waiting 1 second before releasing the relays to switch back into receive mode.  This is to prevent the relays chattering away with every dit and dah while sending.  That timeout can be changed in the software, and could theoretically allow for full break-in operation if you don't mind banging your relays constantly.  That's up to you, I like having a bit of a tail.  Since this timer is software controlled, there's nothing stopping you from adding an additional pot and modifying the software to make the tail adjustable if you choose.

     
    Here is the schematic of the completed unit.



       Circuit description:
         
           12-13.6 volts DC comes in and is immediately filtered by a .01uf capacitor to prevent RF leaking back out the power line.  There's also a large diode right at the power connector in reverse bias to protect the radio from reverse polarity connection.  You should have a 2-3 amp fuse in your power cord for safety.

           The power is routed directly to the two relays and a power switch.  I ran it directly to the relays due to the physical layout in my unit, but you could run the relay feed through the power switch as well if you choose.

           Beyond the power switch we have a 7805 regulator to provide 5V to the arduino nano and Si5351 board.  You should put a small heat sink on the 7805, it will get pretty warm.

           The arduino is the brains of the machine, providing frequency control and keying.  It takes input from three items.  The spot tuning push button,  a pot for tuning, and a jack for connecting your Morse code key or electronic keyer output.   The tuning pot can be any value from 1K up to 10K.

           Connected to the arduino we have an Si5351 break-out board.  These are available from etherkit or adafruit at a low cost.

    Etherkit link

    Adafruit link

           The output of the Si5351 is low, around 3.3 volts.  Not enough to switch on the power MOSFET in the amplifier, so I needed a simple driver to bring that voltage level up to around 11 volts.  This is accomplished through a single NPN transistor.  You can use any generic switching transistor like the 2N3904 or 2N2222.

           Additionally, the second output of the Si5351 is used for spot tuning and runs to a wire that's wrapped around the receiver output's center conductor.  When that output is enabled, plenty of signal couples to the receiver out for you to hear it and tune to your frequency.

          Keying is accomplished by simply switching the CLK0 output of the Si5351 on and off.

          The power amplifier is a class E amp.  The incoming signal switches the MOSFET on and off at frequency.  The resulting high power square wave is smoothed by L2 and C2 into a sine wave.   The low pass filter provided by L3 and C3-C4 will suppress the second order and above harmonics by more than 50db as required by the FCC's rules.   The second order harmonic falls around 900kHz, within the AM broadcast band, so it's important to suppress that to prevent interference.

         I built it as the author designed it, Manhatten style on a flat piece of PCB.  There is a small heat sink on the MOSFET and I cut the copper around the sink to isolate it from ground.  This is IMPORTANT since the MOSTFET's tab is at V+ and would cause a short if not isolated.  Also be sure to isolate the mounting screw on the back side of the board.

        The three coils are easy to wind.  Use magnet wire and follow the turn counts listed in the schematic.   If you have a 3D printer, I designed coil forms at the correct dimensions that can be downloaded from thingiverse at the link below.

    3D printable coil forms.

         Two relays are employed.  RLA1 is a DPDT type.  One half of it switches power on to the MOSFET, the other half switches the antenna jack from the receiver output to the amplifier output.
    RLA2  is a DPST type that grounds the receiver output jack during transmit in order to protect your receiver from excessive RF from the amplifier.

        NOTE:   It should be possible to adapt this transmitter to any of the amateur bands by changing L2, L3, and C2-C5, then modifying the arduino software for the different frequency range.  You'll have to research class E RF amplifiers to calculate the appropriate values.


    Software:

       The arduino software can be downloaded from github here:

    630 meter arduino sketch

       You WILL need to add the etherkit Si5351 library in your arduino IDE.  Go to the sketch menu and select 'Include Library' 'manage libraries'.  In the library manager, type 'etherkit' into the search box and add the Etherkit Si5351 library.   This library will work with the adafruit break out board as well.  I chose this library since it allows you to pass a direct frequency rather than the complicated method adafruits library requires.

       I have liberally commented the software to make it easier to follow. 

       The first section and setup routine define variables that are used through the program,  setup the hardware I/O pins, and defines an interrupt routing.

       The rest of the program can be broken down into three sections.   The main loop,  the interrupt routine,  and a tuning function.

       The main loop handles the keying and tuning.   It checks the spot button and if pressed, calls the tuning function.   I ONLY change the tuning while the button is pressed.  This is to prevent 'jitter' of your frequency while transmitting.   It then checks for key down or key up and switches the relays, turns the Si5351 output on or off as needed.

       The tuning function reads the tune pot and calculates a number from 0 to 7000, the width of the 630 meter band.  The resulting number is added to 472000, the bottom edge of the band, and stored in the variable 'freq'.  'freq' is then multiplied by 100 to bring it to the value the etherkit library expects, in 1/100ths of a Hz.

       The interrupt routine is set to run 1000 times a second and is used to decriment a counter for the tail delay.  I used an interrupt routine for precision since I know it will run exactly 1000 times a second.  I can then use a variable as a timer within the program.


    Video:  (please watch these before you ask questions, you'll probably find your answers.)

       I produced a series of videos on the transmitter.  You can follow the entire process, my trials and errors through the project.   Skip right to the last video if you just want to see the finished design.

    Video #1 is me talking about the idea and initial design of the transmitter
    Video 1,  the design.

    Video #2 is my initial hardware build in a small case.
    Video 2. hardware nearly done. (or so I thought!)

    Video #3 is a talk about the arduino software and a demo of the operation of the hardware.
    Video 3. The software is done.

    Video #4 is the final hardware build of the complete and working unit.
    Video 4. The hardware redesign and demo

       This little transmitter performs extremely well and I'm very happy with the results.  If you choose to build it, I'm sure you'll find it to be a nice little workhorse. 

    73, and maybe see you on the air sometime.

    Kevin,  KB9RLW
    4

    View comments


  9.     The SDRPlay RSP2 is an excellent bit of kit.   A highly sensitive SDR with multiple antenna inputs,  input filtering, 10 Mhz bandwidth, and a range from 2Ghz all the way down to 1Khz.   On the windows side, they provide a very nice SDR program called SDR uno.

       Those of us not running windows, however, have a few choices in software.   GQRX is a popular program, built on GNU-radio.  There's a couple of others that escape my mind, but the newcomer, CubucSDR, is starting to stand out.


       After much searching and experimenting,  I have come up with a list of steps that will build and install the needed support frameworks and software to get you up and running with CubicSDR and your SDRPlay.  
    CubicSDR manual is here, worth reading through, you might get confused in the software without it.
    http://cubicsdr.readthedocs.io/en/latest/index.html

        There are a few software packages that are needed for the SDRPlay to work.   SoapySDR is a framework for talking to several SDR hardware types, Cubic relies on it.   We'll also need the specific soapy module for the SDRPlay, and a few other packages needed to build cubic.

       I have created two scripts that largely automate the installation.   You can download them using the following link:

                        Click to go to the github page.


    And here's a video where I talk about this whole project.


      Now, the instructions.

       You will need to create a folder on your desktop named 'sdrplay' and put these script files there. You will also need to download the driver for linux from the SDRPlay site and also place it in that folder.  Do not install it yet!

       Open a terminal and change into your newly created directory with the command:

    cd ~/Desktop/sdrplay

        Now, you can run the first script.  This will install build software from ubuntu's repositories, along with dependencies needed by the packages we will be building.   It will also clone sever github projects, including soapySDR and CubicSDR.

       The script MUST be run as root, so use sudo to execute it:

    sudo ./Install_script-pt1.sh

       It will take awhile and will ask you to type 'y' once for the installs.   Once it's completed,  you will need to run the installer from the SDRPlay site.  Again, you need to make sure you run their script as root with sudo.  If it's not executable,  you can run:

    sudo chmod +x ./{scriptname}

    (where {scriptname} is the name of the downloaded file)

    It will show you a license agreement you need to spacebar through and hit 'y' to accept.

       After their script is done, you can run the install script part two, again with sudo:

    sudo ./Install_script-pt2.sh

      This one will also take awhile while building CubicSDR.   Once done, you should be all ready to go!   CubicSDR won't automatically be added to any menus, you'll have to do that yourself.  You can also run it from within the terminal by simply typing CubicSDR.    If you had the SDRPlay plugged in during this installation,  unplug it for a few seconds and then plug it back in.  When you run Cubic, it should find the unit and list it for selection.

    ADDENDUM:  These scripts also work on the raspberry Pi 3 with the current version of raspian.  Obviously you need to download the raspberry pi version of the hardware driver from the SDRPlay site.  
    There's just one extra step to get pulse audio working under raspian.   You need to modify one of the autostart scripts.
    In a terminal,  type:

    sudo pico /etc/xdg/autostart/pulseaudio.desktop

    Scroll down and find the line:

    Exec=start-pulseaudio-x11

    Change that line to:

    Exec=/bin/sh -c "Sleep 5; start-pulseaudio-x11"

    Ctrl-o to write the changes,  Ctrl-x to exit.  Now reboot the pi and the pulse audio server will start.  This probably fixes other things that rely on pulse as well.

    Have fun!

    Kevin,  KB9RLW

    The scripts are pasted below.  you can follow through their steps manually with copy/paste into your terminal. (don't forget sudo).  Or you can copy each in it's entirety and paste it into an editor, save it, mark it as executable and then run it.

    #/*    script 1 below /*

    #! /bin/bash
    # This script should install and build all needed stuff for
    # using the SDRPlay on Ubuntu 16.04 or later.  It must be
    # run as root.
    #
    # First we install needed dependancies.

    apt-get install git build-essential automake cmake g++ swig
    apt-get install libgtk2.0-dev libpulse-dev libpython-dev python-numpy.
    apt-get install mesa-utils libeglw1-mesa libglw1-mesa-dev
    apt-get install freeglut3-dev freeglut3

    # Now we'll git the projects we need

    git clone https://github.com/jgaeddert/liquid-dsp
    wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2
    tar -xvjf wxWidgets-3.1.1.tar.bz2
    git clone https://github.com/pothosware/SoapySDR.git
    git clone https://github.com/pothosware/SoapySDRPlay.git
    git clone https://github.com/pothosware/SoapyRemote.git
    git clone https://github.com/cjcliffe/CubicSDR.git

    # Build liquid-dsp

    cd liquid-dsp
    ./bootstrap.sh
    ./configure --enable-fftoverride
    make -j4
    make install
    ldconfig
    cd ..

    # Build wxwidgets

    cd wxWidgets-3.1.1/
    mkdir -p ~/Develop/wxWidgets-staticlib
    ./autogen.sh
    ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --prefix=`echo ~/Develop/wxWidgets-staticlib` CXXFLAGS="-std=c++0x" --with-libiconv=/usr
    make -j4
    make install
    cd ..

    echo "."
    echo "First part of installation done.   Now run the SDRPlay file you"
    echo "downloaded from their site.  Be sure to use sudo to run it!"

    #/* end of script 1 /*


    #/* script 2 below /*

    #! /bin/bash
    # This script should install and build all needed stuff for
    # using the SDRPlay on Ubuntu 16.04 or later.  It must be
    # run as root.
    #
    # This is part two.
    # Here we build SoapySDR

    cd SoapySDR
    mkdir build
    cd build
    cmake ..
    make -j4
    make install
    ldconfig
    cd ..
    cd ..

    # Now we build the SDRPlay module for Soapy

    cd SoapySDRPlay
    mkdir build
    cd build
    cmake ..
    make
    make install
    cd ..
    cd ..

    # And we build SoapyRemote

    cd SoapyRemote
    mkdir build
    cd build
    cmake ..
    make
    make install
    cd ..
    cd ..

    # And finally,  we build Cubic.  This takes awhile!

    cd CubicSDR
    mkdir build
    cd build
    cmake ../ -DCMAKE_BUILD_TYPE=Release -DwxWidgets_CONFIG_EXECUTABLE=~/Develop/wxWidgets-staticlib/bin/wx-config
    make
    make install
    cd ..
    cd ..
    rm -R ~/Develop

    # now we change permissions on these root-owned folders so the user can
    # delete them at their leisure.

    chmod -R 0777 ./*

    # And we're done.   Cubic should work with the SDRPlay.  The user can
    # run it from the terminal with CubicSDR or add this command to a menu.

    #/* end of script 2 /*
    85

    View comments

  10.      I decided to build my own keyer.  I needed a new Arduino project and this seemed like the perfect one.    I had a few ideas for the design.

         I wanted a keyer that would take multiple inputs,  paddles, straight key, and computer keyboard.  The idea being you can send however you like, without needing to change around cables, just send.

         There are many arduino morse projects around already.  I suppose I could have just downloaded an existing one, dropped it in and ran with it.  But I wanted to tackle the challenge of coding it myself.



         Once I'd sorted the hardware out,  I started to work on the software.   It turned out to be a bigger challenge than I'd expected!   It's tricky, the timing of reading the paddles and keying.   I came up with an interesting solution to timing when it comes to keying the rig.

         You see, the main loop in the arduino sketch can vary in how fast it executes, based on how much work it has to do.   My solution was to use a timer in the chip and schedule an interrupt.

         All processors have timers for this.   They run at a set speed and can interrupt the processor, forcing it to execute a small routine at precise intervals.  This is useful in robotics, for example, like in a flying drone.  You would need adjustments to the motor speeds to be occurring fast and regularly.

        So, in my keyer,  there is an interrupt that is running a keying routine once every millisecond.  That's 1000 times per second,  precisely.   That allows me to control the timing of the keying exactly and produce clean, consistent Morse out to the radio.    This routing watches a buffer that I load with events using the characters period,  dash, and comma.    Period and dash are obviously the Morse elements, and the comma is a delay equivalent to a dot.

        So to send an 'A' for example,  you'd load the event buffer with  .,-,   dot comma dash comma.   The interrupt routine would immediately key the transmitter with cleanly spaced precise Morse.

        The hardware is extremely simple.  The schematic is below.   The pins chosen are arbitrary and can be changed to suit your build if needed.  They are referenced in the first few lines of the code and you change those to reflect the pins you use.   The keying is handled by a simple transistor switch.  You could use an opto-isolator if you wish,  but I've had no trouble keying modern rigs this way.





       The software is below.  Simply copy and paste it into the Arduino IDE to upload it to your board.  Upon startup it will briefly key the radio for a fraction of a second and then be ready to accept input.  I wired an additional input jack for a straight key.  That was simply parallel to the keying output and done for convenience.

        For keyboard input, the code monitors the serial input.  When the Arduino is powered by a USB connection to your computer, it will create a serial port.   Simply run a terminal program and connect it to that port to allow you to send keyboard CW.  You want to set your terminal program to 9600 baud, no parity, 1 stop bit and 8 data bits.  Type to send at the current speed.  Simple.

       The code is up to version 1.4.   Paddle routines have been heavily worked on,  2 memories have been added.    shft-alt-1 to load memory one,  alt-1 to send memory one.  Same for memory 2,  shft-alt-2 and alt-2.

    Code pasted below:

    /*

      Super Simple Keyer Ver 1.4  Arduino based keyer
      Written Apr. 30, 2017 by Kevin Loughin, KB9RLW

    Ver 1
      Initial release, keyer working ok, not iambic

    Ver 1.2
      First iambic code, dependent on timing, not perfect

    Ver 1.3
      Rewrite of keyer logic, iambic and dot dash buffering working!

    Ver 1.4
      Tweaked paddles a bit.  Added 2 memories.  shft-alt-1 to set mem 1, shft-alt-2 to set memory 2
      alt-1 to send memory 1, alt-2 to send memory 2.
      Tweaked character spacing for keyboard decode. Added BT using the minus sign.

    */

    //  Pins we're going to use.  Change as needed.
    const int wpmraw = A7;  //Pot sense for speed
    const int dotin = 4;  //dot sense pin
    const int dashin = 2; //dash sense pin
    const int keyout = 13; //keying output

    // declaring variables we'll use in program

    int delayval = 150;  //delay between elements in milliseconds
    String event = "";  //event contains the elements currently being sent, .=dot -=dash ,=space
    String memory1 = ""; //user memory 1
    String memory2 = ""; //user memory 2
    String membuff; // buffer for memory sending
    int dotlen = 150;  //current dot length in milliseconds
    int dashlen = (dotlen * 3);  //dash length in milliseconds
    int active = 0; //keying handler flag
    int delaycount = 0; // delay counter in interrup handler
    int dotstate = 1; // dot paddle input pins reading
    int dotread = 0;
    int dashstate = 1; //dash paddle input pins reading
    int lastdotstate = 1;
    int lastdashstate = 1;
    int dashread;
    int lastdashdebounce;
    int lastdotdebounce;
    int eventbuffer = 0;  // event buffering
    int dashhalf;
    int lastchar = 1;
    int c;
    int dotbuffer;
    int dashbuffer;
    int dashdelay;
    int dotdelay;
    int flag;

    void setup() {
      // Turn off keying pin right away

      pinMode (keyout, OUTPUT);
      digitalWrite(keyout, LOW);


      // setup input pins
      pinMode (dotin, INPUT);
      pinMode (dashin, INPUT);
      digitalWrite(dotin, HIGH);
      digitalWrite(dashin, HIGH);
      Serial.begin(9600);

      //  setup the interrupt
        OCR0A = 0xAF;
      TIMSK0 |= _BV(OCIE0A);
    }


    //  interrupt handler
    SIGNAL(TIMER0_COMPA_vect)
    {
     if (  event.length() > 0  ) //do we have anything to do?
     {
       if ( !active ) //are we not currently sending?
       {
         if ( event.charAt(0) == '.')  //do we need to send a dot?
         {
          digitalWrite(keyout, HIGH); //key on
          delaycount = dotlen;
          active = 1;
          lastchar = 1;
         }
         if ( event.charAt(0) == '-' ) //do we need to send a dash?
         {
          digitalWrite(keyout, HIGH); //key on
          delaycount = dashlen;
          active = 1;
          lastchar = 2;
       
         }
         if ( event.charAt(0) == ',' )  //do we need to delay between elements?
         {
           delaycount = dotlen;
          digitalWrite(keyout, LOW); //key off
          active = 1;
          }

         }
       
        }
        if ( active ) // we're already active, count and reset when done
         {
           delaycount--;
            if ( !delaycount )  //are we done with this element?
            {
              active = 0;
              digitalWrite(keyout, LOW); //just make sure the key is off
              event.remove(0, 1);
            }
          }
      }


    void loop()
    {
      // read the speed and set timing

    dotlen = ( 200 - (.146 * analogRead(wpmraw)) );
    dashlen = ( 3 * dotlen );

    //  Read paddle inputs

              // read the dash pin
      dashread = digitalRead(dashin);
       if ( dashread != lastdashstate )
          lastdashdebounce = millis();
       
        if ( (millis() - lastdashdebounce) > 40 )
        {
          if ( dashread != dashstate )
            dashstate = dashread;
        }
        lastdashstate = dashread;
     
      // read the dot pin
      dotread = digitalRead(dotin);
     if (dotread != lastdotstate)
          lastdotdebounce = millis();
       
        if ((millis() - lastdotdebounce) > 40)
        {
          if (dotread != dotstate)
            dotstate = dotread;
        }
        lastdotstate = dotread;


    // Keyer logic

    while (!dotstate || !dashstate )  //   if paddles pressed, do
      {
        if ( event.length() < 3 )  // don't bother unless there's no more than 1 chars in buffer
        {

          if ( !dotstate && !dashstate ) // both paddles?
          {
            if ( lastchar == 1 && ( delaycount < dashlen ))
            {
              event = String(event + "-,");
              lastchar = 2;break;
            }
            if ( lastchar == 2 && ( delaycount < dashlen ))
            {
              event = String(event + ".,");
              lastchar = 1;break;
            }
          }

          if ( !dotstate && dashstate )  // only dot paddle
          {
            if ( lastchar == 1 && ( delaycount < dashlen) && event.length() < 1)
            {
              event = String(event + ".,");break;
            }
            if ( lastchar == 2 && event.length() < 3)
            {
              event = String(event + ".,");break;
            }
          }

          if ( dotstate && !dashstate )  // only dash paddle
          {
            if ( lastchar == 1 && (delaycount < dotlen))
            {
              event = String(event + "-,");break;
            }
            if ( lastchar == 2 && (delaycount < (dotlen * 2)) & event.length() < 2)
            {
              event = String(event + "-,");break;
            }
          }
        }
    break;
      }
    delay(12);

    //  Keyboard routines

    while(Serial.available())
     {
      c = Serial.read();
      Serial.write(c);
      // check for special keys
      if ( c == 27 ) // alt key pressed
        {
          flag = 1;
          c = Serial.read();
        }
      if ( flag && c == 33 ) // shft-alt-1, memory 1 define
        {
        loadmemory(1);
        flag = 0;
        c = 0;
        }
      if ( flag && c == 64 ) // shift-alt-2, memory 2 define
        {
          loadmemory(2);
          flag = 0;
          c = 0;
        }
      if ( flag && c == 49 ) // alt 1, send memory 1
        {
          sendmemory(1);
          flag = 0;
          c = 0;
        }
      if ( flag && c == 50 ) // alt 2, send memory 2
        {
          sendmemory(2);
          flag = 0;
          c = 0;
        }
     
      decoder(c);  // call the keyboard decoder to load this event
     }
    }

    void loadmemory(int num) // interact with user to load a memory
    {
      String inData;
      char received;
      Serial.println( "." );
      Serial.print( "Enter the contents for memory " );
      Serial.println( num );
      Serial.println();

        while ( received != 13 )
        {
          if (Serial.available())
          {
            received = Serial.read();
            Serial.write(received);
            inData += received;
          }
        }
      if ( num == 1 ) // loading memory1
        {
          memory1 = inData;
        }
      if ( num == 2 ) // loading memory2
        {
          memory2 = inData;
        }
      Serial.println();
      Serial.print( "Memory " );
      Serial.print( num );
      Serial.println( " loaded with" );
      Serial.println( inData );
      inData == "";
    }

    void sendmemory(int num) // send memory number num
    {
      if ( num == 1 )
        membuff = memory1;
      else
        membuff = memory2;
      Serial.println( "." );
      Serial.println( membuff );
      for(int leng = membuff.length(); leng > 0; leng--)
        {
          decoder(membuff.charAt( membuff.length() - leng ));
        }
    }
    void decoder(int in) // function to decode char for sending and load send buffer
    {
           switch(in)
      {
          case ' ' : event = String(event + ",,"); break;
          case 'a' : event = String(event + ".,-,,,"); break;
          case 'b' : event = String(event + "-,.,.,.,,,"); break;
          case 'c' : event = String(event + "-,.,-,.,,,"); break;
          case 'd' : event = String(event + "-,.,.,,,"); break;
          case 'e' : event = String(event + ".,,,"); break;
          case 'f' : event = String(event + ".,.,-,.,,,"); break;
          case 'g' : event = String(event + "-,-,.,,,"); break;
          case 'h' : event = String(event + ".,.,.,.,,,"); break;
          case 'i' : event = String(event + ".,.,,,"); break;
          case 'j' : event = String(event + ".,-,-,-,,,"); break;
          case 'k' : event = String(event + "-,.,-,,,"); break;
          case 'l' : event = String(event + ".,-,.,.,,,"); break;
          case 'm' : event = String(event + "-,-,,,"); break;
          case 'n' : event = String(event + "-,.,,,"); break;
          case 'o' : event = String(event + "-,-,-,,,"); break;
          case 'p' : event = String(event + ".,-,-,.,,,"); break;
          case 'q' : event = String(event + "-,-,.,-,,,"); break;
          case 'r' : event = String(event + ".,-,.,,,"); break;
          case 's' : event = String(event + ".,.,.,,,"); break;
          case 't' : event = String(event + "-,,,"); break;
          case 'u' : event = String(event + ".,.,-,,,"); break;
          case 'v' : event = String(event + ".,.,.,-,,,"); break;
          case 'w' : event = String(event + ".,-,-,,,"); break;
          case 'x' : event = String(event + "-,.,.,-,,,"); break;
          case 'y' : event = String(event + "-,.,-,-,,,"); break;
          case 'z' : event = String(event + "-,-,.,.,,,"); break;
          case 'A' : event = String(event + ".,-,,,"); break;
          case 'B' : event = String(event + "-,.,.,.,,,"); break;
          case 'C' : event = String(event + "-,.,-,.,,,"); break;
          case 'D' : event = String(event + "-,.,.,,,"); break;
          case 'E' : event = String(event + ".,,,"); break;
          case 'F' : event = String(event + ".,.,-,.,,,"); break;
          case 'G' : event = String(event + "-,-,.,,,"); break;
          case 'H' : event = String(event + ".,.,.,.,,,"); break;
          case 'I' : event = String(event + ".,.,,,"); break;
          case 'J' : event = String(event + ".,-,-,-,,,"); break;
          case 'K' : event = String(event + "-,.,-,,,"); break;
          case 'L' : event = String(event + ".,-,.,.,,,"); break;
          case 'M' : event = String(event + "-,-,,,"); break;
          case 'N' : event = String(event + "-,.,,,"); break;
          case 'O' : event = String(event + "-,-,-,,,"); break;
          case 'P' : event = String(event + ".,-,-,.,,,"); break;
          case 'Q' : event = String(event + "-,.,-,-,,,"); break;
          case 'R' : event = String(event + ".,-,.,,,"); break;
          case 'S' : event = String(event + ".,.,.,,,"); break;
          case 'T' : event = String(event + "-,,,"); break;
          case 'U' : event = String(event + ".,.,-,,,"); break;
          case 'V' : event = String(event + ".,.,.,-,,,"); break;
          case 'W' : event = String(event + ".,-,-,,,"); break;
          case 'X' : event = String(event + "-,.,.,-,,,"); break;
          case 'Y' : event = String(event + "-,.,-,-,,,"); break;
          case 'Z' : event = String(event + "-,-,.,.,,,"); break;
          case '0' : event = String(event + "-,-,-,-,-,,,"); break;
          case '1' : event = String(event + ".,-,-,-,-,,,"); break;
          case '2' : event = String(event + ".,.,-,-,-,,,"); break;
          case '3' : event = String(event + ".,.,.,-,-,,,"); break;
          case '4' : event = String(event + ".,.,.,.,-,,,"); break;
          case '5' : event = String(event + ".,.,.,.,.,,,"); break;
          case '6' : event = String(event + "-,.,.,.,.,,,"); break;
          case '7' : event = String(event + "-,-,.,.,.,,,"); break;
          case '8' : event = String(event + "-,-,-,.,.,,,"); break;
          case '9' : event = String(event + "-,-,-,-,.,,,"); break;
          case '.' : event = String(event + ".,-,.,-,.,-,,,"); break;
          case '-' : event = String(event + "-,.,.,.,-,,,"); break;
          case '/' : event = String(event + "-,.,.,-,.,,,"); break;
      }
    }



    6

    View comments

Loading