Monday, April 6, 2015

Multi-Featured VFO

Download MultiFeaturedVFO.ino
Download Rotary.Zip (click on Down Arrow at top of page)
Jason's Arduino Si5351 Library (click on Download Zip) and install it directly into the new Arduino IDE as mentioned in my last post.
Hardware Layout for this program can be found here.

//------------------------------- Set Optional Features here --------------------------------------
//Remove comment (//) from the option you want to use. Pick only one
#define IF_Offset //Output is the display plus or minus the bfo frequency // this line will be used
//#define Direct_conversion //What you see on display is what you get
//#define FreqX4  //output is four times the display frequency

You can output frequencies up to 160Mhz. Keep this in mind when you use the 4X frequency option.
You can also tune in 1Hz increments if you so desire.
Also, I use clk0 for VFO output and clk2 for BFO.

Jason's latest library has a calibration sketch that can be accessed by:

You can easily adjust the frequency correction using the Serial Monitor and the keyboard. Make note of the offset and put it into si5351.set_correction(); in the VFO sketch. The correction is no longer stored in the board EEPROM so do not comment out the set_correction line as I had mentioned in the past. Also when using the current hardware setup, nothing will change on the LCD while adjusting the frequency - only on a frequency counter.
Looking at the above screen you will notice three Si5351 libraries in my "user libraries" folder. The Adafruit_Si5351 is not a problem since the header file uses a different name. The "Si5351" and "Si5351Arduino-Jason" share the same header file name. I did get an error that said something like "multiple libraries were found for si5351.h files - you must die". Both were Jason's newer library but the one, "Si5351Arduino-Jason" had all the newer upadates and examples so I deleted the "Si5351" folder.


  1. Hello Tom! I see you've implemented my request in Multi-Featured VFO code.Manny thanks!
    I changed something into (instead of 16x2 lcd, put 20 x4), etc.Just little things HI!!
    However, I do not know something, that's how with the frequency change LCD displays band.
    Example: When the VFO on 3.500.000Hz-3.800.000Hz, LCD shows: band "80m",on the 7.000.000Hz-7.200.000Hz shows: "40m" and so all HAM bands.In the case, when VFO is not in HAM band , lcd display: "OUT OF BAND"
    Please do these changes implement in Multi-Featured VFO! That is one step more to the standalone RTX!
    I was just finishing SDR RTX planned UT3MK, so that the HW almost over.
    I have dozens of times looked at the video of NT7S, and what it can do, but that in his code just does not ??
    All the best to you!
    P.S. I visit SQ9NJE site,put his sketch for Si5351 SDR ,but have bunch of error?

  2. hallo...
    i have problem when upload.. error mesages says sketch too big.. i am using uno


    1. problem solved.... i am try new version of arduino. arduino ver 1.6.4

  3. Hello Tom thanks for putting the sketch together, works great!
    i added from Ashhar Fahrans Sweeperino sketch a DBm meter to your compilation.
    I could not get the sweeperino to work with an encoder, Still trying though!
    With your code and the 8307 meter working together i can play with filters now!
    one question? what should the output of the si5351 from clk0 read in dbm?
    Im trying to calibrate it and dont have a scope.
    Mike kd7ura

  4. This comment has been removed by the author.

    1. Hi mike,
      This statement which only needs to appear once in setup() sets the power output of the si5351:
      si5351.drive_strength(SI5351_CLK0,SI5351_DRIVE_8MA); //you can set this to 2MA, 4MA, 6MA or 8MA
      As measured into 50 ohms with a spectrum analyzer at 10Mhz,
      clk0 outputs:
      8ma = 9.8dbm
      6ma = 7.5dbm
      4ma = 4.1dbm
      2ma = -1.7dbm

  5. Hi Tom! I know this is an older project, but wanted to let you know that I've adapted this code to work on several different HB rigs (on #4 now!). Thanks for sharing it with the community!

    73 - Steve N8NM

    1. Glad you could you could get something out the post. Thanks for your comment.
      Tom, ak2b

  6. Hi Tom,
    I'm just reading the sketch and see the interrupt enabeling is different from the Arduino manual. The Arduino manual uses 'attachInterrup( interrupt#, ISR, CHANGE). The sketch as given compiles without problem for an UNO bus does not compile for an Arduino DUE or an Arduino M0 pro. Do you know an easy way to make de Arduino sketch to be compiled for the Arduino DUE or an Arduino M0 pro.

    Best regards
    Jan Mulder (PA0DMM)

  7. Hi Tom
    If I want vfo - bfo output on one band and bfo -vfo output on other band, is it possible ?
    How can I do it ?
    Best regards