Friday 18 March 2022

27 - Building and Characterising a RF Two Tone Generator and a Switched Attenuator

 Building and Characterising a RF Two Tone Generator and a Switched Attenuator


I am building a uBitx SSB Transceiver and want to test each module using simple test gear. A NanoVNA can do quite a lot but sometimes you need to apply two RF signals quite close together and see what the output contains on a spectrum analyser – I plan to use my SDRPlay software defined radio receiver and run the RSP Spectrum analyser software available on SDRPlays’ website.

One of the two or three books I consider the bibles of Homebrew is “Building a Transceiver” by Eamon Skelton EI9GQ and Elaine Richards G4LFM available in the RSGB Store. It covers construction of a two-tone generator using two simple crystal oscillators, low pass filters and a simple combiner. I reproduce Eamon’s circuit here but do get the book if constructing it.

You need to build two of these, I built each of mine in an Altoids mint tin using small squares of PCB glued onto a PCB substrate – this type of bread boarding is quicker and easier than making PCBs for small RF projects and gives excellent results as the circuit is above a ground plane. Shielding is important in this circuit and you don’t want extraneous pickup from leakage.

Build two of these. I added a small inductor in series with one of the crystals. Use any similar pair of crystals.




to the Altoid tins used feedthrough capacitors and I used short lengths of Coax to take the two signal generators outputs to the combining circuit.


To test this unit, I fed the output to my SDR and used spectrum analyser software to check both for harmonics and intermodulation. However, the recommended maximum input to the RSP1A is 0 dBm (or up to 10 for short periods) and the output could have been too high so I built an attenuator and, as I would need an adjustable one for some other tests at some stage, I used a design with eight slide switches to allow setting from 1 to 81 dB. 

