Home‎ > ‎

Two Tone Paging Decode (old)

A PIC-Based Two-Tone Paging Decoder

Update - Click here to see a new, improved design

Or, for a software two-tone decoding program that runs on Windows, see this page

Introduction 

Some of Uniden's newer scanners feature a fire tone out feature that lets the scanner act like a pager. The scanner doesn't make any noise until the fire department you want is toned out, at which time it alerts. It's a neat feature, and I wanted to see if I could build something similar that could be added on to any existing scanner or receiver.

What I needed was a two-tone decoder. These are commercially available from companies like Midian Electronics for about $120 or less, but I didn't want one badly enough to buy one, and I wanted to tackle the challenge of building my own, just to see if I could do it.

Options 

 There are several different ways that a tone decoder could be built. The most elegant and cost-effective way to do it is to use a microcontroller that has enough processing horsepower to do some simple digital signal processing (DSP). The micro would sample the audio, determine whether the tone was present or not, and then alert if the correct tone sequence was received. Unfortunately, I'm only a novice programmer, so this kind of signal processing is a little above my head unless I have MATLAB to help me out. Doing it in assembly language seemed a little too ambitious.

Another option would be to convert the incoming audio waveform to a digital on/off signal using a simple transistor circuit. A simple microcontroller could then count the digital pulses over a certain period of time and determine the frequency of the incoming audio signal. An example of this is method is a PIC based Morse Code Reader. This technique works well for pure sine waves, but when hooked to a radio receiver it has to deal with normal speaking audio when tones aren't being sent. This method may work for a paging decoder, but I'm guessing it will be somewhat susceptible to falsing. It could probably be made to work with a lot of testing and trial and error.  *Update* - This technique can be made to work quite well.  See this page for a design based on this technique.

The method I chose to use utilizes an an analog filter for tone detection. Normally analog filters aren't adjustable through software, but by using a digital potentiometer as part of the RC network, the PIC microcontroller can adjust the filter on the fly. The tone decoder circuit is based on an LM567 tone decoder IC. The frequency of the tone it looks for is set with an RC network, and the output is a transistor to ground, which is a digital signal. The digital potentiometer I used is an Analog Devices AD5160, but just about any digital pot could be used as long as it has enough resolution. I found that a 50k ohm pot with 256 steps gave me enough resolution for two tone paging and worked well with a .1uF capacitor.

I used a PIC18F1220 microcontroller which is kind of overkill for what I have so far.  However, this PIC has EEPROM and a serial port, which means that if I ever got really ambitious I could make the tone decoder programmable from a PC serial port.  The way it stands right now it has to be reflashed with a programmer to change settings.

 Hardware

The LM567 tone decoder's bandwidth is very sensitive to input voltage.  In other words, if you drive a very large signal into the input, the filter bandwidth will be huge.  For this reason, it's important to keep the input peak to peak voltage around 75 mV.  Input potentiometer R2 is used to set the input audio level.  The decoding center frequency is also very sensitive to capacitor tolerance (see LM567 datasheet).  A 10% capacitor at the edge of its tolerance band can change the decode frequency enough to really mess things up.  For this reason it's important to do an individual characterization of the filter using a signal generator before trying to program the PIC.  Part to part variability will influence what values the digital potentiometer needs to be set to.   

The PIC commands the digital potentiometer over a three-wire SPI bus.  The potentiometer terminals are connected to the LM567 in place of a fixed resistor.  

Software

Here's a quick overview of what the PIC software does.  When the unit first powers up, the PIC sets the  digital potentiometer to a value that sets the tone decoder to look for the first tone of the two-tone paging sequence.  It then looks at the output of the tone decoder.  If the tone is detected, the PIC sets the digital potentiometer to a value that sets the tone decoder to look for the second tone of the two-tone sequence.  After waiting a few milliseconds to let the digital potentiometer stabilize, the PIC looks at the tone decoder output again.  If the second tone is present, the PIC turns on the LED.  If the second tone is not detected within four seconds, the PIC resets the digital pot to look for the first tone and goes back to looking for that tone.  Multiple tone sets can be detected, as well as single tone "group call" pages.  Sample source code can be found here.  This code is pretty bare-bones, but it can be enhanced easily to add functionality.

Results

The circuit seems to work pretty well.  As I mentioned earlier, the decoding bandwidth is sensitive to input voltage, so make sure to adjust the input signal for about 75 mV peak to peak.   I've only built it on a breadboard so far, and all it does is turn on an LED, so it's really not very useful.  However, with some packaging, interfacing, and software enhancements this could work very well for scanner listeners or remote control applications.  

Possible Enhancements

1)  Printed Circuit Board - this is the most obvious and most needed.  Having this sitting on a breadboard isn't very useful except for testing and debugging.

2)  Computer programmable - if the serial port and EEPROM on the PIC are put to use, it would be possible to program the desired tones using Hyperterminal or something similar.  That would make it useful for a lot more people who don't have the hardware or know-how to program PICs.

3)  Multiple Outputs - how about having a couple of outputs tied to the "scan" and "manual" buttons on an old scanner, along with an audio switching relay.  When no tones are detected the PIC could periodically (once every half second or so) trigger the "scan" button to make sure the scanner doesn't stop on a busy channel.  This would help ensure that no pages are missed even when scanning multiple frequencies.   Then, when a page is received, the PIC could trigger the "manual" button to stop scanning for a predetermined amount of time (30 seconds or so) and activate a relay that would let the audio go into a PC running VOX recording software.  With this setup the PC would record all fire pages on multiple frequencies but none of the other traffic.  Just an idea.


 

 
Comments