Saturday, September 21, 2024

2000 47pF Caps ...

 


An unexpectged package arrive in the mail today.  Did you ever wonder what 2000 47pF NP0 capacitors look like?  Thanks to John, AB2XT I will never run out of 47pF caps. These caps will find their way into future projects and inject a little more soul into the machine. Thanks John.

Monday, August 12, 2024

Homebrew sBitx - Fldigi

 

Homebrew sBitx - Fldigi

Now that I have the hardware tamed I'm turning my attention to some of the more itnteresting and useful features of the sBitx.  With the sBitx software running on a Raspberry Pi 4B there is plenty it is possible to run a variety of digital mode software programs right on the Raspberry Pi itself - there is no need for a separate computer. FT8 is built directly into the sBitx software so there is no need to run WSJTX, but for other digital modes including RTT, FSTK, Olivia, etc. you need to get the Linux versio of those programs and configure them to talk to the sBitx via the Hamlib interface.  

This was my first attempt at using Fldigi and I managed to make several good connections with myvfriend Don. KM4UDX.  The one pictured above was using the Olivia 16/1K mode.  Pretty impressive, but I still have more tuning up to do. While Olivia modes decode flawlessly - I was not able to receive and decode PSK, RTTY, and others.  I need to work on getting audio at the  correct level to not over-drive the SDR. 

I can turn the IF down on the sBitx.  I can also make some adjustments to the filtering in the Fldigi softwatre itself.

More to come on this one.


73 from Great Falls,

Dean 

KK4DAS


Tuesday, August 6, 2024

Homebrew sBitx - LPF Leak Stopped!



Quick update - I have resolved the problem with the LPF module in my homebrew sBitx.  The observed problem was that the transistors that control the relays sometimes were conducting when they were not supposed to resulting in more than one filter being switched in at a time.   The solution turned out to be adding a cap to ground at the low side of the relay coil where it connects to the transistor.  The hypothesis was that RF was being induced onto the inexpensive non-RF-rated relay coils.  I also swapped the NPN transistors for 2N7000 MOSFETS - the 3V threshold voltage guarantees that they won't turn on from minor fluctuations on the Raspberry Pi GPIO lines.   Reliable informaion on the high and low logic values for the Pi GPIO have been difficult to find.  Data sheets for the Pi 1.0 suggest logic "low" could be as high a 800 mV which could turn-on an NPN transistor, so the MOSFET seemed a safer bet.

Here is the final circuit:


 

Thanks to everyone for their suggestions and ideas.  The wisdom and entrhusiasm of the crowd really helps.


73 from Great Falls,

Dean

KK4DAS

Sunday, August 4, 2024

Homebrew sBitx - Fault Tree Analysis

 

KK4DAS sBitx Low Pass Filter Board

My friend Pete, N6QW recently mentioned the problem I was having with the low pass filter board in his excellent blog post describing the enginerring process of fault tree analysis, a systematic approach to understanding and resolving failures of complex systems.  This post will describe the observed problem with my LPF board and walk through some of the steps I am taking to resolve it.

First, some context.  The LPF board consists of four low pass filters covering the HF bands from 80 meters to 10 meters.  My board uses relay switching to select the correct filter for the band I am  operating on.  The relays are are fed +12V on transmit and each relay is switched with an NPN transistor.  The transistors are are turned on by a GPIO signal from the Raspberry Pi, there is a seperate GPIO line for each relay and only one line is "high" at a time.

Here is the typical circuit for controlling a relay from a GPIO line...

GPIO Controlled Relay Switch

In addition to the four LPF relays there is one more relay with the idential circuit that is the Tx/Rx relay which enables the +12Tx bus to provide power to the transmit chain.  I built and tested the LPF board on the bench and it was working perfectly, one relay at a time coming on, one filter at a time in theTx line, but when I put it in the rig things immediately went haywire. As soon as I would transmit on any band all of the relays would start chattering, machine gun style.   I checked-in with sBitx designer Farhan, VU2ESE and he recommended adding a .1uF cap to each contrrol line to keep RF off the control lines - I hadn't done that so I added the cap (Q2 in the schematic) and that immediately calmed things down ... mostly.

