K4TFJ's Internet QTH

Latest News

26 APR 2020 - Back to old projects...

A return to the Kenwood TS-520s and the hunt for a digital display. I must admit that I located a Kenwood DG-5 in fully operational condition. But it still lacks one major feature I want. The ability to send the collected information via serial/usb to a computer for logging software input of frequency and mode. Therefore I must continue my research. I already have an Arduino Mega 2560 and 20x4 ic2 display from a previous project. I will attempt use these for the base unit. Obviously some signal conditioning will be required.

First some research. With the DG-5, manual and schematic in hand I was able to determine some very valuable information. I will lay it out here:

VFO ===========================

The VFO signal is fairly easy. It is a sample of the on-board or remote VFO output. This output is basically a 5 MHz oscialltor, with a variable range of about 4.8 MHz to 5.6 MHz. To match this up with the analog dial, it is actually inversed, with 4.9 Mhz representing "600" and 5.5 MHz representing "000". Frequency up on the VFO is frequency down on the analog dial. Not unexpected and not really of any concern in our application. Its just a note.

CAR ==========================

The carrier signal changes with the mode switch. It has four possible values.

Note: tolerances unkown, but I have not seen these numbers change yet.

HET ===========================

The hetrodyne signal changes with the band switch. It has 10 possible values.

Note: tolerances unkown, but I do believe some may be slightly off.

Conclusions ========================

So what doest this all mean? With these three signals, I can determine band, frequency and mode currently being used by the transceiver!

For example:

Do the calculation: 
	f = 22.8943 - (5.300 + 3.3965)
	f = 22.8943 - 8.6965
	f = 14.1978 

This tells me I am on the 20m band at 14.1978 MHz using USB mode.

ARDUINO ===================================================

The "pulseIn" function measures the timeperiod of a pulse on a PWM input. It measures the HIGH and LOW periods seperately. But these can be added together to get the full time period and then converted to frequency.

THEORY: Could I use this to measure three signals (HET, VFO, CAR) on seperate pins, simultaneusly? Well, not at the same time, but very close.

Note: These signals are basically low voltage sine-waves and must be converted to 5v square-waves to get accurate timing. I am thinking of using some gain staging and schmidt triggers to accomplish this.

However, here is the Arduino procedure:

    pulseHigh = pulseIn(pulsePin,HIGH); 
	    // measures the HIGH period
    pulseLow = pulseIn(pulsePin,LOW); 
	    // measures the LOW period
    pulseTotal = pulseHigh + pulseLow; 
	    // add HIGH and LOW time periods
    freq = 1000000/pulseTotal; 
	    // convert to frequency in Hz.
	freqMHz = 1/pulseTotal; 
	    // convert to frequency in MHz.

Now, using different variable names and pins for the signals:

void loop() {
   
    // HETRODYNE ====================
   
    pulseHigh = pulseIn(HETPin,HIGH);
    pulseLow = pulseIn(HETPin,LOW);
	pulseTotal = pulseHigh + pulseLow;
   
    HETfreq = 1000000/pulseTotal;
    HETfreqMHz = 1/pulseTotal;
   
    // VFO ==========================

    pulseHigh = pulseIn(VFOPin,HIGH);
    pulseLow = pulseIn(VFOPin,LOW);
    pulseTotal = pulseHigh + pulseLow;

    VFOfreq = 1000000/pulseTotal;
    VFOfreqMHz = 1/pulseTotal;

    // CARRIER =====================

    pulseHigh = pulseIn(CARPin,HIGH);
    pulseLow = pulseIn(CARPin,LOW);
    pulseTotal = pulseHigh + pulseLow;

    CARfreq = 1000000/pulseTotal;
    CARfreqMHz = 1/pulseTotal;

}
	

Now its just a matter of doing some calcs and displaying the information.

DisplayFrequency = HETfreq - (VFOfreq + CARfreq);

As of today I am working on the gain staging and signal conversion, waiting on parts.

Comments and Complaints?

73 de K4TFJ