Monday, February 3, 2014

Simple Amateur Radio Morse Beacon

If you aren't an Amateur Radio operator, and you're in engineering/computer science, you should check it out.  It's very simple to get a Technician license (what I currently have as of 2/3/14) as they give you all the test questions (and answers) for the test and there's no longer a Morse Code requirement (copy and send at least 5 words per minute (wpm).  This license they lets you dig in the world that is radio; if anything it will strengthen your understanding of electronics and physics.

Well as the title suggests, this little project took me about an hour (takes time to plug in cords and get pictures) to do.  A "beacon" is basically an automated message playing over and over typically on HF bands.  Nowadays, aside from QSL cards which Hams send to each other to verify a contact, there are many online and computerized logbooks.  Sometimes you can find out if an area of the world is receiving your signal based off your beacon operation.

For this tutorial, you need:
--Soldering iron and solder
--Radio (I'm using Kenwood TS-130S) and accompanying power supply
--Arduino Uno
--4 jumper wires
--1 breadboard
--2 aligator clips
--Wire cutters and some spare wire
--BC 337-16 NPN Transitor
--1/4" Audio Jack

Now to begin:

1) Using wire cutters, you gently squeeze around the wire to cut the outside plastic.  When you have weakened the outside plastic in a circle around the wire, you grasp (be careful depending on how thin the wire is, it'll probably take a few times until you get it) with the cutters and slide the plastic off, exposing the metal wires.  Do this for 2 pieces of wire on each end.  For the purposes of demo-ing this, I used aligator clips to grab the ends going to the audio jack and also the jumper wires going back to the breadboard.

2) Now take the transistor, with the flat side facing you.  The NPN transistor has a collector, base, and emitter terminal for different layers in that order.  So with the flat side facing you, C for collector, B for base, and E for emitter.  Remember that.  Place it in the breadboard, make sure the connection is snug.

3) Now whip out your soldering iron.  There isn't much to solder here so if you're not good at it, don't worry.  Now you need to take one of those cut wires from step 1 and wrap the metal around one of the the insides.  The longer one is the SLEEVE or GROUND for the EMITTER on the transistor.  The shorter one is the TIP or SIGNAL for the COLLECTOR on the transistor.  The base on the transistor goes into pin 13 (which will make more sense when I show the code).

4) Now we will flash code onto the Arduino.  Make sure you know how to do this before continuing here.  The code, I copied (maybe I'll write my own soon, it wouldn't be hard) from here, check out his site it's good.  In the "Setup" portion of the code, you can change the start-up message to whatever you want, and then the "Loop" portion is what will be constantly transmitted by your radio.  Flash this code on your Arduino.

5) Now, since the code conviently used pin 13, we don't need to add a 1K resistor (MAKE SURE TO CHECK IF YOUR ARDUINO IS NEWER SO IT HAS THIS RESISTOR, or you may damage it).  Now from here it's very simple, we just connect the COLLECTOR to SIGNAL on audio jack, BASE to pin 13, and EMITTER to GROUND in the audio jack AND GROUND on the Arduino board.  Now give power to the Arduino and plug in the audio jack to your radio, if it doesn't work let me know your set-up, I had some funny issues and maybe some contact issues with the breadboard; but it was great to hear it work!

*Note that I used a 1/4 inch audio jack that actually went into my radio, with a smaller audio jack going into it.  The audio jacks on older radios are bigger, no modern headphones would be able to plug in with out an adapter of sorts.

*I was supposed to have this up and running with an LCD screen displaying the message for my dad for Christmas, I enjoyed break a little too much and got caught up in other programming languages.  When I add that functionality I will update this blog post.  I may also add some sort of message input functionality from the LCD screen with an EEPROM chip, we'll see.