That episode focused my attention on the relays and I observed something I had seen once or twice before but not given much thought to - sometimes the Tx/Rx relay would switch spontaneously, I noticed it particulalry during rig power-up but I had attributed it mostly to the floating state of the GPIO pins during initialization.  Pete suggested the problem could be subthreshold conduction, the transistor conducting when a weak (below turn on voltage) signal is present on the GPIO lines.  I measured the GPIO lines and found that in the logic "off" state they still had about 600mV on each line. That's fine for digital logic but pretty close to turn on voltage for an NPN switch.   R1 was orignally 220 ohms and Pete suggested bumping it up to 2.2K and using a TIP switching transistor in place of the the 2N3904.  A member of our Maker's group suggested adding a pull down resistor to the base of the transistor. The Pi has internal pull-downs but the thought was and external resistor might pull the line closer to 0.  The external pull-down didn't help so I took Pete's advice and that solved the spontaneous transmit switching problem.



With the spontaneous transmit problem now resolved, and with hyper-awareness to the relays I noticed that there was a faint whirring noise coming from the relay board that occured during transmit - particulalry on FT8 or CW.  I also noticed that sometimes power output was significantly below what I expected.  The whirring noise almost sounded like a fan - but there is no fan on the board.  I hypothesized that it could be the relays fluttering.  One of the keys to solving a problem in a complex system is to to be able to discern where the problem is occuring.  To help me literally "see" if the relays were turning on when they were not supposed to I added an LED to each relay.   Here is the result:


So that was a clear indication that the transistors were conduction during Tx in the presence of strong RF.  I thought that perhaps the relatively high "off" voltage on the GPIO lines combined with the RF floating around the rig might cause the transistors to partially turn on.  Sometimes they would turn-on strong enough to switch the relays and sometimes not.  I thought that maybe if I added a voltage divider to the base of the transistor that would knock down the voltage enough to make the problem disappear.  Unfortunately, as is often the case when working on a homebrew rig, one problem leads to another and I had a side trip to solve a couple of other problems.  The main one was that the main Tx/Rx relay starting sticking in Tx.  I could tap it with a pencil to get it to shut off.  The relay was problably weakened during my early testing when it was machine gun chattering on Tx.  Here is a short video describing the next steps:


So back to fault tree analysis - what do I know now?  First the problem is related to RF and it varies with drive level.  So, per Pete's advice - lets see if its on the DC line or the control lines or just RF floating around the booard.  I disconnected the off-band GPIOS and the LEDs still blinked.  I put the relays on a separate power supply, and the LEDs still blinked.  Remembering that changing the 2N3904 to a TIP-110 has helped solve the Tx/Rx switching problem I decided to swap one of the 2N3904s for a TIP-110 on the LPF board.  That helped a lot. Here's the video demonstration of all of the above:


So here is where things stand.  I have replaced all the 2N3904s with TIP-110s and the LEDs no longner flicker on 80, 40, and 20 meters, but as frequency increases the LEDs start flickering again - and they are strongest on 10 meters.  The higher the frequency the more RFI.  If I lower the drive to about 10 watts it goes away on all bands. 

So to summarize the changes since I started.  I added RF bypass caps to the control lines.  I added a voltage divider to the base of the transistors, and increased the current limiting resistor from 220 ohms to 10K, and I swapped all the 2N3904s for TIP-110 switching transistors. Here is what the relay circuits look like now:


At this point, even though the LEDs flicker a bit on higher power and higher frequencies, I don't believe any of the relays are switching on, so if I remove the LEDs, which I only added for visibility, the problem may be "out of sight, out of mind."

I'd still like to solve the problem - because even if I can't see it, I'll still know its there.  Leave comments below if you have any suggestions.

73 from Great Falls,

Dean

KK4DAS


Wednesday, July 24, 2024

Arduino Nano as ISP programmer for ATTINY85

 


My breadboard ISP programmer started falling apart, and I would often bend the pins on the ATTINY85 plugging and unplugging repeatedly while working a project.  I took an hour this morning and soldered up a permanent programmer circuit.   There are number of good online tutorials for how to do this.  Here is one I used as a refernce:  Hao's Blog - Programming ATtiny85 with Arduino Nano  (Note: for the sBitx SWR Bridge we use a different board manager core than the one Hao demonstrates.  See my blog post KK4DAS - Amateur Radio Explorations: Homebrew sBitx - Power and SWR Meter Working for details.)  The official Arduino document for using an Arduino as a programmer is here: Arduino as ISP and Arduino Bootloaders | Arduino Documentation

