Monday, October 24, 2011

Modifying an FRS/GMRS radio for HAM frequencies using a diode

A few years ago I worked on modifying an FRS radio for use on ham frequencies. The modification was complicated, and required some very fine SMD soldering and PIC ucontroller programming. The idea was to be able to use a cheap FRS radio as an APRS transmitter, possibly for high altitude balloon projects. Recently I have taken a second look at this topic and found a very simple method for converting FRS radios to ham. It requires only a diode and minimal soldering!

I'll go into the details of why this works later, but for the short of it, all you have to do is solder a diode between the PLL strobe pin and the PTT switch. That's it. Your radio should now transmit on the channel frequency minus the IF frequency of your radio (usually 21.4 MHz)  Now read-on to find out the details and limitations.

FRS radios operate in the 460 MHz region, and ham frequencies are 430-450. Most FRS radios use a PLL chip to set the operating frequency. If you can control the PLL, you can control the frequency.  The PLL is set by the radio's main processor via 3 lines, data, clk, and strobe. The data it sent one bit at a time and clocked in by the clk line. When an entire command has been sent, the stb line is set high, telling the PLL to start using the settings.

When the radio is going to transmit at 467.5625 MHz (FRS channel 8), the processor sends a command to the PLL to switch to that frequency. For RX, though, it's different. When the radio is going to listen on 467.5625, the PLL doesn't go to 467.5625 MHz. Instead it goes to something like 446.1625 MHz. This is because the radio uses an intermediate frequency of 21.4 MHz (different for each radio). So, 446.1625 + 21.4 = 467.5625. The good news for us is that 446.1625 is right in the ham band. So, we want is stay on the RX frequency while we transmit. That's where the diode comes in. When the PTT button is pressed, it pulls the PTT line to ground. With the diode, the PLL's strobe line also gets pulled to ground, and stops it from switching frequencies. So the radio now transmits in the ham band.

To make the modification, you need to find your PLL chip, and identify the stb line. On most of my radios, the chip is a TB 31202, and the stb line is conveniently locate on pin 8 (right on the end, so it's easy to solder to). I recommend using very fine wire, like 30 AWG or transformer wire. On the PTT switch, identify which side is ground. Solder the diode to the other side, which is PTT. Solder the black-stripe end of the diode to the PTT, and the other end to the stb wire.

There are a few things you have to understand before doing the mod, though. First, you need to know the radio's IF. It's usually around 21.4 MHz. Just look for a crystal on the board with that frequency. If you find one, you're in luck. I have one radio with an IF of 10.7 MHz. This one DOESN'T work. It will transmit somewhere between the ham and FRS bands, which is not good.

Also not all PTT switches go to ground. I have one radio where this is the case. I had to ground the stb line separately to get it to work.

Sometimes the mod doesn't work reliably, and I believe it's an issue with switch bounce in the PTT. When I drive the PTT with a transistor (like with an APRS tracker) it is very reliable.

Complications and work-arounds
I have found some complications and solutions, which I'll try to describe here. The biggest problem arises from the radio's battery saver feature. After some period of inactivity (around 10 seconds) the radio will turn the PLL off, then breiefly re-enable it about twice per second to check for activity. If you happen to TX right when the PLL has been re-enabled, then there's no problem. But the more likely scenario is that you PTT when the PLL is asleep. Because this method works by disabling the PLL input, the PLL doesn't wake up, and you get no TX. I've found a couple of work-arounds. First, just be sure your transmit period is less than the time it takes for the battery-saver to kick in. Then it will never go to sleep and you will always have PLL lock. The second is to pulse the PTT briefly (a few ms) just prior to your real transmission. This wakes up the PLL and puts it on the correct frequency.

A further complication with one of my radios is that the stb line doesn't recover quickly enough when PTT is released. When it's released, the uC should program the PLL back to the listening frequency. If the voltage on the stb line doesn't recover quickly enough, however, the PLL doesn't see the pulse to accept the programming. That's not a problem as long as the PLL is already on the listening frequency (we are trying to TX on the listening frequency, so this should be the case). But, if the radio goes into battery save mode as discussed above, then it's a big problem. Now, pulsing the PTT doesn't get your PLL back to the right frequency. I tried a few solutions involving an RC circuit to delay the PTT recovery, but I couldn't get them to work. The more stable solution was to control the stb line separately with my arduino. I disable stb right before PTT and re-enable a short delay after release of PTT. This ensures that the PLL gets the proper programming.

Friday, September 16, 2011

Using your arduino to program a Turnigy 9X transmitter

I recently purchased a Turnigy 9x transmitter from Hobby King, with the full intention of upgrading the firmware. I had know (or thought) that it was possible to program AVR's using an arduino as the programmer, and being a cheapskate, I didn't bother to purchase one of the recommended programmers. I figured many people must have already done this and there would be some good guides out there. Well, I was wrong. There are some excellent guides on programming the radio with standard hardware, but none using the arduino. That's where this guide comes in. It's meant as a supplement to other guides.

Turn your arduino into an AVRISP programmer
This one is pretty simple. Go to the arduino software, and find the example “arduinoISP”. Open the sketch and upload it to your arduino. See the arduino page for more info.

Attach cable to TX
Open your transmitter, and identify the solder points. There are six of them, and you can refer to other guides if you are unsure. I used a 5S1P lipo connector because it has 6 conductors and I had one lying around. It works pretty slick. I didn't bother to label anything at this point. Just soldered one wire to each point.

Attach test leads
On the other end of the cable, plug in the male portion of the plug with bare pins on the back side. Cut 3 test leads in half and soldered all six pieces to each of the six bare posts. Now with a multimeter, match-up and label each test lead with its corresponding point on the PCB. Label them according to this picture.

Prepare arduino
Connect all the test leads to the arduino using the pin assignments from the sketch. It should be as follows:

// 10: slave reset
// 11: MOSI
// 12: MISO
// 13: SCK

Connect the gnd and +5V to the power block on the arduino, and tripe check that you have the polarity correct.

Disable auto reset
Some arduinos (including my Duemilanove) have an auto reset function that needs to be disabled. To do this, place a 120 Ohm resistor between +5 and reset. The instructions are here.

Prepare eePe
In the eePe software, burn->configure and select the AVRISP programmer from the list. Assuming your radio is like mine, set the processor to m64, and set your port to whatever your arduino uses. In the extra arguments line, put “-b 19200”

Program the radio
You should be good to go. Follow the other guides for programming from here. I suggest you back-up your flash memory first, and all that.