The code presented here for an all HF tri-band digital vfo. The program code is set in this listing as the lower ham band 160m, 80m, and the 40m band, with either CW or LSB. The program code to be easily adjusted for the mid-bands of 30m, 20, and 17m, adjusting the "void setup()" code accordingly. The "void carrier_mode()" and "void tx_rx()" would need altered to represent the new ham band requirements. Subsequently for the higher ham bands of 15m, 12m, and 10mbands, the same alterations would be required.
An extended band radio of LF, MF and 60m could also be constructed by adjusting the same code routines. In all cases, the code uses a 9MHz intermediate frequency for reception, and also for a SSB exciter. However for CW transmissions, the digital VFO is placed directly onto the dial frequency as the digital vfo is used as the carrier oscillator for TX mode, thus CW keying the digital vfo for a CW Tx onto the output dial frequency setting, then the digital vfo adjusted for reception onto a 9MHz intermediate frequency setting.
A 6 pole 2·2KHz bandwidth 9MHz SSB filter can be obtained from the GQRP website, a component listing of all of the GQRP stock listing is found on the back cover page of the "G-QRP SPART magazine". The 6 pole 9MHz SSB filter costs around £12, and the USB and LSB crystals around £4 a pair. A 9MHz crystal can be used as 9MHz CW band-pass filter is around 35pence each. By using several 9MHz crystals in a row, a suitable narrow CW filter at a 9MHz I.F. frequency could be constructed, and used along side the 9MHz SSB filter by either relay circuit or an analogue switch for the resolving of either a SSB or CW transmission. A 9MHz BFO could also be designed by pulling a 9MHz crystal oscillator off frequency to produce say a 600Hz beat tone with the 9MHz I.F. signal of a received CW signal. An alternative to using a crystal oscillator is to program a digital oscillator to produce the LSB, USB and CW BFO signals.
Alternatively, an Arduino Uno DDS BFO code has been written.
url: https://sites.google.com/site/radiohamtechnology/digital-bfo-for-tri-band-radio-software
To use the Arduino DDS BFO code circuit, follow the text guidance, as the DDS BFO is connected to the LED indicator board, and thus will switch between SSB or CW automatically as one changes the radio from SSB to CW and back again to SSB.
A twi i/o bus expander of the pcf8754 type ( sourced from ebay ) is used to access to an output LED panel indicator, while also giving a logic output for ham band antenna switching on three of the i/o bus pins, P0, P1 and P2. The carrier mode switching is also present on the i/o bus, on pins P3 for CW and P4 for SSB, used also for switching between CW and SSB Tx/Rx circuits such as the BFO frequency selection for CW and SSB and band pass filtering. The morse key and PTT line is also imaged on i/o pin P5. It is suggested that in order to accurately use the twi display and i/o bus expander, use a twi searching program to find the network address of each the twi bus connections. The photograph below illustrates the dial display and led panel indicators. The LED's are connected to the +5Volt supply rail with a pull down voltage dropper resistance, thus an active LED output from the i/o bus is an active low output pin.
The display used for the digital vfo, I have used a i2c or twi version. using a 2 line 16 LCD character version ( both the Arduino uno and the display sourced from ebay ), I have updated the lcd coding drivers for the arduino IDE, the application code for the 49er vfo uses such coding. The URL link shown next; https://brainy-bits.com/tutorials/connect-a-character-lcd-using-the-i2c-bus/ is a link to finding the updated i2c lcd coding drivers for the arduino IDE and the twi display code examples. Here you will able to find the twi network searching arduino code, useful for finding the twi chip network addresses. Please note that the twi search tool reports using the Arduino monitor app found on the Arduino ide. The data is in a hex number, ok for the display, but needs to be converted into a decimal number for the twi i/o expander chip code command use.
From right to left of the board, are the LED indicators of the 160m, 80m, 40m bands, then the CW and SSB indicator, then the Tx/Rx LED indicator in green. the LED's that are illuminated are the 40m band and SSB carrier mode indicators. The PPT line also the CW Key line are both connected to arduino port pin D4. While the VFO bands switch diagram illustrates the lower band radio, the appropriate same switch positions would reflect the accordingly band plan for the middle and higher band tri-band vfo and also the added bands of LF, 600m and 60m radio
The electrical connections relate to the following article listings:
Digital vfo for LF, 600m, 60m ( added HF bands )
Digital vfo for 160m 80m 40m ( lower HF bands )
Digital vfo for 30m, 20m, 17m ( middle HF bands )
Digital vfo for 15m, 12m, 10m ( higher HF bands )
program code listings. The reason for the alteration is the digital vfo does now update while the dial frequency is altered. For an antenna unit, a full wave length lumped component antenna may be a suitable idea.
With a 50ohm stub antenna efficiency around 8% to the transmitter output, a 5Watt QRP radio set would only have at best an ERP of 400mW, while by using a full wavelength lumped component antenna, the 5Watts ERP would be equivalent to a near 65Watt transmitter using a 50ohm stub antenna, food for thought.
The inductive reactance of a full wavelength long wire antenna is around 550ohms. For a full wavelength lumped component antenna, an inductance coil antenna equal to a full wave long wire inductance is required. This calculates to a coil inductance of 300nH/m per each metre of a long wire antenna.
For 160m band, the coil inductance is 48uH, for 80m band this equates to 24uH coil, while for the 40m band, the inductance is 12uH, and so on up the HF band plan. As the square of the turns ratio is equal to the impedance ratio, the turns ratio of the balam is 10 turns on the primary winding and 33 turns on the secondary winding, or "1:3·32 turns ratio", would transform a 50ohm primary source impedance into a 550ohms secondary load impedance antenna match.
An alternative lumped component antenna assembly may be one with load impedance matching stub for a straight forward 50ohm match.
While the "R load" equates to the 550ohm antenna load, the "R match" would act as tuning stub, there-by the stub acting as a 50ohm tuned matching load. For 160m band, "R load = 46uH", "R match = 4·2uH". For 80m band, "R load = 24uH", while "R match = 2uH" and for the 40m band, "R load = 12uH" and the stub tune of "R match = 1·1uH" inductance. The antenna switching relay circuit would relay switch in-between the co-ax to antenna connection point.
Do remember, should one decide to only use the "R match" for the antenna, as the "R match" is a 50ohm direct match, the overall antenna without the "R load" would only be around 8% efficient. The "R load" section is full wave, this would provide a full wave electromagnetic coupling to the ether, and thus would be more like 100% efficient, where-as the "R match" is only 8% in effective length and thus only an 8% effective electromagnetic coupling to the ether, thus the "R match" as an antenna would only be 8% efficient. To get the best out of the antenna, use the antenna design as illustrated within the above table and diagram.
Below is a short video clip of the tri-band digital vfo software in use. The video demonstrates the vfo display and the use of the switches for the vfo band plan change and the vfo step change. The carrier mode of either CW or SSB is also indicated. The LED display is controlled by a twi i/o bus chip, the pcf8754. The CW and SSB led may also be connected to the BFO crystal oscillator for resolving a CW or SSB signal. As mentioned above, these two pins may select the BFO frequency setting for a digital oscillator. The Tx/Rx LED would logic switch the radio into either transmit or reception mode. The LED to indicate which of the selected bands is in use, can also be used to relay switch in the appropriate antenna. A relay switching system between the impedance balam secondary and the coil antenna, selecting the correct lumped component antenna could be a suitable arrangement.
You may have perhaps notice within the below video clip, when changing bands and returning back to the band previously used, the dial frequency remains, that is to say the tri band digital vfo does use memories to remember the last used frequency on any of the bands used. The memory even works if the Arduino is powered up from cold or even if the Arduino reset button is activated. The memory that is used, is the 1KBytes EEPROM within the Arduino processor. I was able to code the capability due to a lucky code example find on the Arduino website, the code example illustrating how to store a 32bit number within the arduino's 1KBytes EEPROM memory.
While tri-band digital vfo is mostly home written, the use of the EEPROM memory and using the serial shift command for the digital oscillator programming where both found on the internet as was the use of the "D type flip/flop" circuit to interface the rotary encoder but not the software to use the rotary encoder interface, but however the rest I am proud to say is home written. The SWR meter shown in the background is completely home made software. The SWR meter illustrated has the advantage of "RF network analysing" the radio set load antenna while the antenna is in use while the RF network SWR meter is in-line. Mostly, RF network analysers are used to test the load antenna for radio use, but with this software application, the SWR Meter come RF network analyser, continually measures the load antenna while the antenna is active in use.
Overall I feel a real sense of achievement within the coding, and I hope that many fellow radio hams have a fun time with its use for ham radio or for even short wave listening.
https://sites.google.com/site/radiohamtechnology/general-purpose-active-swr-meter