This worked straight away - its great to have a soldered up board - and with the zero insertion force socket - no more bent pins.

73 from Great Falls

Dean

KK4DAS





Sunday, July 21, 2024

Homebrew sBitx - Power and SWR Meter Working

 

KK4DAS sBitx Screen in Tx PWR and SWR Meter

Victory is at hand.  In my previous post I described the Tale of Woe regarding the power and swr meter sensor

As I have suspected for a while the problem turned out to be the some combination of the Arduino board and the Wire library.  Rafael Diniz, from the groups.io BITX20 forum suggested I load the ATTinyCore from Spence Konde which I did, but the problem remained - always -1 returned for FWD and REF power.  Perusing the Arduino support forum I was pointed to an alternative to the Wire library called TinyWire.  I loaded that and changed all the references from Wire to TinyWire and that worked.  Here are the details.
 
1. IDE: Arduino IDE 2.3.2
2. Board Manager: ATtinyCore by Spence Konde, GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 (NOTE - because of SSL certificate errors it doesn't currently load using the Arduino IDE board manager.  I had to search for a procedure to manually install it.)
3. Board Selected:  ATtinyCore -> ATtiny25/45/85 (No Bootloader)
4. Chip Selected:  ATtiny85
5. Programmer: Arduino as ISP  (I built a programmer using a spare Arduino Nano)
6. Install the the TinyWire library: GitHub - lucullusTheOnly/TinyWire: Composite Master and Slave I2C library for Atmels ATTiny microcontrollers
7. In swr_bridge.ino change all referencs to Wire to TinyWire and change:  

TinyWire.write(message, 4);

to

TinyWire.send(message, 4);
 
Compile, upload and be happy for the rest of the afternoon.
 
I can't explain why ATtinyCore and Wire worked for Rafael.  I never did learn what the original build environment for the SWR bridge was.  The comments in the code refer to DIYTiny - I searched and found that one - it didn't work for me either.
 
The Arduino ecosystem is terrific - unfortunately thre are so many people contributing board managers and libraries - some are great quality - some are marginal - but there is no authoritative place to go to find what works.

Now, finally on to final calibration and packaging!
 
73 from Great Falls,
 
Dean
KK4DAS

Friday, July 19, 2024

Homebrew sBitx - RTC and Power Meter - ATTINY85 Tale of Woe

 

sBitx RTC and SWR/PWR Meter

I'm getting down to the end of the sBitx build.  The last two functional modules are the RTC and the SWR/PWR meter.  Both are attached to the sBitx bitbang I2C bus.  What is a bitbang bus and why are we using it?

In Farhan, VU2ESE's original build of the sBitx he found that the WM8731 codec chip and the SI5351 clock generator did not play well with each other on the same I2C bus.  (I2C is a ubiquitous communications bus for microcontrollers and peripherals - its how the Raspberry Pi controls thes other modules in the sBitx).  Farhan decided to implement a second I2C bus using alternate GPIO pins on the Pi - and for that he needed a software implementaion of the I2C protrocol - that is the I2C bitbang.  He left the codec on the dedicated hardware bus and put the SI5351 and later the Real Time Clock and SWR/PWR meter modules on the bitbang bus.

The RTC is an Adafruit module that is a battery backed up clock for the Pi.  So if you take your RTC-enabled sBitx to the field with no internet you can be confident that the time will still be correct and your FT8 QSOs will work.  The SWR/PWR meter consists of a Stockton Bridge directional coupler and an ATTINY85 microcontroller to sample the forward and reflected power from the bridge and send it on the the Pi for processing. 

The picture at the top of the post is the board with the RTC and ATTINY95 sitting next to the directional coupler - just prior to wiring it all up.   The RTC meter worked perfectly on first power up  -so far, so good.  

Here is how the PWR and SWR meter sampling works.  On transmit, the main sbitx program running on the Pi sends an I2C command to the ATTINY85 telling it to sample the forward and reflected power pads on the coupler and send the results back to the Pi.  The ADC on the ATTINY85 should return values from 0-1023 which linearly represent 0 - 3.3V DC.  

TALE OF WOE BEGINS HERE

Directional Coupler - PWR/SWR Bridge 

ATTINY85 PWR/
SWR Sensor


To test, I put the sBitx in CW mode at max power on 40 meters which should be approximately 20 watts into a dummy load so the SWR should be 1:1.   I keyed down and the power meter on the sBitx read 0 and the SWR read 1:1.  Not good.  I also had an external analog power meter in the circuit and it dutifully swung up to 20 watts.  So power out is ok, but the sBitx power sensor is not working.

First question was - is the directional coupler working?   The Stockton bridge samples the forward and reflected power and rectifies to a DC voltage from 0 to about 3 volts.  I put a DC power meter on the FWD pad and keyed down - the result was 1.5V DC.  Check!  For good measure the REF pad measured about 120 millivolts - so pretty close to 1:1 as expected.

Next I add print statements to the sBitx code to print out the values received from the ATTINY85.  This would tell  me two things.  First - was the ATTINY85 sending back anything - and what was it sending back.  I keyed down while observing the console window - yes the ATTINY85 was sending back data on transmit, but instead of being 0-1023 the value was always -1 (all 1s binary).  

Next question - is the problem in the ATTINY85 ADC or the I2C exchange.  So to do that I made changes to the code in the ATTINY85 to send hard-coded values.  That takes the ADC out of the equation.

On receipt of a an I2C command from the Pi an interrupt fires and the ATTINY85 samples the FWD and REF pads of the coupler and sends the data back to the Pi.  The code is brief enough that I can include the whole sketch right here:  

#include <Wire.h>

int16_t fwd, ref;
byte message[4];

// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
  fwd = analogRead(A2);
  ref = analogRead(A3);

  message[0] = fwd & 0xff;
  message[1] = fwd >> 8;
  message[2] = ref & 0xff;
  message[3] = ref >> 8;
  Wire.write(message, 4); // 4 bytes message with fwd and ref
}