The circuit is similar to one found in the ARRL Handbook (a quick search of the net found https://www.arrl.org/files/file/Technology/tis/info/pdf/September1982_Attenuator.pdf). Here are some photos of it:




The table below might help you understand harmonics and intermodulation and mixing of two frequencies. (mixing is a special case of intermodulation). 

Assume each frequency generates harmonics, so f1, 2*f1, 3*f1, 4*f1 etc come out - known as the fundamental, the second harmonic, the third harmonic and the 4th harmonic. Repeat for f2. 

Now simply add each term in the first series to each term in the second series. Repeat using subtraction between the same terms. You quickly generate a lot of frequencies!

Luckily the strength of these gets less as the harmonic number goes up. Also, quite often the frequency is too far away to matter too much. 

Usually we focus on the second or third harmonic and the third order intermodulation, ie (2*f1–f2) and (2*f2-f1). Marked in red in the second table below. This is because they are close to the original frequencies f1 and f2. In a receiver, they might well be close enough to be passed through to the loudspeaker and be an interfering signal.


Incredible to think you get 60 different frequencies for just two tones generating up to the sixth harmonic, you sometimes need to consider higher, Bill Meara (of Soldersmoke.com) had to filter out an 8th harmonic lately as it was interfering with an oscillator. These frequencies can be computed by spreadsheet, which I have done for my two tones. The spreadsheet is on my blog.


In the table above note that the 3rd order IMD terms are at 13.021 MHz and 13.063 MHz. The 5th order terms are at 13.077 and 13.007 MHz. The other higher terms that are near the two tones are below the Spectrum Analyser noise floor so I need only worry about the 3rd and 5th. I need to add a bit of attenuation as I am slightly overdriving the SDR – the manufacturer says it can take 10 dBm for short periods and 0 dBm continuously – my tests show it is more linear if only driven by signals less than -10 dBm. An interesting feature of IMD is that if you drop or increase the fundamental signals, the 3rd


If I now insert 10 dB attenuation, the 5th order terms disappear and the third order terms are just under 60 dB below the fundamental tone. They have dropped 20 dB despite the fundamental dropping 10. This is evidence that it is the SDR that is generating some of this IMD – if it was all originating in the two-tone oscillator then everything would just drop 10 dB through the attenuator.

But increasing the attenuation by another 2 dB does not cause the 3rd order to drop 6 dB, so at this stage we are seeing the distortion in the two-tone oscillator itself. We need to keep the input below -10 dB and live with an IMD that is 60 dB below one tone or build a better shielded two tone oscillator and a better combiner (might have been better to put it in its own metal box…)


The fact that the 3rd order did not drop much further with additional attenuation indicates we are actually looking at the distortion of the two-tone generator. SDR third order IMD should drop 3 times faster than the amount the tones are dropping, and as the attenuator is after the tone generator and before the SDR then we are not looking at the IMD of the SDR, once the input gets below -10 dB.


In summary, this low cost test equipment will do the job – provided we work within its capabilities and doublecheck what we are measuring. Attenuators are vital, even the 0 dBm output of a NanoVNA needs to be attenuated to avoid overloading amplifiers and many circuits to be tested. 

By next month I will have tested a three transistor termination insensitive amplifier and a diode double balanced mixer (DDBM). The uBitx uses three of the TIA amps and a pair of DDBMs. 

The earlier articles described using a NanoVNA to test filters and I will apply them to three filters. That will be most of the receiver section tested.

You don’t need to test everything to build a uBitx but I want to
   (a) build a complete uBitx as it was originally designed and 
   (b) start substituting different modules to see if I can improve performance. 
Part of the fun of homebrew!

uBits is described at http://hfsignals.com and the Bitx20 groups.io website (https://groups.io/g/BITX20 ), also see http://ubitx.net/



26 - Making Filters using LTspice and a Soldering Iron

Making Filters using LTspice and a Soldering Iron

The Zoom talk I gave to the club at our December 2021 meeting covered a number of points – I have placed the PowerPoint on my blog at https://mi5afl.blogspot.com but thought I might summarize the material here.

One of the filters in the uBitx transceiver is shown below drawn using the simple LTspice tool.


Of course to simulate this we must add a 50 Ohm output impedance and a voltage source with an internal impedance of 50 Ohms. We must also add lines of text beginning with a “dot” to instruct LTspice what to do when the simulation runs. There are half a dozen types of spice command but the two below tell LTspice to do an AC analysis by sweeping from 1 to 30 MHz, 101 points per decade and to prepare two port network parameters such as S21, Zin and Zout. S21 is the “gain” of the filter in dB – it’s what a NanoVNA would show if it was measuring a real filter.


Hitting the “run” icon in LTspice produces a blank white window, right-clicking in it allows you to “add a trace” and you can select S21 (or Zin or Zout). Note you can remove phase information by right-clicking on the right hand axis and you can change the format of the Zin trace to linear by clicking on the left hand axis in the Z plot.



The performance of this filter is quite good for its gain characteristic – it passes 40m (7 MHz to 7.2 MHz) signals nicely and attenuates 14 MHz to -65dB. However, its impedance matching is not great, varying from 65 to 110 Ohms. So, if the design you have picked up from the web or a book is poor how do you design your own?

The ARRL and RSGB handbooks have tables of filters at 1 Ohm input and output impedances and frequencies of 0.159 Hz (this is one radian/second). These are not real filters of course – you scale up the impedance and frequencies to what you need. Not difficult if you follow the instructions but it is tedious.

As well as several downloadable pieces of software (ELSIE or AADE for example) there is a very good online filter designer at https://rf-tools.com/lc-filter/

You fill in the response of the filter you want – bandpass, highpass or lowpass.

You tell it what type;

Butterworth, smooth but gentle sloped.

Chebyshev has a good steep slope but has inband ripple – you specify how much, even 1dB is hardly noticeable. The remaining types are Elliptical (Cauer) and Bessel. Bessel is best for digital signals and Cauer is the steepest but has big ripples in the stop band. Chebyshev 1dB ripple is commonly used.



http://Toroids.info - can both design Toroids and Matching Networks



So once the simulations are done you can build the filter, the next question is how do you make the inductors?

Inductors can be easily made on Powdered Iron toroids – these have a name like T50-2 this is a toroid of 0.5 inch outer diameter and type -2 powdered iron painted a yellow colour. You should not use ferrite toroids (these have a FT prefix like FT50-43) although you can use them for wideband transformers, Baluns and chokes. To work out how many turns to use in your powdered iron inductor you can either take the square root of the desired inductance in nH divided by the Al constant for your chosen type (type 2 has an Al of 4.9) or you can use a handy online tool found at http://toroids.info/ The screen above shows that 13 to 14 turns are needed.

I wound the toroids for the uBitx filter (900nH inductances) and found I could get anywhere from 626 nH to 1000 nH by spreading out or compressing the windings on the core. I measured the inductance on my NanoVNA and dripped hot candlewax over the winding to keep them stable as I soldered them in. Hot glue would be a more permanent solution. Here is a photo of the completed filter.


I used polystyrene capacitors because I have a lot of them, 160V and 2.5% they are a good choice but can be hard to get hold of and are expensive. Ceramic discs or dipped mica are more stable and good high voltage ratings. So how did the real filter compare to the simulations? When I measured with my nanoVNA the results were poor, but it turns out there is something wrong with my nanoVNA. Richard's NanoVNA gave good results. When I switched to using a signal generator and my SDRPlay SDR1a as a spectrum analyser I got results that matched the simulation almost exactly. I don’t have a tracking generator so the diagram below is several screenshots stitched together

So, in summary, don’t believe everything you see in books or on the web. Verify designs with LTspice. Filter design is easy using https://rf-tools.com/lc-filter/ and http://toroids.info/  Winding toroids is easy provided you measure and squeeze turns until you get the right value. Candle wax holds winding securely so you can solder them into a circuit without disturbing the windings. 





25 - Equipment Review: A first look RF Signal Frequency Counter

 Equipment Review: A first look

RF Signal Frequency Counter

0.1MHz to 2.4GHz as seen on EBAY! By Ian, MI5AFL


I do have a couple of frequency counters that are 30 years old that will read to 550MHz but need 10
seconds to read to one hertz accuracy. I found the unit above on Ebay, there are a lot of frequency
counters on Ebay! But some have only 6 digits or use an LCD. It can be difficult to be sure of the
actual function of these units as the English description is often Chinglish and a bit inscrutable. I
wanted to measure crystals to one hertz accuracy for some Crystal filters I am building and wanted a
second (or third!) way of checking parameters; I have to admit my NanoVNA doesn’t drift much
when measuring the frequency of crystals but I like to have 2 or 3 different ways of measuring
things. In any case at under a tenner including postage it was worth taking a chance to see if it would
work. I am pleased to report it works very well! I paid £7.62 for mine plus postage from the Seller
“Alimodule” but there are over 20 sellers offering what looks like an identical or nearly identical
module. I got an email saying it might take 40 days and not to report the seller to Ebay however it
arrived in 25 days.


The connections to the unit are not too difficult to work out – there are two identical 2 pin plugs
mounted on the board (in white in the first photograph) and two leads are supplied, each with red
and black wires. You need to know that the lead near the two metal capacitors is for DC power (9 to
15V@60 to 160mA I think) and the input is applied to the end with all the SMT components (right
hand side in the top photograph).


There are also two pushbutton switches on the front of the unit, marked with a sideways U and a solid triangle, these “SET” or “CHANGE” values. Finding out what these do took some searching on the web for a manual, I am glad to say I succeeded although blind experiment would have worked eventually. I can email the manual to any who want it.


The “user interface” allows for 6 functions;


A single depression and release of the SET button brings up the words IF000000. If you hit the CHANGE button, it repetitively alters the first digit, hitting SET moves to the next digit and hence you set an offset between measured and displayed frequency. A final SET moves to the next menu item.


If after hitting the first SET button, you then hit SET again you arrive at the second menu item immediately - the message changes to “IF N” or “IF U” with the CHANGE button toggling between these, you exit this mode by hitting SET again. This mode allows you to either subtract or add the offset. Useful to retrofit into a radio and get a read out of the received or transmitted frequency when the Radio’s VFO is above or below the desired frequency by the IF frequency – often 9MHz or so. I may eventually fit this unit into my BitX 40, my 80m Epiphyte or a RF50 6m SSB transceiver kit I built from Hands Electronics a long time ago, though I might go back to EBAY and get a 6 digit as the VFOs in these rigs are probably not that stable to need 1 Hz accuracy.


The third menu item sets the channel mode to “A”, “L” or “H” and this selects the measured frequency range to 0.1MHz to 60MHz (the “LOW” band) or 20MHz to 2.4GHz (the HIGH band). These bring in a pre-selector and affect resolution. The LOW band can display to 1 Hz resolution whereas the HIGH band can display to 64Hz accuracy. The display on my unit refreshes every second.


The manual I downloaded has a next menu item that allows setting a filter; “DF ON” or “DF OFF” is the message. Did not do much for me – but my test signals were clean. The next menu item was marked as “Move a bit to the right” in the manual and “] on” and “] Off” on the display. I believe this toggles my unit between 0.1 second and 1 second sample time, which makes the unit read to 10Hz or 1Hz resolution on the LOW band. There is a further menu item that sets the LED brightness between “L 1” and “L 8”, from an easy to read dim to an overly bright level 8 display (I left mine on “L 1”). Do note however that I came across a diagram on the net (in Russian!) that showed a further menu item to set more options on gate time so your purchase might be slightly different to mine.


