The 49er digital vfo is designed to be used with the 40m 49er radio kit, purchasable from ebay and perhaps many other places. The standard 49er design incorporates a crystal oscillator with a vari-cap application to shift the crystals resonance between receive and transmit mode. However to change frequency from the crystals operating position is rather different. By using a digital oscillator, the whole of the CW band plan of the 40m band can be used.
The best way to alter a digital oscillator through a micro-controller, say an arduino uno project, is to use a rotary encoder. The mechanical encoders work to a fashion quite well, but I was after a vfo movement similar to a manufactured radio, say from Icom or else where. The really only solution for the rotary encoder is to use an optical version. I found a suitable rotary encoder on an ebay site, rated as 600 pulse per revolution, costing quite simply £10 or there about. The encoder on offering I found once delivered has a 1/4" shaft, perfect for a standard sized and suitable dial tuning knob.
I have written application code for the arduino for mechanical rotary encoders before, tried various solutions and found / derived a suitable code solution. However for the optical rotary encoder, the same code was not successful as a solution, the 600 pulse per revolution was just too fast for the code I had, and not even an interrupt solution could cope. With the two clock outputs from the rotary encoder, the shear pulsing speed was just too great to determine the dial direction of rotation. I had seen many years ago a circuit design that would give an output to indicate the dial direction of movement, with the other output as a clock to count the encoders pulses for the frequency increments or decrements across the ham radio band. As it happens, I came across the circuit shown below, inputs "A" and "B" are the two signal output from the optical rotary encoder, using pull up resistor on the optical encoder output, while the outputs of "Y" and "X" are connected to the arduino to indicate the direction of dial turn as well as the clocking pulses to determine the change of frequency. The 74LS74 series "D" type flip flop series will also function correctly, the use of a "HC" series is not absolutely required.
The diagram below is timing diagram for the above circuit interface for the optical encoder. While the dial is in a counter clock wise turn, downwards across the radio band, the "Y" graphical trace in blue shows a clock signal output, while the clock wise graphical trace "X" indicates the signal output from the circuit to relate to a up change in frequency across the band plan. The application code for the arduino programming code need now only look for clock signal on two of the arduino ports, in my program code these are pins 2 and 3.
The sampling of the clocking signal can be achieved by polling pins 2 and 3, and determining if there has been a change of state on these pins, from high to low is the principle I have used. In my application code, I have not used interrupt control programming to service pins 2 and 3 and to recalculate the new coding numbers for the digital oscillator, in this case the AD9850 DDS oscillator found on ebay.
The digital oscillator connections I have used are the serial programming arrangement, using only four pins from the arduino chip. In his regard I have used pins 12 to 9, while pin 4 I have used for the CW key. The program code for the digital oscillator has from me gone through several versions, and for this application I found on the web a different coding example, one that uses the data shift commands from the arduino coding. This solution is far more compact than my previous coding, coding which I did also find on the web, but as with such coding examples, some of the setup code is missing, which has to be written. After a while of arduino coding, this is at times not too much trouble, but does require a bit of thought.
The display used for the 49er digital vfo, I have used a i2c or twi version. using a 2 line 16 character version, 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. The url link page shows a circuit diagram for the lcd display connections, in addition there is listed a program code to determine the bus address of the display, so that the 49er vfo code can correctly address the display.
Below is my full application code for the "49er Digital vfo" project. The code has been tested and I believe that I have found all of the code faults. The transmit signal is exactly the displayed frequency, while the receive vfo is 600Hz higher. I have a Icom R70 receiver and I have found that the CW setting has the reception of Morse code as a lower sideband signal. The 49er digital vfo has the Morse transmission as a lower sideband signal.
To change the audio tone frequency, alter the following line in the coding as shown below;
long carrier_offset = 600; // audio tone of cw audio = 600Hz
To change the start up frequency setting or to use the digital vfo on another band, say perhaps LF, MF or any other HF band CW QRP spot frequency, is achieved by altering the coding line as shown below;
carrier_centre = 7.023E6; // 40m band CW QRP spot frequency
To set the address variable for the lcd display, alter the line below in the program code;
#define I2C_ADDR 0x27 // <<- Add your address here.
All that remains now, is to have fun, so just cut and paste the below arduino code into your arduino IDE program, all the best, happy Dx!. Oh by the way, try to use a lumped component antenna, 5W QRP at full wave antenna design is equal to a 60Watt transmitter using a 50ohm stub antenna, food for thought. An idea that may well be a good point, if one uses an arduino relay circuit board, then this could be used as an antenna switch relay. I have added a antenna relay switching code to data pin 6 to the arduino digital vfo coding.
The above diagram relates to a centre off DPDT switch, by connecting the above switch diagram in the shown circuit form, then the Arduino code would change the vfo step resolution while tuning the optical encoder vfo dial. It is suggested that the Arduino code vfo step change resolution is set the users preference before compiling the Arduino code.
The Arduino Uno code for the 49er digital vfo is downloaded from my google drive page, the file is downloaded as a text file for copy and paste into the Arduino ide.
https://docs.google.com/document/d/1yV8uPdgO0yDr4n8QQnHdMKPlozxiZXUrCNgZ6Rv-15I/edit?usp=sharing