void setup() {
  Wire.begin(8);                // join i2c bus with address #8
  Wire.onRequest(requestEvent); // register event
}

void loop() {
}

So for my next test I hard-coded vfw and vref, programmed a new ATTINY85 and tried again.  No change - still receiving only -1.

Next step - is the problem on the ATTINY85 side or the Raspberry Pi side.  To figure this out I wanted to look at the I2C packets as they traversed the bus.  Fortuitously my Rigol Oscillocpe will decode digital signals including I2C.  I hooked probe channel one up to the Clock line (SCL) and channel two up to the Data line (SDA) and after some fiddling and a couple of Youtube videos I managed to capture a single message going from the ATTINY85 to the Pi.

I2C Decode on Rigol DS1202 Scope

Just an aside. This is super cool! I can see the whole protocol, the ones and zeros and acks and nacks. And the Rigol even decodes it for me.  Its such a pleasure to work with good test tools - and at such reasonable prices.  Just a few years ago protocol analyzers ran into the thousands of dollars. Moderns digital scopes and tools like the NanoVNA and TinySA open up a whole new world to homebrew radio enthusiasts.

So hardware probe results confirm the software testg - the ATTINY85 is sending back on all 1s is the data frame.  

So that is where the tale of woe stops at the point. I am certain at this time that this is a software problem in one of the ATTINY85 Ardunio libraries,  I've done some internet sleuthing and found that others have had this identical problem going back almost 10 years.   I suspect the issue is with either the board manager I loaded for the ATTINY85 or a bad version of the WIRE (I2C) protocol code for the ATTINY85.  Like much in the open-source Arduino world there are several competing libraries with either identical or very nearly identical names and there is rarely a definitive version. There are multiple board definitions for the ATTINY85 and multiple versions of the WIRE protocol.  Its not clear which one Farhan used in the original build (he's checking), but I am pretty sure I have the wrong one.  

Away from the bench for a few days - but in the meantime if you have any suggestions, leave them in the comments below.

73 from St. Michaels, MD on the Eastern Shore of the Chesapeake Bay,
Dean
KK4DAS