Once you have set the menu items the mode is stored and remembered the next time you switch on. So you only have to configure the unit once, and it might just work out of the box.


I connected the unit up to a Marconi 2022 signal generator which I believe is stable and accurate and also to my old frequency counter (a GW GFC 8055G). I did have to experiment quite a bit to set the signal generator output level to get a stable reading on the Ebay unit. On the low band any value from 200mV to 500mV worked ok but not above or below this value. The manual said 60mV sensitivity on the LOW band which seems optimistic.


At 11,000,000 Hz output the unit displayed 11,000,013 Hz so is a bit high, there are a couple of presets on the board but so far I have left it alone – it will suffice for my needs because it is remarkably stable. Left overnight in an outside shack, albeit above my garage and well insulated, the display read 11,000,014 the next morning so I can declare it as being stable, if not quite calibrated. The specification in the manual mentions a 2.5ppm TCXO and mine seems much better than this. I applied a 1GHz signal and set the mode to H, it read correctly with occasional readings jumping up 64Hz. It stayed stable for the hour that I ran this test. Not bad for a tenner!



24 - Amateur Radio on the net

 Amateur Radio on the net


There are many good video and audio programmes on the internet about amateur radio. The amateurs who produce these do so mainly on a regular
basis, monthly or weekly, some only “post” on an intermittent schedule – when they have something new to share. You may find them an interesting way to keep up to date with our hobby. I list some of my favourites below and perhaps you can give them a try. Let us all know if you have other favourites.


