Arduino As An Inexpensive Ham Radio Frequency Counter

[Todd Harrison] really has our number. Like him, we don’t want to spend money when we don’t have to, and hacking our own solutions is a lot more fun anyway. This time around he’s helping out a friend who is a ham radio enthusiast. The friend’s radio didn’t come with a frequency display, and buying the add-on would cost more than the radio did. So [Todd] has set out to build an Arduino frequency counter for a Kenwood TS-520S HF ham radio.

This post (and the video found after the break) doesn’t cover the entire project. It’s rather involved just to make sure that [Todd’s] initial idea is viable so he spends about 35 minutes explaining the problem, then measuring the radio outputs and testing to see that the Arduino can read them accurately. Because the radio has a very large range of operation, [Todd] will need to add external component to facilitate this. That extra circuit design will be the topic of the next project segment.

8 thoughts on “Arduino As An Inexpensive Ham Radio Frequency Counter

  1. This is amazing! I actually have a TS-520SE that I bought as a teenager back in 1979 that I still have and I always wanted an external frequency display like the more expensive rigs at the time. I might just have to dust off my transceiver and give this one a shot.

    Thanks Todd!

  2. Fantastic hack, but…

    You can get cheap frequency counters online for just a few bucks. Even my old Heath-Zenith SM-2420 (0-500 MHz) only cost me $40 at a ham radio flea market.

    1. @DainBramage1991 Your counter, however, only reads your TX output freq. This project he’s working on is a real-time readout for RX & TX, since it’s reading all 3 freqs and calculating the actual operation freq from that. A “digital dial”, basically.

    2. Yeah, if you are going to use a real Arduino and an LCD shield that is pretty expensive for a frequency counter. I’m not entirely sure what your requirements of reading 3 frequencies are. If the IF offset is the same for both TX & RX and across bands then I would suggest getting a digital dial from qrpkits.com ($35) before buying an Arduino plus Shield.

      However, if you skip the nice snap-together Arduino hardware and build it with raw chips (think Mouser, not Sparkfun) on a perf-board (or use your favorite other construction method that doesn’t invloved sending away to a PCB house) you can probably go way under that price. This is especially true if you have a well stocked junk box.

      Either way it will be more satisfying then just buying a meter.

  3. Dear Mike
    Excellent work.
    Actually I am using Arduino DUE board for measuring the freq upto 8MHz. The same sketch I used for my DUE board. But it was showing some errors like follows.
    Arduino: 1.6.7 (Windows XP), Board: “Arduino Due (Programming Port)”

    In file included from C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:27:0:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\util/FreqCountTimers.h:64:4: error: #error “Unknown chip, please edit me with timer+counter definitions”

    #error “Unknown chip, please edit me with timer+counter definitions”

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static void FreqCountClass::begin(uint16_t)’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:44:15: error: ‘counter_init’ was not declared in this scope

    counter_init();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:45:31: error: ‘timer_init’ was not declared in this scope

    gate_length = timer_init(msec);

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:46:19: error: ‘SREG’ was not declared in this scope

    uint8_t status = SREG;

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:47:6: error: ‘cli’ was not declared in this scope

    cli();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:48:14: error: ‘timer_start’ was not declared in this scope

    timer_start();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:50:16: error: ‘counter_start’ was not declared in this scope

    counter_start();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static uint32_t FreqCountClass::read()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:64:11: error: ‘SREG’ was not declared in this scope

    status = SREG;

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:65:6: error: ‘cli’ was not declared in this scope

    cli();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static void FreqCountClass::end()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:74:17: error: ‘timer_shutdown’ was not declared in this scope

    timer_shutdown();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:75:19: error: ‘counter_shutdown’ was not declared in this scope

    counter_shutdown();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In function ‘void TIMER_ISR_VECTOR()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:85:27: error: ‘counter_read’ was not declared in this scope

    count_lsw = counter_read();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:86:23: error: ‘counter_overflow’ was not declared in this scope

    if (counter_overflow()) {

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:87:26: error: ‘counter_overflow_reset’ was not declared in this scope

    counter_overflow_reset();

    ^

    exit status 1
    Error compiling.

    This report would have more information with
    “Show verbose output during compilation”
    enabled in File > Preferences.

  4. Arduino: 1.6.7 (Windows XP), Board: “Arduino Due (Programming Port)”

    In file included from C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:27:0:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\util/FreqCountTimers.h:64:4: error: #error “Unknown chip, please edit me with timer+counter definitions”

    #error “Unknown chip, please edit me with timer+counter definitions”

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static void FreqCountClass::begin(uint16_t)’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:44:15: error: ‘counter_init’ was not declared in this scope

    counter_init();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:45:31: error: ‘timer_init’ was not declared in this scope

    gate_length = timer_init(msec);

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:46:19: error: ‘SREG’ was not declared in this scope

    uint8_t status = SREG;

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:47:6: error: ‘cli’ was not declared in this scope

    cli();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:48:14: error: ‘timer_start’ was not declared in this scope

    timer_start();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:50:16: error: ‘counter_start’ was not declared in this scope

    counter_start();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static uint32_t FreqCountClass::read()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:64:11: error: ‘SREG’ was not declared in this scope

    status = SREG;

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:65:6: error: ‘cli’ was not declared in this scope

    cli();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In static member function ‘static void FreqCountClass::end()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:74:17: error: ‘timer_shutdown’ was not declared in this scope

    timer_shutdown();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:75:19: error: ‘counter_shutdown’ was not declared in this scope

    counter_shutdown();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp: In function ‘void TIMER_ISR_VECTOR()’:

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:85:27: error: ‘counter_read’ was not declared in this scope

    count_lsw = counter_read();

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:86:23: error: ‘counter_overflow’ was not declared in this scope

    if (counter_overflow()) {

    ^

    C:\Documents and Settings\Administrator\My Documents\Arduino\libraries\FreqCount\FreqCount.cpp:87:26: error: ‘counter_overflow_reset’ was not declared in this scope

    counter_overflow_reset();

    ^

    exit status 1
    Error compiling.

    This report would have more information with
    “Show verbose output during compilation”
    enabled in File > Preferences.

Leave a Reply to MeCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.