This is only a preview of the June 2023 issue of Silicon Chip. You can view 38 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Basic RF Signal Generator":
Items relevant to "Loudspeaker Testing Jig":
Items relevant to "WiFi Time Source for GPS Clocks":
Items relevant to "Wideband Fuel Mixture Display, Pt3":
Items relevant to "Servicing Vibrators, Pt1":
Purchase a printed copy of this issue for $11.50. |
Basic RF
Signal
Generator
My AM/FM/DDS Signal Generator design (May
2022) is a very convenient piece of test equipment,
but it’s overkill for many tasks. If you just need a basic
test signal from 10Hz to 25MHz, this Generator is it; it’s
compact, cheap to build and doesn’t involve many parts.
T
his design came about because
my Q Meter (January 2023;
siliconchip.au/Article/15613)
needs a 100kHz to 25MHz signal at
close to 0dBm to function. Many constructors may already have a suitable
signal generator, such as my May 2022
design (siliconchip.au/Article/15306).
Still, I decided to create a simpler version that does the job with minimal
components and at a lower cost.
A DDS design is the most sensible option, and the Analog Devices
AD9834 is a good DDS chip, but it costs
$27 plus delivery. It makes far more
sense to purchase a ready-made module, which costs less and comes with
most of the necessary parts already
assembled onto a PCB.
There are a variety of suitable DDS
modules available on AliExpress and
similar; I used (and can recommend)
the one at siliconchip.au/link/abjo
Using a module like this takes a lot
of the hard work out of the design.
By itself, the module will not do
anything; it requires the power and
control signals through the 10-pin
header. It only took me a little while
to design a control module for it. This
has a microcontroller with a small
display to show the frequency and a
knob to set it. I kept the same display
and appearance as the Q Meter, the
earlier Signal Generator and associated projects.
Circuit details
The resulting circuit is shown in
Fig.1. Microcontroller IC1 is a 28-pin
26
Silicon Chip
DIP ATmega168 or ATmega328. Speed
is not critical, so I am using the internal 8MHz RC clock source; no external crystal is needed. The display is
the same SSD1306-based 128×64 pixel
OLED screen as in my other designs,
and the frequency is changed by a
rotary encoder with a built-in pushbutton switch.
IC1 updates the display over a twowire I2C bus with the usual 4.7kW
pull-up resistors. The rotary encoder
terminals are pulled up by 4.7kW resistors, with 100nF and 470nF debouncing capacitors. The differing time constants make it easier for the micro to
detect the encoder rotation reliably.
The Generator could run from any
standard 5V plugpack, but as the current drain is not high, I decided to use
two AA cells and a switch-mode boost
converter to generate 4.4V DC. This
boost converter is the same MCP1661
or MP1541 chip used in my LC Meter
(November 2022 issue; siliconchip.au/
Article/15543).
Why 4.4V instead of 5V? The resulting current consumption is lower,
extending battery life. The AA cells
should operate down to 1V each before
the up-converter drops out. This voltage is set by the ratio of the 330kW and
120kW resistors to the feedback (FB) pin
of REG1, which is maintained at 1.25V.
Since 1.25V × ([330kW ÷ 120kW] +
1) = 4.4V, the voltage at the cathode of
D1 will increase until it reaches 4.4V,
then REG1 will adjust its duty cycle to
maintain that. The switch interrupting
power from the battery to REG1 (S1) is
Australia's electronics magazine
By Charles Kosina
onboard, making construction easier.
The AD9834 module is powered and
controlled by IC1 via 10-pin header
CON1. It has an onboard 75MHz oscillator, so the maximum output frequency (the Nyquist limit) is half that,
ie, 37.5MHz. But it is best to operate
it lower than that, so I chose a maximum of 25MHz.
As for the low end, the Q Meter
needs a minimum frequency of
100kHz, but the module can go as low
as 1Hz. I decided that 10Hz was a reasonable lower limit, spanning the full
range of useful audio frequencies.
The resolution of the signal generator is 1Hz; pressing the pushbutton on
the encoder toggles through step sizes
of 1Hz, 10Hz, 100Hz, 1kHz, 10kHz,
100kHz and 1MHz. On power-up, the
default step size is 1MHz.
CON4 is a standard Atmel six-pin
ICSP header that allows you to program IC1 in-circuit if fitted. There’s
also an optional serial debug interface at CON3; if you aren’t using that,
you can leave off Mosfet Q1 and its
1kW pull-up resistor. However, CON3
should be fitted as it is also used to
trigger calibration when S2 is closed
or its pins 1 & 3 are shorted.
Output frequency response
Once the firmware was working, I
plotted the output level against frequency, shown as the red trace in Fig.2;
two problems are apparent. The output
was about -11dBm, which is too low,
and it falls off rapidly above 18MHz.
The output level is set by one
siliconchip.com.au
Fig.1: the circuit is simple because the DDS signal generator is a prebuilt module that plugs into CON1. It’s controlled
by micro IC1, which monitors rotary encoder RE1 and displays the status on the OLED1 screen. Power comes from a
pair of AA cells via boost converter REG1 that generates a steady 4.4V.
Fig.2: the output frequency response of the Signal Generator with the original resistor R2 (red) and new value (green).
siliconchip.com.au
Australia's electronics magazine
June 2023 27
resistor, R2, which is 6.8kW on the
supplied module. By changing this
to 1.2kW, the output increased to near
0dBm over the flat part of the range,
shown in green in Fig.2. The resistor
on the module is an M1608/0603 size
SMD type, but a larger M2012/0805
size resistor will also fit.
I measured the output power three
ways, and they did not quite agree.
The most reliable method is to measure
the peak-to-peak voltage on an oscilloscope with an accurate 50W RF load
(how I plotted Fig.2). The other methods used the tinySA spectrum analyser and the Analog Devices AD8318
power meter. Those two methods gave
values between 1dBm & 4dBm lower.
This still leaves the problem of
frequencies above 18MHz having a
reduced level. If this is sufficient for
your needs, no further modifications
are needed. However, I decided that
it was worthwhile to improve the frequency response.
If you look at my photos, you will
see that the two outputs on the module each have a low-pass filter (LPF)
consisting of three inductors and three
capacitors. We can fix the drop-off by
replacing L4-L6 & C7-C9 with different value components, giving a cutoff
frequency of 35MHz.
The inductors are M2012/0805-size,
and the capacitors are M1608/0603size SMDs, but again, M2012/0805 size
capacitors will fit. The new 5th-order
Chebyshev LPF is shown in Fig.3. You
will note that C8 is not needed in this
topology. The new frequency response
is shown in Fig.4. The other output can
be left as-is, as it is unused.
Despite the 35MHz cutoff frequency,
there is still a reduction at 25MHz due
to the relatively low Q of the Coilcraft
chip inductors I used; their rated Q factors are not high. At 25MHz, the 820nH
inductor has a Q of 23, the 1.5µH has
a Q of 10 and the 1.8µH has a Q of 15.
These are not very impressive figures!
Fig.3: this new
Chebyshev LPF
arrangement
provides a much
flatter response
than the one that
comes with the
module.
I tested some other SMD inductors
that supposedly had a higher Q but
they actually made the output level
slightly lower. So the Coilcraft inductors are good if you can get them; the
parts list includes some close alternatives that might be easier to get.
Harmonics
As with all DDS systems, the output
is not pure, with multiple spurs. These
are shown in Plots 1-3. Of the five
frequencies I tested (5MHz, 10MHz,
15MHz, 20MHz & 25MHz), 15MHz
and 25MHz give the purest output as
they are one-fifth and one-third of the
clock frequency. The only spurs are
harmonics of the fundamental.
All others had multiple spurs,
mostly more than 20dB down compared to the output frequency (the
other two not shown are similar in
appearance to Plot 2).
Housing it
I used a 105 × 75 × 40mm ABS enclosure with a clear lid, Altronics Cat
H0321. An alternative is the Altronics
Cat H0323 which is deeper at 55mm.
Using the shallower H3021 case, there
is only just enough spare room for the
battery holder on the left side. The
larger one has more room for the battery holder, allowing it to be attached
to the bottom of the case.
Another advantage of the larger
(H0323) case is that there is enough
room to fit a potentiometer to allow
you to adjust the output level from
around -23dBm to 0dBm, to be detailed
at the end of the article. Actually, you
can fit a small (9mm or 10mm body
size) potentiometer in the smaller
(H0321) case, but using the larger case
gives you more room and choices for
that pot.
Apart from the AD9834 module, two
circuit boards are used. One contains
the control circuitry, and the other is
the front panel with a cutout for the
display and two holes for the switch
and tuning shaft. This panel is a snug
fit into the detent on the front panel,
and it is held in place by the nut on
the switch shaft.
Construction
The control board is built on a 59
× 65mm double-sided PCB coded
CSE221001 that attaches to the clear
lid by two screws in opposite corners.
Countersunk holes must be drilled
28
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
Fig.4: the measured response of the new filter. It isn’t quite as good as estimated in Fig.3 due to the limited inductor Q
values, but it’s a vast improvement on the original. We calculate that the response to be significantly flatter than this
using the specified components.
in the clear panel for these screws –
the best way to position the holes is
to place the blank PCB inside the top
cover hard up against the right side
and use it as a template for drilling the
holes for the switch, shaft encoder and
two diagonal mounting holes.
After that, assemble the control
board (see Fig.5), starting with the surface-mounting components. The resistors and capacitors are all 2.0 × 1.2mm,
so they aren’t too difficult to solder.
However, the 5-pin SOT-23 chip (regulator REG1) requires some care due
to its close pin spacing.
It really helps to have some flux
paste to solder REG1. Put a little over
the pads, then place the IC over them
and tack one of the pins on the side
with only two pins by loading a little solder on the clean tip of a soldering iron and touching it to both
the pin and pad. Check that all the
other pins are correctly located over
their pads; if they aren’t, re-heat the
joint and gently nudge the regulator
into position.
Once it’s aligned, put a bit more
solder on the iron and, after adding a
little more flux paste, touch it to the
three pins close to each other so that
three good joints are formed. Check for
bridges between the pins. If any have
formed, add more flux paste and then
use some solder wick to remove the
excess solder. Finally, solder the last
pin on the other side.
After that, all the through-hole
components on the front side can be
mounted. The OLED plugs into a 4-pin
socket strip and is attached by 16mm
screws through 8mm untapped spacers. Depending on the exact OLED
siliconchip.com.au
Plot 1
5MHz
Plot 2
10MHz
Plot 3
25MHz
Australia's electronics magazine
June 2023 29
Fig.5: fit the components to the control board as shown here; note that there are two 4.7kW resistors under the OLED screen
and a 100nF capacitor on the underside of the PCB.
screen used, the screws may need to
be either 2mm or 2.5mm in diameter;
most will accept M2 screws.
So the OLED sits at the right height,
carefully slide off the plastic strip on
the 4-pin header soldered to the OLED
and cut the pins to suit the depth of
the socket. Use a 28-pin DIL socket for
the ATmega168/328. Finally, attach
the three connectors on the underside of the board. Transistor Q1 and
its associated 1kW resistor can be
omitted if you don’t need the serial
debug feature.
If you’re using the microcontroller purchased from the Silicon
Chip Online Shop, it will come pre-
programmed. In theory, you could
solder it straight to the board, but
using a socket will make replacing
it easier in future, should that be
necessary. If you have a blank chip,
it is easiest to program it in-circuit
using CON4.
You will need an Atmel serial programmer; an Arduino can be used in
this role. First, use the Arduino IDE to
upload the ArduinoISP sample code
to the Arduino to be used as a programmer. Next, wire up CON4 to the
six-pin programming header on the
Arduino, except for the RST signal on
pin 5. Assuming you’re using the Uno,
pin 5 on CON4 goes to its D10 digital
pin instead.
After that, you can use the free
software AVRDUDE (Linux or Windows command-line) or AVRDUDESS
(Windows GUI) to upload the HEX
file (available from the Silicon Chip
website) using “Arduino” as the programmer and 19,200 as the baud rate.
Make sure you select the correct COM
port (the one the Arduino programmer
30
Silicon Chip
board is using) and the target chip
(ATmega168, ATmega328 etc).
Modifying the DDS module
First, desolder and remove the small
SMDs labelled L4-L6 & C7-C9 from the
board. You can do this with a standard
iron by grabbing one component at a
time with some reasonably solid tweezers, then alternately heating one side
and the other while pulling up gently until the part lifts off the board. It
usually helps to melt a little extra tinlead solder into the pad on each side
before doing this.
Once the parts are off the board,
squirt a small blob of flux paste onto
each pad, place some solder wick on
top, press down with the iron, and,
when it’s hot enough, slide it off the
pad. That should remove all but a
very thin layer of solder. Clean up the
flux residue with some flux cleaner or
pure alcohol and a lint-free cloth or
cotton bud.
You can then install all the new
components: L4 = 820nH, L5 = 1.8μH,
L6 = 1.5μH, C7 = 33pF & C9 = 30pF.
Do not install a new capacitor on the
pads for C8. Note that one of the specified inductors has an open side which
should face towards the PCB while the
other inductors and the capacitors can
be fitted in any orientation.
Making the cable
A short 10-pin flat ribbon cable with
IDC connectors at each end joins the
two modules. Crimp the IDC connectors as shown in Fig.6; if in doubt,
check the photos. You can use a vice
to close down the connector on the flat
cable, making sure that it is exactly
square, although it’s better to use a dedicated IDC crimping tool (eg, Altronics T1540).
This photo shows nearly all parts required to build the Basic RF Signal Generator,
except for the replacement components for the DDS module (see the text above).
Australia's electronics magazine
siliconchip.com.au
Inductors L4-L6 and capacitors C7-C9 have been
replaced on the AD9834 module to provide a 35MHz
cutoff frequency. The output level is adjusted by
changing R2, which I replaced with a potentiometer.
There is no room for the strain relief
clips on the connectors, so leave them
off if supplied.
Testing
For initial testing, before assembling
it into the case, connect the battery and
switch it on. The OLED should come
up with an initial message showing the
version number. After two seconds, the
display will show the frequency, step
size and battery voltage. The default
frequency on power-up is 10MHz, and
the step size is 1MHz.
Check the VCC voltage at pin 7 or 20
of IC1; it should be close to 4V. You can
use the labelled pad near the bottom
edge of the PCB as a GND reference.
Rotating the knob should increase
or decrease the frequency. Depending on the shaft encoder, it may operate backwards. If so, plug a jumper
on the programming header between
pins 4 and 6 of CON4. If you haven’t
fitted the header, you can do it now or
solder a short component lead off-cut
between those pins.
The firmware reads the level on digital input PORTB.3, which determines
the encoder direction sensing. Adding
a jumper between pins 4 & 6 of CON4
pulls that pin to GND.
If all is well, connect the AD9834
module, being careful with the orientation of the flat cable, ensuring that pin
1 goes to GND at both ends. A green
LED on that module should light up
when power is applied.
Check the output on the two SMA
connectors with an RF power meter
or oscilloscope. The output of the LPF
requires 50W termination; without it,
there may be some distortion of the
output waveform.
Final assembly
Attach the control board to the transparent lid by two screws on opposite
Fig.6: the ribbon cable is simple to make but ensure that the pins are fully
pushed into the plastic housing, or you might end up with bad connections.
Fig.7: where to drill the holes in the side of the box for the SMA connectors.
siliconchip.com.au
Australia's electronics magazine
corners with 12mm-long M3 tapped
spacers, into the countersunk holes
you made earlier.
The AD9834 module attaches to the
bottom of the case with M2/M2.5 ×
12mm CSK screws and nuts plus 5mm
untapped spacers.
First, two holes need to be drilled
in the side for the SMA connectors, as
shown in Fig.7. The square wave output connector is not accessible and is
not used in this design.
Next, slide in the module and use
it as a template to mark the position
of the two holes in the bottom. Drill
these to 2.0mm or 2.5mm to suit your
screws and countersink them on the
bottom.
Calibration
The output frequency accuracy
depends on the exact frequency of
the 75MHz oscillator on the module.
I found the error at 10MHz to be about
140Hz. This is of little importance for
some applications, such as driving the
Q meter. However, there is a calibration procedure built in.
Set the frequency to precisely
10MHz and measure the output with a
frequency counter. Turn on S2 or plug
the jumper across CON3 and rotate the
tuning knob until the readout on the
counter is 10MHz ±1Hz, then press
the knob. This sets a correction factor into an EEPROM which is read on
power-up.
As there is no temperature compensation in the 75MHz crystal oscillator, you can expect this frequency to
drift slightly, but it is likely to remain
within ±20Hz at 10MHz. Recalibration
may be needed from time to time as
the crystal oscillator ages.
June 2023 31
Parts List – Basic RF Signal Generator
1 double-sided PCB coded CSE221001, 59 × 65mm
1 black PCB coded CSE220902B, 77.5 × 64mm, 1mm thick (front panel)
1 0.96in OLED screen, SSD1306-compatible controller (OLED1) [SC6176]
1 AD9834-based RF DDS signal generator module (MOD1)
[AliExpress siliconchip.au/link/abjo]
1 vertical-mount rotary encoder with integral pushbutton and 20mm-long
shaft (RE1) [SC5601]
1 105×75×40mm or 105×75×55mm ABS case [Altronics H0321 or H0323]
1 3.3uH axial RF inductor (L1)
1 820nH SMD inductor, M2012/0805, Q = 100 <at> 25MHz (L4 on MOD1)
[Coilcraft 0805HP-821XJRC or Vishay Dale IMC0805ERR82J01] ●
1 1.8μH SMD inductor, M2012/0805, Q ≈ 40 <at> 25MHz (L5 on MOD1)
[Coilcraft 0805CS-182XJRC or Murata LQW21HN1R8J00L] ●
1 1.5μH SMD inductor, M2012/0805, Q ≈ 40 <at> 25MHz (L6 on MOD1)
[Coilcraft 0805CS-152XJRC or Murata LQW21HN1R5J00L] ●
1 2×AA cell holder with flying leads (BAT1)
2 AA alkaline cells
1 2×5 pin header (CON1)
1 2-pin polarised header with matching plug and pins (CON2)
1 3-pin polarised header with matching plug and pins (CON3)
1 2×3 pin header (CON4; optional; for in-circuit programming of IC1)
1 jumper shunt (optional; to set the direction of RE1)
1 4-pin female header (for OLED1)
2 SPDT chassis-mount toggle switches with solder tags
(S1 & S2; S2 is optional, for calibration)
1 28-pin DIL IC socket (for IC1)
2 10-way IDC crimp sockets
Cable & hardware
1 knob to suit RE1
2 M3 × 12mm tapped spacers
2 M3 × 6mm panhead machine screws
2 M3 × 6mm countersunk head machine screws
2 M2.5 or M2 × 12mm countersunk head machine screws
2 M2.5 or M2 × 16mm panhead machine screws
4 M2.5 or M2 hex nuts
2 3mm ID, 8mm long untapped spacers
2 3mm ID, 5mm long untapped spacers
1 70mm length of 10-way ribbon cable
1 double-sided foam tape pad or strips (to secure the cell holder)
Semiconductors
1 ATmega168P or ATmega328P programmed with CSE22100A.HEX (IC1)
1 MCP1661T-E/OT or MP1541DJ-LF-P integrated high-voltage boost
regulator, SOT-23-5 (REG1)
1 2N7002 N-channel signal Mosfet, SOT-23 (Q1; optional, debug interface)
1 MBR0540 50V 500mA schottky diode, SOD-123 (D1)
Capacitors (all SMD ceramic, M2012/0805 size, unless noted)
2 10μF 6.3V X5R or X7R
1 33pF 50V C0G/NP0 (C7 on MOD1) ●
1 470nF 6.3V X7R
1 30pF 50V C0G/NP0 (C9 on MOD1) ●
4 100nF 50V X7R
Resistors (all 1% SMD M2012/0805 size, unless noted)
1 330kW
1 120kW
5 4.7kW
1 1kW (optional, for debug interface)
● replacement parts for the AD9834 DDS module
Additional parts for adjustable output level
1 100nF 50V X7R SMD M2012/0805 size ceramic capacitor
1 1.2kW 1% SMD M2012/0805 size resistor
1 50kW chassis-mounting single-gang linear potentiometer
[Altronics R2245 or Jaycar RP8516]
1 short length of light-duty figure-8 wire (eg, stripped from ribbon cable)
32
Silicon Chip
Australia's electronics magazine
Battery life
With fresh AA alkaline cells, the
input voltage is about 3.2V. The current drain starts at 80mA and increases
as the battery voltage drops (because
the boost regulator maintains a constant output voltage). By the time the
battery drops to 2.7V, the current is
about 95mA.
The best alkaline AA cells are
3000mAh, but that rating is for a light
load. It has to be derated to 2000mAh
or so at the expected current drain.
This gives an expected operational life
of about 20 hours.
Adjusting the output level
Depending on component values
and settings, the Q meter can be fussy
about its input signal level. Sometimes
the 0dBm value is too high. We can use
external attenuators, but this makes
the setup rather complicated.
The output level is set by resistor R2
on the DDS module, so I thought why
not use a potentiometer in its place?
The wires to the potentiometer could
pick up noise that would amplitude-
modulate the output. However, if the
wires are short, that might not be a
problem.
The previous photos shows how I
did this on the prototype. I started by
replacing R2 with a 100nF M2012/0805
SMD capacitor, providing noise filtering and a firmer base to the connecting
wires. Connect a 1.2kW M2012/0805
SMD resistor to one end of this capacitor, then use short wires to connect a
50kW pot between the wiper and the
anti-clockwise end of the track.
Mount this on the right-hand side
of the enclosure so the wires are very
short. Take great care in attaching the
wires to the module to prevent any
damage to the SMD connections.
With the maximum resistance, the
output becomes about 22mV peak-topeak, corresponding to about -29dBm.
At minimum resistance, the output is
close to 0dBm. I saw no evidence of
noise pickup in the output signal.
If adding this output control, using
the larger case (H0323) gives you
more options; you could use a 16mm,
10mm or 9mm potentiometer. With
the smaller case, you’ll have to use a
9mm or 10mm potentiometer to have
SC
any chance of it fitting.
KIT (SC6656) – $100 + P&P
Includes everything except case,
cells and optional 50kW pot
siliconchip.com.au
|