Menu:



Version:

July 8, 2021:
Revised: v1.1

A Multi-Band Modular Si5351a VFO with Keypad and Encoder Tuning

This design is for those who look at my SugarCube VFO designs and say to themselves “I couldn’t ever build something that small!” This nine memory/band oscillator is easier to build thanks to the use of a few low cost modules.

Introduction

During the development of another project, I designed a new single-output variable frequency oscillator (VFO) using the popular Si5351a chip. As this work was progressing, I was exchanging emails with several constructors who felt the SugarCube and a number of other Si5351a-based oscillator designs were too difficult for them to build. Soldering the miniature SMD Si5351a chip to the postage-stamp sized Sugarcube PCB was just beyond them.

As I completed the single-output VFO design stage in that other project, I realized that this oscillator might be the answer to their problem. I also decided to document it here because it has a few unusual features which others may find useful. These features include:

A key feature of this design is its use of readily available modules. The oscillator and controller both use such modules, and the construction onto three compact single-sided PCBs makes duplication reasonably quick and uncomplicated. This arrangement also allows for a wide variety of applications.

Design Description

The first unusual feature of this design is the provision of both a keypad and an encoder for frequency entry. As in most of my designs, the rotary encoder’s integrated push-switch selects the tuning step size from 10Hz to 1MHz. The keypad allows fast frequency selection, or aid tuning between widely spaced frequencies. The VFO delivers 1Hz resolution.

The availability of both keypad and encoder allows frequency selection and tuning to be optimized for almost any application. Apart from commercial amateur radio equipment, I don’t recall seeing any other Si5351a oscillator design supporting both a keypad for direct frequency entry and an encoder to manually tune the oscillator to a desired frequency.

Nine selectable bands (or memories) have been provided in this variable frequency oscillator (VFO). Each memory/band may be user-configured with programmable upper and lower tuning limits and a power-on start frequency.

These frequencies are all programmed into the microcontroller’s EEPROM. To simplify this task, the required EEP file can be generated using a Microsoft Excel™ spreadsheet which is available for download below.

In use, the current frequency on each band is saved until the next power-down. It's possible, for example, to tune to a frequency on band 4, for example, then change to band 7 and tune the VFO using that memory, and then return again back to band 4 to continue from the previously selected band 4 frequency.


The use of readily available modules was a conscious design decision. This avoids the need to solder tiny SMD components which, frankly, many of us with poor eyesight find more and more difficult. This design uses a set of three standard widely available and inexpensive modules; An Arduino Nano, a Si5351a module, and a 16x2 alphanumeric LCD. Added to that, there’s a simple keypad to build, and an optional 8V regulated power supply.

Most parts are soldered onto the compact main single-sided PCB. A few connectors are used to more easily manage the wiring to the LCD, the keypad and the encoder and band switch. However, direct wiring works just as well if that’s your preference. This approach also allows the VFO to be more easily integrated into different applications.

Circuit Details

The circuit, shown in Figure 1, may look complicated at first glance, but it’s really fairly simple given much of the design is ‘modularised’.

The Arduino Nano is the overall controller of the VFO, with the LCD display reporting all of the necessary details. The Si5351a module generates the required VFO signal. It contains the Si5351a, the reference crystal and the buffer chips. This is connected to the Arduino Nano.

Figure 1 : The 9-band oscillator uses three basic building blocks – The Arduino Nano, the Si5351a oscillator, and the 2x16 LCD – along with a handful of switches, passive components and the rotary encoder (Right-click the schematic with your mouse for a closer look)

The usual myriad of keypad connections has been simplified through the use of the chosen matrix arrangement of pushbuttons and the six resistors. This produces a reasonably linear series of voltage output steps from the keypad for each switch pressed. It reduces the keypad connections to just three wires, further simplifying construction.