St. Michaels Harbor


Wednesday, July 10, 2024

Homebrew sBitx on 64 bit and Subthreshold Conduction Resolved


KK4DAS sBitx on 64 bit build by W9JES

The homebrew sBitx is now on the 64 bit version of the OS and software. Thanks to W9JES, JJ and team for their work on this upgrade to the factory sBitx Raspberry Pi image and sofware distribution. JJ and team have made some significant upgrades to the core - most important bringing it to the lates stable 64 bit release of the OS. In addition JJ has developed a suite fo add on applications that provide additional functionality. When I first booted it up I was not able to decode FT8 sigals in teh native sBitx app. JJ worked with me and we found that since I did not have a RTC clock installed the new version of the app was not using the correct time - and for the WSJT protocol to work the time must be in sync wiht UTC. He made the fix so the software will fall back to NTP if no RTC is installed and I am back in business! Thanks JJ.

While I was testing the 64 bit build the rig begain to exhibit another RFI gremlin - the Tx/Rx relay would begin to click randomly - sometimes one click at a time and other times it became a real chatter - annoying enough that I temporarily disconnected the connection from the Pi to the relay so I could get on with testing. I thought it was RFI from the Pi -- maybe related to the Pi's wifi - it seemed to get better when I turned off wifi. My build of the sBitx puts the rig in to Tx by putting a signal on a GPIO line that goes through a dropping resisitor to the base of an NPN transistor that turns on the relay. I suspected RFI was getting into the GPIO line. I put the scope at the base on it and I could see the voltage spikes that were triggering the relay. I put a .1 cap to ground where the line connects to resistor. That didn't help. I put ferrite beads on the line. That didn't help. I switche from a single piece of stranded wire to shielded coax. That didn't help. So I did what I often do when stuck on a thorny circuit problem, I asked my friend Pete, N6QW. Once again the Wizard of Newbury Park diagnosed my problem fromm across the country.

Here is Pete's response in its entirety:

"It may be a case of subthreshold conduction (a leaky transistor), 

I would do the following. 

Use a 2.2K versus a 220 Ohm. Get some small ferrite beads and slip those over the base lead and change out the 2N3904 transistor to a TIP31C.

Your narrative indicates it is a recent problem and you didn’t see spiking on the GPIO. The signs suggest a leaky transistor (or not). But the above steps are positive and should be done as good practice.

Leaky transistors are not limited to digital electronics and in fact this problem is in the analog hardware."

I didn't have a TIP31C in the drawer and since it was working previously I replaced the no-brand 2N3904 with a new known-good one from my MOUSER hoard, I changed the resistor value per Pete's advice and left the ferrite beads on the signal line.

Bob is my uncle!  No more chattery relay.  Key point above - this is an analog circuit problem that likely had little or nothing to do with the digital circuit - subthreshold conduction just means the transistror turns on when it is not supposed to.

Thanks Pete!

Here is Pete's blog post explaining in detail:

July 10, 2024. Subthreshold Conduction (n6qw.blogspot.com)

Next steps - install the RTC module and the directional coupler for the SWR and power meter 73 from Great Falls
Dean
KK4DAs

Sunday, July 7, 2024

Homebrew to Homebrew with KA4KXX - sBitx to Bitx

 


Walter, KA4KXX and I had an extended QSO yesterday from my QTH in Virginia to his in Florida.  And the most remarkable thing is we were both working homebrew version of  BITX rigs.  I was using my homebrew sBitx and Walter was using his most recent 20 meter SSB and CW rig. 

Here are pictures of the two rigs as used on the air!

KA4KXX 20 M SSB CW BITX STYLE


KK4DAS sBitx

Thanks Walter for the fun QSO.  A rare pleasure talking with another homebrewer - particularly one who isn't afraid to let his geat go al-fresco!

In other big hombrew sBitx news I completed a clean sweep of the 13 Colonies special event last night - all on SSB working from my garage workshop location wiht my 80M off center fed dipole.  I managed to bag the elusive K2K, New Hampshire last night after many tries over many days.  So once again the colonies are united and ready to win the war!  Fun fact - New Hampshire was the 9th state to ratify the US Constitution making it the official law of the land.  So why then were they so reluctant to close the deal with me?  