ICQ Podcast. This is an audio podcast, produced by mainly UK amateurs, they
report the news each week and also have a “feature”. They have 357
episodes online at    www.icqpodcast.com/   but I use a podcast app on my
smartphone and listen on headphones when out walking or on Bluetooth
when driving the car.


The other podcasts I am fond of are:
Ham radio crash course at http://hamradiocrashcourse.com/ for the audio –
but they only have the last 15 or so there, better to subscribe to their podcast
using your phone. This podcast is run by Josh Nash KI6NAZ and his wife Leah.
They ramble on a bit and often stray away from ham radio topics but I find
them entertaining. Josh also produces videos on youtube, and has started
hosting Ham Nation as well as his own content at
www.youtube.com/user/hoshnasi (search youtube for “Ham radio Crash
course”) I rarely watch his videos.


Ham radio workbench
has good coverage of technical items as well as “non
expert” talks. Try www.hamradioworkbench.com/ their website is good too.


The Soldersmoke Podcast is mainly about homebrew and hosted by Bill
Meara and Pete Juliano. Bill is found of old valve sets and Pete is a most
prolific builder – approaching 60 SSB rigs! Bill also runs a daily blog at
http://soldersmoke.blogspot.com/ and there is a link there to listen to the
most recent podcast as well as links to older archives, again it is better to
subscribe to his podcasts using a podcast app on your phone or tablet. They
are roughly monthly and have produced 357 podcasts