The Arduino Nano contains the 5V regulator for the on-board ATmega328 processor as well as the Si5351a, LCD and keypad assemblies. This is powered from an external voltage supply. The current load of the VFO, less than 100mA, require the Nano’s regulator to dissipate too much heat if the external supply voltage is more than about 9V. I’ve included the details of the simple LM317-based 8V regulated AC power supply I used (Figure 2), but you can obviously use any other suitable power supply and/or regulator you wish.

Figure 2 : A conventional transformer-based power supply and regulator powers the oscillator. R1 and R2 set the output voltage to 8V. An optional LED (D3) and resistor (R3) monitors the regulator output voltage.

Construction

A series of small single-sided PCBs are used to construct the oscillator. I’ve avoided the use of double-sided PCBs to make it easier for those able to make such single-sided PCBs at home. The main PCB holds the Ardunio Nano, the Si5351a module, and the various connectors used for wiring to the display, keypad and encoder. The aim was to simplify construction.


Figure 3 : The various PCBs can be seen inside the prototype including the LCD (lower left edge), keypad (lower right edge), main PCB with Arduino Nano and Si5351a (centre), and the power supply and regulator PCB (upper left). There's lots of spare space. It could be fitted quite easily into a much (much!) smaller box. Note: The version of the main PCB used here includes provision for additional parts for the design under development. The PCB layout in the Download section is smaller and omits this unnecessary area.

The two PCB-mounted modules are just wired onto the main PCB using wire links. The wire trimmed off resistors and capacitors after soldering these to PCBs is ideal.

The use of connectors here does increase the parts cost slightly but it does make the oscillator much easier to build and assemble. It also allows an increased variety of enclosures and mounting arrangements to be used. In addition, it makes it easier to use any of the many 16x2 LCD displays with the VFO.

The LCD connections are wired to the main PCB with ribbon cable to a 2x7 'DuPont' 0.1" socket connector to match the PCB-mounted pin connector. (You should mark the orientation of this connector pair because it's possible to reverse the connector when mounting it. I used a dab of white paint on the end of this connector pair)

A small two-pin 'DuPont' connector provides the DC backlighting connection required with some LCDs. If your LCD doesn’t have backlighting, this wiring and connector can be omitted.

Just be aware these LCDs use many different connection arrangements. Some LCDs have their connections located along the top edge, others along the lower edge, and some have the connections on one or other side edge of the LCD module. The arrangement used here allows all of these LCDs to be connected quite easily.
Take care! LCD module VCC (+5) and VDD (Ground) connections vary. If you connect the display incorrectly, the LCD will likely be destroyed.

Each connector is different to the others to avoid confusion during assembly. The one possible duplication is with the DC wiring to the regulator so this was left without a connector. In hindsight, it might have been better to make this a 'flying lead' and fit a connector on the regulator PCB DC output.

The 12-button keypad is constructed on the second, small, single-sided PCB. The pushbuttons are the low cost momentary ‘tactile’ switches available almost everywhere. This keypad is connected to the main PCB via three wires.

I’ve provided two PCB layouts for the keypad below in the Download section; A 2x6 keypad layout for low profile enclosures such as the one I used here (See the photo at the top of the page), and a more conventional 4x3 keypad layout.Chose the version that best suits your application.

The Download files also include PCB layout diagrams to halp work out component placement.


The encoder and its integrated push-switch, and the ‘Band’ or ‘Memory’ pushbutton switch can be mounted directly in place on the front panel (as here) or be mounted on another small PCB (Details of this PCB can be found in the Download section). I also designed and 3D-printed my own tuning knob, too. For those wanting to print a copy of the tuning knob, the standard STL file is available in the Download section below, too.






Figure 4 : The tuning knob includes a finger-sized depression to make tuning easier and more comfortable



Finally, the power supply is constructed on a further single-sided PCB. It connects to a 9VAC-0-9VAC output centre tapped transformer. It’s possible to use, say, 10-0-10V or 12-0-12V types. Of course, you can also substitute a suitable plug-pack or switchmode power supply.