Still waiting for 10 meters to open again so I can check out the peformance on the high bands.

73 from Great Falls,

Dean

KK4DAS

Saturday, June 29, 2024

Homebrew sBitx Walkthrough

 

Here is a video walkthrough and quick homebrew sBitx update.  I've intergrated the PA into the rig and calibrated the Tx levels.  I am very pleased to get 20 clean watts CW out on all bands from 80-10.  All modes are working well.  Final calibration meant deriving all my own band settings and updating the sBitx hardware configuration file hw_settings.ini.  Since my analog build is unique I had to start from scratch with the configuration.  I tested transmit on each band through the LPF and check the signal quality and strengthh on the scope.

When I first installed the PA it worked great on 80 and 40 but on the higher bands the relays were chattering and buzzing.   I added .1uF caps to the DC lines and that fixed the problem on all bands except 10 meters.  Farhan suggested adding bypass caps to the GPIO lines that drive the transistors that control the relays.  As N2CQR says - "Bob was my uncle!"  That fixed it.  

The radio sounds great and I have been getting good audio reports.   Had a QSO yesterday with PV8AL,Helio in Brazil on 17 meters SSB.  I got a 5:7 signal report plus good audio.  If you've ever worked Helio you know you can sometimes here a rooster crowing in the background.  Not so this time.

Its scary - I'm running out of bugs and problems.  I better be careful what I wish for.

73,

Dean

KK4DAS

Monday, June 24, 2024

Homebrew sBitx 20 Watt Power Amplifier

 

20 RD15HVF1 HF Power Amplifier

Between Field Day and other volunteer activities this past weekend I managed to complete a build of a 20 watt RD15 amplifier for the hombrew sBitx transceiver.  I spent the last week or two studying these amps and looking at various implementations. I had previously built EI9GQ, Eamon Skeleton's amp from his book  "Building A Transceiver which I documented earlier.   That build was copied directly from his schematic and I didn't give much thought to the design.  

Push-pull MOSFET RF amplifiers pretty much all share a common architecture.  The transitors are configured as common source amplifiers and biased for class AB.  The differences are in how the input an output transformers are configured and how the bias circiut is designed. Compared the the EI9GQ amplifier I simplified the input and output transformers and tripled the value of the feedback resistor to get more gain.  I  also learned that adding a cap across the drain side of the output transformer will flattend the gain curve and increase gain at higher frequencies. Using cut and try I ended up at 330 pF which results in flat gain from 3 MHz to 21MHz and about 3db more gain at 28 MHz.  This was a very satisfying build experience. Essentially everything worked as expected almost right off. 




73 from Great Falls

Dean

KK4DAS

Thursday, March 14, 2024

Homebrew SBITX - Tx Modules PA, LPF and Mic

Much progress since the last post. After resolving my ground-bounce and hallucinations with wisdom, I moved on to the transmitter which consisted of a 5 watt power amplifier, straight from the UBITX 40 module.  Thanks to Bill, N2CQR for the recommendation and his excellent Manhattan layout.




The three stage PA starts with a 2n3904 pre-driver followed by a 2N2219A driver with a heatsink cap and the fnal is an RD0HHF1 biased at around 6.5V - which puts it squarely in class A.  Bill's build and other bias more for class AB which I may experiment with later.

Next I needed a microphone and microphone amplifier.  I built the microphone amplifier straight from the SBITX schematic and built a homebrew electret mic.



The homebrew electret capsule in a 3D printed case  The PTT is a SPDT microswitch.  When I first hooked it up the mic did not seem very sensitive - almost had to shout to see output on the scope. A little googling and noodling and I figured it out.   In brief - when I finalized the mic amp build I mistakenly powered it from the 5V rail instead of the 12V rail, that accounted for most of the low output. By then I had read through the long groups.io thread from last year on electret bias and the recent thread on SSB audio quality and had ordered a ag of the -25dB capsules that Gordon recommended.  They accept VCC of 2-10 V through a 2.2K resistor.  So replaced the R21 10K biase resistor with 2.2K to the 5V rail.  With that setup the mic is working great.