The videos I often watch include:


Ham Nation. This has been going a long while and used to be available on
some streaming TVs. It is now produced by Josh Nash about every two weeks
within his own weekly YouTube videos. See the link above. Ham Nation has
several presenters (usually at least 4) and each does a slot; the original
presenter is Bob Heil who runs a company making microphones, headphones
and other useful audio equipment. Worth listening to. Other presenters
include Gordon West, Val and Amanda as well as Don. Each is worth
watching.


Amateurlogic TV Another American “show” on YouTube, best watched on
YouTube although their channel carries videos of “Ham College” and recently
“shorties”. I prefer the hour-long programmes that go out about once a
month. There is also an archive at www.amateurlogic.tv/downloads.htm but
try the YouTube first at www.youtube.com/user/gthomas or search YouTube
for “Amateurlogic” The two main hosts George and Tommy also have input
from Emile and Mike. They often cover good technical demos of various ham
radio related topics as well as reviews of gear and software.


DX Commander run by Callum, M0MCX, who owns the DX commander
company (superb DX Verticals). Callum gives out all the details on how to
make his products yourself cheaply or you can buy bits or assembled
antennas from him. A nice guy and a prolific producer, he uses and
demonstrates/teaches how to use the MMANA antenna analysis software
and you can really learn a lot about antennas by following his YouTube
channel and watching his back catalogue. Search YouTube for
DXCommander - since I wrote the article for CONTACT the original DXCommander has been taken down by youtube in March 2022 (so far without explanation) Callum has created a new channel DX.Commander (note the dot)


Waters Stanton presented by Waters & Stanton Ltd usually presented by
Peter himself and often covers making antennas and gear as well as
equipment reviews where they promote the products they sell. Try
www.youtube.com/user/watersstanton/videos

 
I should mention that Martin Lynch also produce videos, often covering what
they have for sale second hand. They are on YouTube at
www.youtube.com/user/MLandSshop

RSGB
(www.youtube.com/user/TheRSGB ) During lockdown they were quite
prolific about uploading videos, they also uploaded the presentations from
their 2020 convention. They have over 100 programmes to watch.
TX Factor (www.youtube.com/user/txfactorshows ) only occasional videos
uploaded (27 episodes) but these are professionally produced, the RSGB
sponsor them. They often report on what hams are doing throughout the UK.
They also review equipment.


As I own a SDRplay RSP1A software defined radio I subscribe to two YouTube
channels from SDRplay.


Charlie Morris www.youtube.com/c/CharlieMorrisZL2CTM/videos   his
homebrew methods are inspiring.


M0NTV Homebrewing - Nick is worth a listen too – search YouTube for the
channel.
 

And the list goes on, for example dip into the youtube channels below...
QRP Labs, Ashhar Farhan, W2AEW, W0QE, NA5Y as well as Andreas Spiess
 

As well as these regular channels some of the recent ham radio conventions
have put their content onto YouTube. I “attended” the QSOToday convention
last weekend and they have put most of their presentations online using
Vimeo which is a YouTube alternative. I paid $10 for the convention so their
content is not freely available. 

The GQRP club did put their content online so, if you couldn’t attend on the weekend, they ran their convention you can catch up afterwards. I am a member of GQRP (at £6 a year, you should be too!) but catch up on their 2020 convention at    www.youtube.com/c/GQRPClub/videos    You should also note their 2021
convention is coming up in early September if you want live presentations
with interesting Q&A sessions after each talk (the Q&A is not put up on
YouTube normally). Join up at    www.gqrp.com/index.htm  