I built this version of the VFO into a recycled satellite receiver chassis. It’s much larger than required for this application, but it allowed me to place the VFO on a shelf over my testbench, and then pile other stuff on top. The panel controls are easily accessible, and the tuning knob and keypad placement is ideal for me.








Figure 5 : The regulator PCB includes a small yellow LED as a quick confirmation that the regulator is delivering voltage. The AC wiring can be seen clearly here including the rear panel power switch and AC cable entry. Ideally, the mains cable’s earth lead should be bolted to the chassis too.

By the way, for those of you who are left-handed, you may prefer the mirrored version of the panel layout. Both versions of the front panel artwork are provided in the Download section below.

Programming the Frequencies

The ATmega328 on the Arduino Nano module contains four types of programmable memory:

The software supports nine independent VFO bands or memories. These are numbered 1 – 9, each containing the current oscillator frequency for that memory, an upper and lower frequency to limit the tuning range for that memory, and a starting frequency. This is the initial frequency set in each band/memory where the oscillator will start each time the power is turned on.

There are three ways to handle these 27 values (i.e. Three frequencies/band * 9 bands). I could hard-program these into the program software in flash memory but that makes it very difficult for users to alter later. By opting for EEPROM-stored values, it makes it much easier for users to alter these to suit.

I could have written some sort of menu-driven system in the code to allow user programming of values using the keypad, encoder and LCD display on the VFO. However, this approach has always seemed awkward to me. Such arrangements are usually not very easy or intuitive, relying on limited user controls and a tiny LCD display. Also, since such configurations are rarely changed, I decided to use an alternative approach.

In this case, an Excel spreadsheet is used to enter and/or edit the frequency data. This is an approach I first used for my SugarCube VFO family. I've found it reasonably easy to use, it's certainly easy to see for those with poor eyesight, and it's also very versatile. You can use almost any computer and display to enter and edit the frequencies as required. 

This approach also means I can use a smaller, less expensive microcontroller, if necessary. The processor only needs to have enough flash memory to run the program software.

With this method, all you need to do is to download my Excel spreadsheet, enter your frequencies, and click on the ‘Write EEP File’ green button in the spreadsheet. It will then generate the required EEP file "auto-magically" for you. Easy.

Then, just program your ATmega328 on the Arduino Nano with the HEX program file and your chosen EEP frequency file. Finally, program one fuse byte in the ATmega328 and the job’s done.

 
Figure 7 : The Arduino Nano is made with different USB sockets. This is of no importance in this project. However, it’s helpful to get one with the 6-pin programming header already fitted. This connector can be seen at the right hand end of the board pictured opposite.

Programming Example:

Let's look at an example of the frequency settings using the following set of frequencies and tuning limits:


 
This set of frequencies has been entered into the Excel spreadsheet below as an example. You can replace these with your own frequencies. For amateur radio users, the nine memories might be programmed to suit the bands you most commonly use i.e. 160m through 6m.

Note: I'm sure it's perfectly obvious to everyone but... The Start Frequency on each band (or any frequency entered on that band from the keypad) must be between the lower and upper defined limits. You can enter incorrect values into the spreadsheet but the VFO software will not operate correctly.

Each band's settings can be set independently of any other band. If you want to have nine memories on the same band, that's perfectly acceptable. i.e. The Lower Limit may be set to, say, 1.0 MHz for all nine memories, and the Upper Limit similarly set to, say, 290.0 MHz.The Start Frequenciy for each band could be set on the same frequency, or at intervals across that tuning range. That way, each memory could allow the oscillator to be tuned anywhere from 1.0 to 290.0 MHz.

My spreadsheet (available below) calculates the values which must be saved in the ATmega328 processor EEPROM memory on the Arduino Nano board. When you are ready, click your mouse on the ‘Write EEP Filegreen shaded cell towards the end of the spreadsheet and it will generate the required EEP file for you. It’s saved in a file called m9vfo.eep in the same directory as you have saved the Excel spreadsheet. This will be copied over into the Arduino Nano later.