With the mic amp and PA done I began work on the LPF module. The module consists of 4 filters covering the 80 meter to 10 meter bands.  In the original SBITX it is a diode switched module. I spent some time understanding the diode switching but decided instead to use relays - it takes away a lot of the complexity of the module.



Next lesson learned: when I first built the LPF board I had the relays only on the input and had tied all of the outputs together.  This created all kinds of problems with the filters interferring with each other even with their input switched out of the circuit.  Solution and best practice is to switch both the inputs and outputs and ground the unselected filters.  Problem solved.  But not out of the woods - still too much loss in the filter module.  I put that asisde for now and moved on to fixing the frequency alignment. 

I had previously tried to align the frequency (so that the displayed frequency matches the actual Tx or Rx freqency without success.  The alignment is done by creating a compensation offset for the 25MHz clock of the SI5351.   Its usually straight forward. Inject a known 10MHz signal into the receiver, zero beat and note the frequency display.  The delta between 10MHz and the frequency display can be used to derive the actual crystal value.  Pop that into the code and the the transceiver should be aligned.  The problem was it was aligned at 10MHz but off at 5 and 20.   After much testing and head scratching and with an assist from Farhan himself we discovered the problem was that the MIKROE WM8731 prototype board uses a different clock rate than the Linux driver in the Raspberry Pi.  In brief, the driver expects the codec to use the standard USB clock rate of 12MHz but the MIKROE board uses the more standard audio processing frequency of 12.288MHz.   The fix is to replace the 12.288MHz crystal on the MIKROE board wiht a 12MHz crystal.  Like so:



The surface mount crystal did not come off the board cleanly - in fact it lifed one of the tracks clean off the board.  So I put in a field expedient patch - the red enamled wired to replace the damaged trace.  To my delight it worked straight away.  I used blue painters tape to mask off the adjacent pins and that made the sodering to the chip much easier.

The results is very satisfying -  here is the first loggable QSO I had after completing the rig:



I'm very pleased with the way the rig is working.  I have a few kinks to iron out but we are appoaching the finish line.

73 from Geat Falls
Dean, KK4DAS



Sunday, February 11, 2024

Homebrew SBITX Receiver - Ground Bounce, Hallucinations and Wisdom

 


After a long hiatus I am back at the blog.  I have a number of projects that I have been working on that I will share going forward, but today I want to talk about my latest project - a homebrew version of the SBITX transceiver designed by Ashhar Farhan.  The SBITX is a hybrid analogue superhet transceiver / software defined radio.   The analogue portion of my build is based on the Furlough 40 / SimpleSSB that I built in 2020.  The SDR software runs on a Raspberry Pi 3 or 4 with software written by Farhan.    I'll explain the title of the post before we are done today but first lets take a look at the KK4DAS SBITX.

Here is a demonstration made shortly after I completed the receiver:




For a quick overview of how it works, lets look at the block diagram.





Beginning with the antenna on the upper right let's follow the received signal path.  First we pass through a single 30 MHz low pass filter which passes the entire HF band.  We amplify the incoming signal with a broad band RF amplifier and then pass it through and ADE-1 mixer to mix the signal up the the 40MHz IF.  The LO and BFO clocks are provided by an SI-5351 PLL controlled by the Raspberry Pi.  The homebrew 40MHz crystal ladder filter is 25KHz wide which controls how much of the spectrum you can see on the waterfall display at any one time. The bidirectional IF board I am using is the first board I built for the SimpleSSB at the beginning of 2020.  I have replaced the 9MHz commercial filter with my homebrew 40MHz filter.  The second mixer then drops the signal to a 24Khz IF which is well within the range of the ADC in the codec board. From the second mixer we go through a low noise amplifier to boost the signal and pass it in to  the left line-input channel of the codec. The 24KHz signal is digitized in the codec and passed on to the Raspberry Pi where further signal conditioning and filtering occurs, the waterfall display is generated and the digital audio is extracted.  The digital audio is sent back to the codec where the digital to analog conversion occurs and the analog signal is sent out the left line output to headphones or to an amplified speaker.   The SBITX software also supports FT8, RTTY and CW decoding natively - no additional software or computer is needed.  For a detailed description of the SBITX you should read Farhan's SBITX description linked above.  Transmit will work much the same but in reverse.  I'll cover that when I get the transmitter implemented.

I'm very happy with how the receiver is performing. Its fun to listen to and sounds great.  But getting to this point has not been without a few stumbles and sidetracks.  I was honored to be included as a guest on the SolderSmoke Podcast Episode #250 with N2CQR, Bill Meara and N6QW, Pete Juliano where I shared my tales of woe - a few of which I will describe here in more detail and a others which I will save for another day. 

Ground Bounce - shortly after completing the receiver I made the unsettling discovery that signals that were being transmitted on 20 meters were being received on 20 meters but also at exactly half the frequency on 40 meters. This was not good - it seemed that it had to be strange mixing products in the first mixer, but I had tested the entire IF before hooking it up to the digital board - and this very same IF board was pulled from a working receiver. I looked at the output of both mixers and I couldn't see how the the 20 meter signal was leaking in on 40.  After thinking about it for a bit I decided to look at the SI5351 outputs on my TinySA Ultra spectrum analyzer and instead of seeing one clean signal on each of the LO and BFO clocks I saw both signals on both clocks.  This was clearly the source of my problem.  Skipping over a day or two of troubleshooting I sent a note to Farhan and he immediately identified the problem.  It was "ground bounce.  Apparently if the clock outputs are not properly grounded it causes current to rise internal the SI-5351 and signals to bleed between the clocks.   In following a separate piece of advice from Farhan on buildiing the digital board I had very carefully insured that there was one and only one ground connection in the digital board and that was directly back to the main DC input.  I had installed the SI-5351 directly onto the digital board and it shared that common ground.  But that meant that I couldn't also ground both ends of the coax shield between the SI-5351 and the mixers.  That was the cause of the ground bounce.  The solution was to remove the SI-5351 from the digital circuit and put it on the analog circuit - with the only connection between the SI-5351 and the Raspberry Pi were the two I2C control lines.  And also to ground the coax connecting the SI-5351 and the mixers at both ends.  That fixed it - the ground is no longer bouncing!

Hallucination - after curing the ground bounce I spent an evening listening to the rig enjoying the glow you get after fixing a thorny problem.  But my enjoyment was short-lived.  I noticed that from time-to-time that the waterfall display would go a little crazy,.  It appeared as if the the receive signal was being duplicated all up and down the band somewhere internal to the SBITX.   It looked like this:



The signal at the center is the received signal - all of the mirror images are false.  Those are the hallucinations.  Farhan identified that fairly quickly and let me know about a software fix in the SBITX 3.2  which led me to:

Wisdom - I don’t have a complete understanding, but the hallucinations are artifacts created during the Fast Fourier Transform of the received signal under certain circumstances.  The SBITX uses the open-source FFTW (Fastest Fourier Transform in the West) library.  There is an extension to the FFTW library called FFTW-Wisdom that is used tune the FFT algorithm the first time it is used.   The tuning  parameters are saved in what is known as an FFT “Wisdom” file .  The Wisdom file, which only has to be computed one time, contains saved information about how to optimally compute Fourier transforms of various sizes. The FFTW Wisdom File man page has more details.  That was what was implemented in SBITX V3.2 which eliminated the hallucinations.

I'm still chasing a few problems in the receiver.  Top of my list is a tuning problem. When I zero beat WWV on exactly 10 MHz, the displayed frequency on the SBITX is a few hundred Hz off of 10MHz, and when I tune to 15MHz WWV the display is off by a different amount. So, the delta between the displayed frequency and the frequency the radio is receiving changes with frequency – but not in any linear way.  I’ve tried several different ways to align the radio but have not yet been successful  The last thing I did was disconnect the analog receiver entirely from the SDR and used a signal generator to put a fixed 24KHz signal into the audio codec which should result in a signal displayed dead center on the waterfall – but it did not – it is a few hundred Hz off.  the current suspicion is that the crystal on my WM8731 protottype board is out of spec.  Farhan has offered to send me one of the codec boards he produced for the early SBITX prototype.  When that arrives, I will replace my audio codec with the one he sends.  That should resolve this last issue but it still doesn’t explain why the delta moves with HF frequency.  That’s what was puzzling me and what I was referring to on the podcast. 

That's it for now,

73 from Great Falls
Dean
KK4DAS