That’s all for now, the other internet resource I use is at    https://groups.io/groups where I subscribe to gqrp, RSGBTechnical, BITX20, SDRPlayUsers, qrptech, nanovna-users, nodered-hamradio, ucx, winmor and SoftwareControlledHamRadio. So many toys and so little time...

23 - Equipment Review TFT GM328 Transistor Tester Diode LCR ESR meter

 

Equipment Review: A first look
TFT GM328 Transistor Tester Diode LCR ESR meter
PWM Square wave Generator

 




I was looking for a simple capacitance meter as a spare and to backup up what I already have (I like to have at least two of everything so I can compare results).  I found the unit above on Ebay and was amazed at what it could do. It is not particularly accurate in some situations, but any reading is better than no reading.  It does many things, probably none of them particularly well, but it is cheap and everyone should have one!

 I suppose every radio shack should have some test gear – a soldering iron and a couple of digital voltmeter for starters, an SWR meter and maybe a power meter for seconds. The unit above along with a nanoVNA would nearly complete a shack as long as you had a modern HF transceiver. 

Ebay has the unit above for sale from dozens of suppliers for between £10 and £14. Search on the rather unwieldy title above. The design has been around for a long time and I am unsure of its original heritage, maybe it was a
2011 Embedded Projects Journal article by Markus Frejek? If anyone knows, please let me know.


There are details on the website

 https://www.mikrocontroller.net/articles/AVR-Transistortester 

and the EEVBLOG website has a extensive forum discussing it at

https://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/


Older versions had simple 2 line text LCD screens, the recent ones have colour TFT screens so make sure you buy one that looks like the photo above.I will summarize what it can do here, although to date I have just used it to measure a few things I do believe it is a Swiss army knife of component testing!
 

Features of the GM328A;
Versatile connections; by using a zero insertion socket, inserting components is eas y, pick the correct pitch, insert and push the lever down.it does not matter which connections you use, for resistors, capacitors and inductors just pick any
two two pins. If you plug in a diode or transistor it will work out what pin is which, this alone makes it a joy to use, it can identify which pin is the base, collector or emitter as well as telling you the polarity (NPN or PNP) and the gain, and the Vbe. And similarly for MOSFETs and so much more. 

 

There is even some SMT pads where you can hold SMT parts to test as well. Works best if you have three hands though. The unit can measure Resistance, Capacitance and Inductance. Capacitors over 20nF also have their ESR measured. NB discharge caps before connecting them. I inserted a 1mH choke the unit
measured 1.05mH and when inserting a 10uH it gave .01mH so the readings were ok.

I couldn’t measure the small capacitance of a crystal (3pF) but other capacitances over 25pF read correctly. I could add the crystal in parallel with a 25pF and got a reading of 28pF so that is one solution. Theoretically accurate to 1pF - useful.


I tried a couple of transistors and it gave the correct pinouts and believable Hfe(gain) and Vbe. A couple of diodes gave good readings too. It gave Vf as 529mV and 502mV at 12uA so I can use it for diode matching for ring mixers.
 

The other (untested) features stated in the manual are that it can measure Zener diodes and LEDs (zeners up to 4.5V only)
 

The unit can also accurately measure audio frequencies (up to 33kHz) and also generate frequencies up to 2MHz these are square waves though. You can also generate a PWM signal and vary the mark to space ratio, this is at a fixed frequency of around 7kHz – a pity this can’t be used to test RC servos.


The unit can also test digital sensors and remote control! You’d need to read the manual to do this. There is a 4 page manual available on the net but the mikrocontroller site had a 140 page manual that should allow rebuilding the firmware – they talk about capacitor measurements of under 100pF
to 0.01pF accuracy, time will tell if I can get that going. 

In the meantime, I recommend this product for a general purpose component tester.