Note: You may wish to also save that EEP file generated by my spreadsheet to a filename of your choice, or you may want to copy it into another directory, if you want to retain it. The reason: The next time you use the spreadsheet, it will overwrite any existing file that has that file name in that original directory.

Programming the ATmega328 / Arduino Nano

As mentioned earlier, there are two files you need to program your oscillator. The first file contains the program software. That file is called 16x2_Nano_KeyPadGen_V02.hex and it must be programmed into the ATmega328’s flash memory. (That 'Vxx' number may change if I update the software)

The second file required is the m9vfo.eep file you generated with the spreadsheet. This file must be programmed into the ATmega328’s EEPROM.

The program software and a demo version of the EEP file may be downloaded below. The Excel spreadsheet may also be downloaded below.

When that’s been done, you must finally program one of the ATmega328’s fuse bytes. A standard Arduino Nano will have the processor’s fuses programmed:

High Fuse=&Hd9, Low Fuse=&Hff, Extended Fuse=&Hff

but we want the fuses to be programmed:

High Fuse=&Hd1, Low Fuse=&Hff, Extended Fuse=&Hff.

As you can see, this means that usually only the value of the High fuse byte needs to be reprogrammed.

You will require a suitable programmer (e.g. USBasp etc) to program your ATmega328 with the HEX and EEP files, and to set the single fuse byte in the ATmega328. These programmers are widely available and inexpensive, typically costing about $US3-4.





Figure 8 : Here’s an example of a typical USBasp programmer you can buy. It’s best to buy one complete with the cable and 10-to-6 pin adapter shown here to save having to make up such a cable to connect to the 6-pin header on the Arduino Nano.





You will also need some software to run the USBasp programmer. Suitable GUI programming software is available free via the internet. Examples for use with Microsoft Windows include Khazama and Extreme, both of which I have used, and others such as AVRdudess which I aim to try soon.

In summary:

  1. Plug the programmer into the 6-pin header on the Arduino Nano. (Note: It’s not possible to use the Arduino IDE for this project. The IDE doesn’t support EEPROM and fuse programming)
  2. Program the flash memory with the m9vfo_VXX.hex software
  3. Program the EEPROM with the m9vfo.eep frequency data file
  4. Finally, program the ATmega328's High fuse.  (High=&Hd1)
All of this programming stuff probably sounds complicated but, really, it’s not. Start with entering the frequencies you want into a downloaded copy of my spreadsheet. Then, with the USBasp programmer on your bench and the programming software running on your computer, it will probably take you less than 5 minutes to complete the programming of your Arduino Nano.

Note (for the programming experts out there): I would have liked to have used the standard Arduino IDE for the programming rather than the USBasp approach. However, I'm not aware of any method available that allows programming of the EEPROM and fuses via that IDE. If I am wrong, and it's quite likely that I am, please do email me and describe the procedure. Recall, too, that when my software is written to the Arduino Nano, it also overwrites the bootloader.

Final Comments

This has been an interesting little project to build. It’s been a welcome distraction from the major design project going on in the background. I think it has also turned out to be a useful and reasonably attractive oscillator for my testbench and hopefully, for many, a useful VFO for various projects.

I hope that the approach I’ve described here at some length, using modules for the construction and a spreadsheet to generate the stored configuration data for the EEPROM, will prove to be a useful approach for many who may have found other approaches too difficult.

Don't forget to send any questions to me via email (I'll try to answer them promptly) and please let me know how you get on with the spreadsheet method of programming your oscillator parameters.

Downloads

All of the following material is contained in a single ZIP file which you can download by clicking here:

Software: 
PCB Layouts:
Hardware: 
By downloading these files, you agree that these files are for your personal non-commercial use only.

Please email me if you need Gerber files for arranging third party PCB manufacture. The email address can be found on the main page of the website.



Want to go back to the main page? Click here to return directly.