Saturday, 29 August 2015

Stand-alone Total Response Measurement

I've now implemented a stand-alone measurement system to measure the overall RF to AF response of a receiver...


The method, first introduced in this post then used extensively in my presentation and associated written paper at the QRP ARCI Four Days in May event in Dayton, generates an RF sweep and observes the resulting audio response of an HF receiver.

Previous implementations of the method relied upon an expensive electronic voltmeter to transduce the audio response of the receiver into a dc voltage which an Arduino could sample and a computer to plot the results. The new system uses a home-brew AF detector and displays the results on a little TFT screen, making a self-contained, stand-alone system...


The eagle-eyed reader will notice that the Arduino is a DUE, which is a few clicks up from the humbler devices which were used to run this method in its earlier incarnations. This isn't because I'm expecting to do any heavy lifting in the processing - rather I wanted simplicity in interfacing to the 3v3 display (and the DDS module, come to that), I wanted plenty of ports to play with and I wanted plenty of code space for the display library and other future developments of this measurement approach (watch this space). So - the DUE gave all this flexibility over an UNO or a MEGA.

The detector is inspired by an interesting twist on a precision rectifier circuit published by Dave Johnson. Unlike the original circuit, which uses an exotic (i.e. expensive) rail-to-rail op-amp and a single-sided supply, my version uses bog-standard components and generates its own local negative rail from the standard "shack" 12V supply...


I didn't have any 1% resistors in stock for the two critical potential dividers in the system - so I used trimmers and patience.

The measured performance is pretty good, giving me 50 dB of usable dynamic range ...


