project was more interesting than my first Arduino project the Morse code generator. It is a
frequency oscillator (VFO), designed
by AD7C and based
on the Analog Devices AD9850 chip.
I did not use exactly the same parts as
in the original design, and therefore modified AD7C’s
program a little. The rotary encoder that I used emits a great many
per revolution (600). For this particular encoder I modified the
to decrease the encoder’s sensitivity to a more comfortable level. Less
expensive rotary encoders generally emit fewer pulses per revolution.
Highlighted lines are inserts in the original code. By responding to
every 20th pulse the ISR’s
sensitivity is decreased by a factor of 20. In other words it reacts
to only 30 of the 600 pulses per revolution (one per 12 degrees of
The second change also relates to the
rotary encoder. The one I purchased did not have a built-in pushbutton
I added an ordinary momentary SPST switch (shown in the photo above).
Even when de-bounced with an RC and Schmitt trigger, longer duration
button presses caused multiple step changes. My first thought was to
insert a hardware one-shot, but then I realized that this problem could
also be addressed in software.
Again, the highlighted code was inserted into the original
sketch, as shown. The only other changes to code were to
accommodate the different LCD that I used. These are minor and
At 7 MHz the VFO’s output
volts P-P and at 28 MHz about 0.2 volts P-P. However for the
demo below, instead of showing the oscilloscope display, I hooked the
VFO into the previously described ZZRX-40
kit receiver, and tuned across the 40 meter band.
I have not yet enclosed the VFO in a box. The
encoder (model LPD3806 600BM) came with no mounting hardware or
template, or for that matter even an English-language wire color code!
If I should manage to overcome the mounting
challenge I will post another photo.
misidentified the challenging part of enclosing the VFO. Mounting
the rotary encoder was easy, using
an analog of the Red
Green method but substituting a hose clamp for
which would also have worked.
A bigger challenge was to cut a rectangular hole for the 16 x 2 LCD.
I was not able to make a straight cutout, using the Dremel.
Luckily it is possible to conceal the jagged cut with a
manufactured bezel. I suppose with a 3D printer or a laser cutter one
could construct a smooth bezel, but with my selection of
(and skill level) a homemade bezel would have been as rough as the
I have read discussions of how to make
professional looking letters on a panel, but that also doesn’t
look easy. With only an
on-off switch and frequency step button, lettering would be hardly more
than a decorative addition. On the other hand lettering would be a
useful skill to acquire.
Project descriptions on this page are intended for entertainment only.
The author makes no claim as to the accuracy or completeness of the
information presented. In no event will the author be liable for any
damages, lost effort, inability to carry out a similar project, or to
reproduce a claimed result, or anything else relating to a decision to
use the information on this page.