This isn't a true RMS detector - but I'm only firing sinusoids at the system (as long as I don't overload anything and ignore any but the "wanted" modulation product - which is the only one inside the audio pass-band if everything is working correctly), so it is good enough and the price was right.

The rest of the system follows the strategy already described - generate a 10 kHz downwards RF sweep which starts at the frequency to which the radio is tuned. In a LSB receiver, this will map to a sweep from 0 to 10 kHz of Audio Frequencies - you hear an audio sweep from the speakers and the system observes the speaker voltage, to derive the overall receiving response of the system.

It is important  that the output of the DDS module is appropriately attenuated before it is applied to the receiver's input - otherwise the latter will be grossly overloaded and distortion will ruin the measurement. This is achieved with a couple of attenuators, one of which is visible in the photo above - and any RF controls on the radio under test.

Here's the measured response of the Norcal 40, seen in the photo above...


The little 2.4 inch screen is really difficult to photograph in such a way as to do its image justice.

Here's a measure of the same system's response, made with the "old" system, as reported at FDIM...


The Norcal 40 has conventional, continuous, analog tuning and an internal input RF attenuator, so the "scales" on the above two graphs shouldn't be expected to align perfectly. But you can see that the essential shape and width is there on the little TFT screen, 12 seconds after a button push to start the measurement - all with no involvement of a PC!

The system can measure any other radio-under-test, such as my KD1JV Tri-Bander from Hendricks QRP Kits, which has the American Morse Paddle permanently riding shotgun...


 Here's the overall response of this little rig...


Again, a nice, tight, narrow response peaking around 700 Hz, as is pleasant and appropriate for CW (in my opinion).

The spuriae at higher frequencies are glitches from other electrical noise sources around the place - NOT from the radio (in this case it was the tumble drier downstairs doing its work on a batch of laundry). Unlike the Bruel and Kjaer voltmeter which I was using before, which has a response limited between 20 and 20kHz, my new detector is wide-open - calling it an "AF Detector" is a misnomer, because it still responds pretty well at 100 kHz! I'll get round to making a band-limiting front end at some point in a later revision.

This is a neat system, which will form a foundation on which to build some more interesting measurements. I'm not going to be posting any more details (of code, detector circuits etc) at this stage as this material is destined to be published elsewhere - so please don't ask.

But please do watch out for those other measurement ideas - I think you'll like them.

...-.- de m0xpd

Friday, 7 August 2015

Sandford Wattmeter

Just made up the Sandford Wattmeter kit from Kanga UK, which has been sitting in my "in tray" since last year...


This meter uses some 50 Ohm thick-film resistors to form a 50-Ohm dummy load and a conventional detector to drive the meter.

I made up the instrument according to the clear instructions - with the exception that I substituted a 1N5711 for the 1N4148 specified in the words and music (as I intend to use the Sandford's detector in some comparisons with a digital meter I've been playing with).

You can see the thick-film power resistors and the (blue) 5711 diode here...


My diode substitution required me to make a little modification to the metering circuit to allow the system to be calibrated correctly - but everything was soon back on track. The instructions give a nice little wheeze for calibrating with a d.c. source - useful for those with limited test equipment.

I needed some application to test the new meter on - so thoughts turned to the recently-acquired Patriot...


I measured power output generated on key-down in CW mode across both 40 and 20m bands and show the results in the graphs below...


This is a neat little meter and a nice addition to the test bench - certainly easier than getting out a dummy load and hooking up to the scope (or choosing a dummy load with an integral detector and connecting to a multimeter) and doing the math.

Perhaps not so much fun, though!

...-.- de m0xpd



Saturday, 1 August 2015

Two Receivers

Two receivers are being prototyped on the bench here at m0xpd. Interestingly, they sit close to opposite ends of the spectrum. Not the frequency spectrum - but what might be called the spectrum of sophistication...

At one end is a re-work of a Software-Defined Radio...


The original Acorn is a simple SDR, designed by g0nqe and available from Kanga UK. It uses only through-hole components, which differentiates it from many other SDR systems and makes it attractive to novice builders who shy away from surface mount components - for perfectly good reasons.

I've re-worked the Acorn for Kanga, to provide the "Acorn II" prototype seen above. It retains the "though-hole" philosophy and improves the connectors on the board. Support for an on-board crystal is retained but the main upgrade is the provision of an external clock input. You can see both the (plug in) crystal and the external clock inputs on this picture.



The external input liberates the Acorn II to tune anywhere, given an appropriate source - such as that conveniently provided by my Si5351 board...



In the picture above, the Acorn II is powering an Arduino UNO (through the red and black wires), which is hosting a Kanga/m0xpd Si5351 shield.

The shield is generating a 28.6 MHz clock (applied through the green and black wires), to place the SDR in the middle of the 40m voice band - I was listening to David, g3sqa, chatting on 7,160 after calling "CQ WAB" at the time the photo was taken...




Notice that I hadn't changed the LO setting on WinRad to reflect this tuning!

At the moment I have the two "amplified" output channels of the Si5351 shield set to two frequencies appropriate for 40m use - one at 28.6 MHz (as above) for voice and the other at 28.08 MHz for CW. Given a few more moments spare time, I'll add a rotary encoder to allow changes of the LO setting - but you all know how life is too short, etc etc.

The Acorn II also inherits from the original Acorn an on-board input band-pass filter. The Acorn II will be delivered with components to build this filter for 40m. The external clock input allows the radio to tune other bands - but the radio should use an input filter appropriate to these bands. Such filters have to be constructed off-board and there are routing jumpers to steer the signal to external filters as required.

The Acorn II will soon be available from Kanga UK, along with code to set up the Kanga/m0xpd Si5351 shield to generate LO signals.

I mentioned at the top of the post that there were TWO receivers on the bench at present...

At the lower-tech end of the spectrum is a Theremin Regenerative Receiver I'm putting together for a little event later in the year (watch this space)...


Here's a rear view, which shows more of the giblets...


The Theremin gag is a reference to the "charming" consequences of hand capacitance that you get with these old-time toys. I'd nearly forgotten about all that stuff since playing with sensible, isochronous oscillators, like the AD9850 and the Si5351.

It is nice to have both ends of the "sophistication" spectrum on the go at the same time. Nice - but it does rather squeeze available time for other projects.

...-.- de m0xpd

Saturday, 25 July 2015

Patriotic Display

My TenTec Patriot is usable but user-hostile without a display. Fortunately, adding a display is the work of moments...


I haven't had many moments to spare since getting back home from the USA, but I found the few required recently and so - as you see above - the Patriot can now tell me what it is up to.

Adding the display is easy, as the heavy lifting is done for you - if you are content to attach a 20*4 LCD alphanumeric display over the standard ("Hitachi") interface. The interface is already accommodated in both hardware and the factory code. There is even a (poor) description of what to do in the user manual and a (much better) description in the comments within the factory code.

Here is a blow-by-blow account of how to do it, with some pictures to make it clearer for those who are not so familiar with these things.

Here is the relevant extract from wa4cdm's code ...


As you see, you need power and six lines to the display.

Here is the wiring you must arrange at the display end...


The LCD will have the usual 14 pins of the "Hitachi" interface plus two more for the LED backlight. Only four lines of the eight-bit data bus are used - the rest are left unconnected.

A simple trimmer potentiometer is used to set a bias voltage which makes the display readable. The comments in the code specify this as 10k - but the value isn't critical - I used 1k, because I had one at hand. Adjust this to get best results on the display. Too far one way and you'll see solid "bricks", too far the other and you'll see nothing.

You will need to run eight wires to the inside of the Patriot case - and you'll have to take the case top off to do this (remove the four screws at the side plus the nut and washer on the antenna socket). I had a scrap of ten-way ribbon cable about a foot long to hand, so I used that. I left all ten ways in place - perhaps I'll add some more push buttons or something in future with the extra two wires.

At the "Patriot" end of the wires you'll need to terminate on a 1*6 male 0.1 inch header strip and a 1*2 strip (or individual pins).

The relevant connection points - which are female headers -  are seen on this annotated section of the board layout...


and on this photo of the same area (the relevant connections are identified by the red boxes)...


Pass your cable through the rectangular aperture in the back panel (of the case top) and plug into the relevant connections, as shown below...


then reassemble your case.

Assuming your wiring is all correct, the display will work with the "factory" code - with no modifications required to the software at all - the factory software is already sending all the configuration commands and data (thanks to Stan, AK0B, for pointing out that the original version of this post didn't say anything about this important dimension).

The Patriot is a whole lot more user-friendly with a display.

Makes you wonder why it didn't come with a display (obviously the price of the case would increase dramatically) and why the instructions for adding one are presented in a manner clearly visible to those who already know how to go about doing it for themselves, but somewhat obscured to newcomers.

Funny old world.

...-.- de m0xpd

Saturday, 18 July 2015

Prototyping with Small Outline Transistors

A recent circuit idea I've been fooling with required a complementary pair of MOSFETs. I'm tripping over the familiar n-channel devices, but p-channel MOSFETs don't seem to breed in the m0xpd junk box. Accordingly, I had to spend some of my hard-earned money...

The easiest (close-to) complementary pair I could source (from traders on the familiar auction site - cheaper than going to a major component supplier, once the minimum order quantity and shipping is factored in) was the 2N7002 and the BSS83. They cost pennies and arrived in the blink of an eye. The only problem was that they are in SOT-23 packages, making prototyping a rather different proposition to something in a leaded package like a TO92.

As regular readers will know, I like to use solderless breadboards for breadboarding (what else). I needed a method of working with the SOT-23 transistor in a prototyping context.

Here's my solution. I'm sure it isn't original - but it has worked well for me, so it might be worth sharing...

The SOT-23 package has three pins on a 0.89 mm pitch. This is close enough to a 1mm pitch to ba able to fit on three adjacent "lands" of a SOIC ("Small Outline Integrated Circuit")  PCB footprint. Such a footprint will be found on adapters, which can be used to "convert" a SOIC to a dual-in-line format and which can be had very cheaply from on-line retailers.

Here is a SOT-23 transistor, placed on a 16 pin SOIC to DIL adapter...


In the photo above left, you can see the the lands are too short to allow convenient access to the pins on both sides of the SOT package. In the photo above right, you can see that the SOT-23 device doesn't quite bridge the gap between the two rows of lands for the IC (although one of my guys at work has succeeded in soldering the device in place in this position, creating solder bridges between the transistor pins and the nearest lands).

I found an 8-pin SOIC - DIL adapter, in which the lands are rather longer...


The transistor's pins are accessible on one row of the smaller PCB's long pads/lands. You can also clearly see the mismatch between the SOIC pitch and the SOT-23 pitch - not enough to cause a problem over only three pins.


So, I made up a single 8-pin "device", carrying a pair of complementary MOSFETs...



The transistors - too small for me to hold - are now easy to use in the solderless breadboard.

Here's the finished "device" in use in the prototyping exercise...


You can see how small it is in contrast to the neighbouring TO92 (a voltage regulator).

Now the prototyping is done it is time to use the circuit - but that's another story.

...-.- de m0xpd

Saturday, 11 July 2015

Displaying Variety

Having seen my adventures with the new display for the little Occam's Dirk rig, Dennis, g6ybc, from Kanga sent me a sample of a Nokia display rated for 5V operation.

I tried a hook up direct to the Arduino - running the "Occam's Dirk" code - and, sure enough, the display starts up as expected...


Notice there is no 3v3 connection for power and no logic level change. There are also no resistors etc. I did run the display in the new interface board (i.e. on 3v3 supply and logic), where it also behaved perfectly.

The only difference is the function of the backlight...

On the original display, the "Light" line has to be pulled to ground to cause the backlight to illuminate. On this new unit, the same line, which is labelled "BL", has to be pulled up to light the backlight diodes.

Here you can see I've hooked up the "BL" line to 3v3 on the Arduino...


When supplied by 3v3, the backlight draws 20mA and the diodes light up normally. If you try to power the backlight from 5V, it drawas over 60mA and (to my mind) the lights are too bright. If you wanted to run the entire display off 5V, I'd recommend a series resistor on the BL line.

The photo above doesn't show the backlight too well, as the illumination is dominated by the camera flash. Here's another photo with the flash off, proving that the display backlight really is doing its stuff (at least as well as these displays ever are backlit)...


I've no idea if this device is any different than any other Nokia 5110 type display and where the claim for 5V compatible operation arises from.

All I KNOW is that it worked when I tested it (see photos above) and it survived at least for twelve hours when I left it on overnight. Beyond that, I've no more information.

These displays, which are marked with the claimed supply voltage range on the rear silkscreen...


are available from Kanga (and, do doubt, elsewhere) and would save a good deal of trouble in logic level conversion.

Fortunately, having already made my little interface board, I don't have to wonder if the claim that the display will survive 5V is correct - others can make the test for me!

...-.- de m0xpd

Saturday, 4 July 2015

New User Interface

Having sorted out the software to allow my "Occam's Dirk" rig to use the Nokia 5110 display, I decided to rationalize the hardware. I made a new user interface board...


This board, almost exactly the same size as the 20*4 LCD display it replaces, also accommodates the rotary encoder and pair of push buttons that allows the user to interact with the radio for tuning and navigation of the simple "menu" system. That's "job done" - because it will allow the entire shebang to be packaged up as a small system, ready for portable operation, which was my goal.

The "rotary encoder and push buttons" combo used to be provided by one of my plug-in tuning modules, so the new board is actually a combination of a quintuple version of the level converter and a tuning module

After my last post, Tony, g4wif, reminded me how many people run these "Nokia" displays directly from 5V, with either no level conversion or with simplified interfaces (such as resistors). In truth, I have no first hand knowledge of how dire the consequences of 5V operation of these displays would be (in terms of reduction of life of the device, which some writers claim). However, for the price of the level converter, I prefer to do it right.

My level converter follows my previous recipe - only this time I exploited the greater space available to use 2N7000s in TO-92 packages, rather than the original, surface-mount BS138s, as this substitution both simplified the board design and saved pennies.

Here's the schematic...


The board design is produced as as two-layer - but I always intend to implement the top (red) layer with wire links, as my "back-yard PCB fab" only produces single layer boards...


Here's the copper side of the populated board - notice I used some surface mount resistors (down at bottom right) for convenience...


The component side of the board has little of visual interest when the display is unplugged...


You can't even see that I hadn't any through-hole tactile switches in the junk box - so had to improvise with SMD devices... 

I soldered single core wire links between the holes seen on Cu side and then soldered the switches to these wires on the component side. I think I got away with it; the wheeze has worked both mechanically and electrically.

Before you run away with the impression that everything in the garden is smelling of roses, let's remember the downsides we've already confronted (the congestion in the code and in the I/O pins) and acknowledge another downside...

The new display is small - that's the point. But it also displays fewer characters than the 20*4 display it has displaced.  It can display 6 lines of 12 characters - 72 in total. On paper, that is more than a 16*4 LCD. But to make a useful, readable display, I'm using rather less than that. So this little Nokia is something of a step down in visual richness than the larger LCDs. "There ain't no such thing as free lunch", or so we are told.

To deal with this reduction in available characters, my software re-formatted the display slightly. For a start, I didn't bother displaying the Mode - as the Occam's Dirk rig is CW only. The remaining display (in normal operating format) appears as seen below...


I have moved from displaying the frequency in MHz (with attendant formatting problems associated with the decimal point) to working directly in Hz.  I'm sure this has contributed to the speed and smoothness of the display and I will think about retro-fitting this to the code for all the other Occam's Rigs, the Parallel Rig and the VFOs.

Also, the particular digit being indexed by the rotary encoder at any time - thereby controlling the tuning speed - is indicated by the cursor seen below the numeral "7" in the image above. This moves left or right when the respective buttons are pressed, according to a variable in the code called "dfindex" (explaining why I've labelled it with this name in the photo). The active digit used to be indicated by a blinking digit in the LCD - I prefer this underline "cursor" approach on the new Nokia display - it is easier on the eye. It also makes a space between the frequency and the row of information below (you couldn't usefully display much information in this row, so using it as a movable cursor helps the overall look of the display).

The rest of the screen will be familiar to anybody who has used any of the previous pieces of software. For example, the banner line showing "Occam's Dirk" in the image above is used to display the Menu structure in Menu Mode and the space between this banner line and the frequency display line is used to display variables such as RiT.

With the introduction of the new board, this really is a neat little package now - a stack of shields, a short stack of filters and the new user interface. Trouble is - as ever - it is so much fun as a working rig here on the bench that I just don't seem to be able to get round to that last step of putting it in a box!

...-.- de m0xpd