Friday, February 7, 2020

SMA Torque Wrench for the NanoVNA (uncalibrated)

I have been using SMA connectors on most of my projects, and have occasionaly gotten a slightly different reading than I had expected.  Using the NanoVNA, this has shown up a little more often.  After a some checking, it appears that having the connectors  'finger tight' is not quite good enough for getting consistant readings. After watching several Youtube videos and reading soome instruction manuals on much more expensive VNAs , I decided I need some form of torque wrench to help eleviate the problem.  

Looking around I found that even the cheapest torque wrench for SMA connectors cost nearly as much if not much more than the NanoVNA.  I wondered if it would be possible to 3D print someting that would be usable.  I looked around Thingiverse.com, and found a couple examples of torque wrenches that looked easy enough to model one on for SMA connectors.   Looking as the specifications for SMA connectors, I found that they shold be tightened to 5 in. pounds of torque.  For my use it would be adequate to have it somewhere near that value as long as it was consistant.

SMA connector nuts are 8mm. across the flats, so I went 8.2mm. to make it easier to get on and off.  I also put a wide enough slot in the end of the wrench to allow it to slide over cables easily.  While I was working on the design I decided to taper the other end of the wrench so it could be used as a stylus for the touch screen.  I also added a small hole 2" from the center of the wrench opening, so you can use a small luggage scale to compute the actual torque.

I printed a couple with different printer settings and tried them out.  Just place over the connector nut and turn until the wrench slipps around to the next flat. I measured how much force I had to apply for this slip to happen. Then by adjusting the number of top and bottom layers, along with number of perimiters I got the torque to be somewhere around 4 in. pounds.  With this value I appear to be getting more consistant readings than I hade before, and have a handy stylus for the touch screen.  It also makes it easier to get the cables on and off than just using my fingers.

My settings for the print is for PLA filament.  Three perimiters (wall line count), four top and bottom layers, and 40% infill.
The .stl file is located at.  
https://www.dropbox.com/sh/qt816x30fujt3kl/AABbUj5DdeNC5n3VE0RyJD9ra?dl=0

Not sure how long these wrenches will last, but only take 15 minutes to print and use about 3 grams of filament.




Wednesday, January 29, 2020

HackRF One case

When I first started working on a Spectrum Analyzer design I needed some way to check the sweep ranges of the local oscillator, and output of stages.  Since some of these were in the 100s of MHz., my oscilloscope would not be enough, and my frequency counter could not follow the frequency when doing a sweep.   I had used one of the inexpensive RTl_SDR dongles before, and they had worked fairly well.  I recently saw an ad for a 'HackRF One' on AliExpress with a TCXO for under $70.  This unit covers from 1MHz. to 6GHz., can do 20 Million Samples per Second, and can be used as a transmitter as well as receiver.  I have seen it available bundled with a selection of antennas, accessories  and in a case for over $300.  


 Delivery time was only about two weeks. Looking at the board I was impressed with the quality. and I liked the fact that it used SMA connectors for the antenna, and oscillator in and out connectors.

The one from AliExpress was the board only, so I would need to make a case for it.  After some quick measurements, I modified one of my standard case designs to fit.  
 I decided to use a one piece design with guide slots for the circuit board.  I have found this to be very solid, and makes mounting circuit boards very easy.  I printed it using some Carbon Fiber filled filament I had on hand.  Don't think the Carbon Fiber pieces in the filament are long enough to do any shielding, but it sure looks nice.  


 Next I designed and printed a front and back for the case.  After putting it all together it makes a very nice looking unit.  A little taller than the ones I have seen with  some of the complete units, but still a very nice case that will give good protection to the board. Still in the process of trying several of the different SDR software packages that support the HackRF.  Will write up something on them a little later.

For anyone interested, I have the .stl files available at
https://www.dropbox.com/sh/gi3tbny3le8hhhx/AAAJN17G9Nq0jLIntIF3wk88a?dl=0

Meanwhile still waiting on some of the parts needed for the 'TinySA' to arrive.  I think the Chinese holiday delayed everything. 



Monday, January 20, 2020

Small update to the Step Attenuator

When I first built the step attenuator,  I wanted it to check  linearity of amplifier stages.  I only needed a relative change in the insertion loss of the attenuator.  Recntly I was able to use my NanoVNA to measure the actual insertion loss across the total frequency range I am interested in.  I also received some questions about showing the actual insertion loss instead of the relative value,

Because of this I made a change to the code to switch the display value from relative to actual by a long press of the encoder knob.


       
 First I added some definitions and variables

float InsertionLoss = 2.6;  //insertion loss of attenuator at 0 dB 
int InLossMode  = 0;       // actual insertion loss or relative
#define ActualLoss  0   // display  value selected actual +                                  //insertion loss 
#define RelLoss     1   // display just value                                                //selected without insertion loss

The code to read the button push was modified to also check for a long press if you want to change display mode to show the actual insertion loss.
  // check button for display mode and step size
  read_btn();
  if (button) {
    if (button == SHORT_PRESS ) { //  toggle step size
      if (AttenStep == 1) AttenStep = 10;
      else AttenStep = 1;
      button = 0;
    }
    else {         // toggle insertion loss display type
      if (InLossMode == ActualLoss) InLossMode = RelLoss ;
      else InLossMode = ActualLoss;
      button = 0;
    }
  }

The display routine was modified to show th display value depnding on the InLossMode variable,

  if (InLossMode == ActualLoss) {    // show actual insertion loss
    display.setTextSize(1);
    display.setCursor(20, 15);
    display.print("Actual  ");       // indicate type 
    display.setTextSize(3);
    display.setCursor(10, 30);       // clear last value
    display.print("       ");
    // update display
    display.setCursor(10, 30);
    display.print( (AttenValue + InsertionLoss), 1) ; 
  }
  else {
    display.setTextSize(1);        // show relative value
    display.setCursor(20, 15);
    display.print("Relative ");    // indicate type 
    display.setTextSize(3);
    display.setCursor(10, 30);
    display.print("       ");      // clear last value
    // update display
    display.setCursor(10, 30);
    display.print( AttenValue, 1);
  }
  // display "dB." 
  display.print( " ");
  display.setTextSize(2);
  display.setCursor(80, 38);
  display.print( " dB.");
  display.display();


Updated code is available at 
https://www.dropbox.com/sh/lwy52lqi0g0ms7g/AAChK1tqW8M4hmUUf_dutwP2a?dl=0


        

Wednesday, January 15, 2020

Starting on a Tiny Spectrum Analyzer

I have been playing with building a simple spectrum analyzer for a couple years now.  I have tried several different versions, and have ran into similar problems with all of them.  For what I want I need several different resolution bandwidth settings. For more than two band-widths  the overall complexity becomes greatly increased. I have tried several different approaches, but have not been happy with anything I tried.  I had joined the Homebrew Test Equipment group on Groups.io ( https://groups.io/g/HBTE) , when it started.  Recently there has been a series of posts on a Tiny SA that has most of the features I would like to have.  It has a interface to a PC application for control and display.  I plan on adding a TFT dispalay to make it a stand alone instrument.  I have several STM-32 'Blue Pill' modules that I purchased a year ago. I think one of them should work well for this project.

This SA uses a pair of inexpensive SI4432 wireless ISM transceiver modules.  For use in a SA the important features of the SI4432 transceier is a frequency range of 240 to 940 MHz. at up to 20dBm output, variable receive bandwidth using DSP technology, and a Receive Signal Strenth Indicator signal with  .5 dBm. resolution down to about - 120 dBm. Complete modules with all the support components needed are available for less than $5 through the normal sources.

There are two different filters in the SA that I needed to design for a circuit board.  The first is the input low pass filter.  I decided a range of up to about 200 MHz. should be more than adequate for what I need.  My favorite design tool for filters is Elsie, with it  I can quickly design various types of filters, and tune the circuit to use standard value components.

For the low pass I decided on a 7th. order capacitor input filter. Playing with the program and values I have on hand, I came up with this circuit.

 This should give a frequency response similar to this, depending on the actual components used.

I had some circuit boards made by one of the Chinese board houses and, built and tested the LPF.  I used some SMD capacitors I had on hand from an assortment I purchsed a while ago.  Using a online calculor I designed and wound some air core inductors that are close to the values needed. (http://www.circuits.dk/calculator_single_layer_aircore.htm )
   I used some 24 guage silver plated wire wound around a 3mm. screw as a form.  Four turns for the first inductor and five turns for the other two. 
 Connecting the circuit to the NanoVNA using one temporary SMA connector, and with a little reforming of the coils I was able to come up with  a filter with the following response.


I had to settle for a little bit lower cutoff frequency than the original design to reduce the passband ripple but will be fine for the frequency range I want.  It also gives me the option of using a 315 MHz. first IF frequency if I want to try instead of the 432 MHz. in the original Tiny SA.
The next filter I need to build and test is the first  IF bandpass filter,
This will use a pair of  432 MHz. SAW filters.




Tuesday, October 29, 2019

Checking Step Attenuator with NanoVNA

I decided to check the step attenuator with the NanoVNA.  It would be nice to see what the linearity of the step attenuator is across the frequency range I am interested in.  After calibrating the VNA I did a series of sweeps from 1 - 250 MHz. This uses the fundamental frequency range of the VNA, it uses harmonics for higher frequency measurements.  I first did the readings using the VNA's internal display, and then repeated with the PC based software.



With 0 dB selected the sweep showed about 2.4 to  2.6 dBinsertion loss .

The VSWR was between 1.05 and 1.1.  These values will work well for anything I plan on doing.  




I then did a series of sweeps at 10 dB incremnts on the attenuator.  The linearity is within about 1 dB throughout the range.


10dB

20 dB
30 dB
40 dB.
50 dB.
60 dB.

The linearity looks good across the entire range, within 1 dB.  With an insertion loss of around 2-3 dB in all ranges, which is more than adequate for what I need.  Trying to decide if I want to modify the attenuator firmware to show the actual attenuation or leve it as is.

The autoscale feature of thes PC software  really makes it easy to to get values across such a wide range without loosing resolution. The noise on the sweeps at higher attenuation levels, is due to the sensitivity of the VNA, but is still quite remarkable for a $50 instrument.  I am quite happy with both of these pieces of equipment.  The VNA does many of the things I wanted to do with a version 3 SNA Jr, so I will put off that project and work on several othr things I have been planning.




Wednesday, September 4, 2019

Using the NanoVNA to check an antenna

This is just quick followup to my last post on the NanoVNA.  I ordered a SNA to UHF female adapter so I could try checking an antenna.  For this I wanted to try the available PC application instead of using the small screen on the unit.
This app  is very east to use, just set the comm port and click the connect button.  Then set your frequency range and display type you want.  You then go through the calibration procedure using the short,open,and load standards provided.  You can also calibrate for through, and isolated if you are going to do something like checking filter responses.

My multi-band antenna is a G7FEK which gives me coverage on 80,40,20,and 15 without a tuner.  I figured this would be a good test of the VNA.  I did the scan with a display set to Smith chart. You can see that the impedance is near 50 ohms across the sweep.
You can move the cursor across the sweep and see frequency, impedance, resistance and reactance at that point on the chart.


By using the drop-down you can change the display to Return Loss


or SWR.
One thing I really like about this software is the ability to scale the data to the range you like, or have it auto scale for you.

Now I just need to play with it some more and try checking  filters, and see what else it can do.  Have also been following activity on the nanovna-users on groups.io and see that additional app are already being developed for it.









Thursday, July 25, 2019

Another new toy Update 8/8/19

After FDIM and spending some time visiting my daughter, I came back and thought about some of the on-going projects.  At FDIM I had a chance to spend some time talking with Farhan, discussing my latest version of SNA, and his Antuino.  While they are very similar, I decided to change my design to use his basic circuit with a few changes.  I did a board layout and now have  5 boards coming from China, on the slow boat.  

While waiting I have  been re-thinking how to buid a Spectrum Analyzer, to make it  simpler but still have the features I want.  After doing a lot of reading  blogs, web-pages and old magazine articles, it became apparent that I will have to use a 1st. IF frequency much higher than I had originally thought.  The major problem with this is that I do not have any test equipment that will work up to several hundred MHz.  

About that time I received an e-mail ad about a small hand held VNA that covers from 50 KHz. to 900 MHz.  and costs around $60.
I did some looking around and found some information on-line about the original design and some of the clones that were being built.  It is known as the NanoVNA and I found the nanovna_users  group just starting on Groups.io.  Since the first ad I had was for a pre-order, it took about 3 weeks to get my unit.  After it arrived, I was surprised with how small the unit was, even with its built in display.  My unit came without a battery, but you can run it off the supplied USB C cable supplied.  It has provisions for adding a 3.7 volt Lithium battery, and has charging circuitry built in.  I ordered an appropriate battery, and gave everything  a try.  I was happy with the way it worked as stand alone and also with the PC software that is available for the unit.  




The battery I ordered was just a little too large to fit inside the unit as designed.  But since the design basically just has a top and bottom cover with the sides open, I had already deiced  to design and print a case to completely enclose the unit.  I made the case just a little larger to provide room for the battery and added some protection on the side of the case for the small switch used to control the device along with its touch screen.


Update 8/8/19
I did some playing with the VNA, and am very happy with it.
In this picture you can see the response of a 1M coax between 50 KHz. and 900MHz.  Peaks are around 98MHz. apart. Looking at the Smith Chart  there is a range of about 53 to 48 ohm impedance peak to trough from 441 to 495 MHz.
.






Only problem I have had was because of its small size.  I ended up knocking it off my desk and cracking the display.  Everything still works, so I decided to print a protective cover for when I am not using it


I put the .stl files for the case, cover and a sun shield in the following dropbox folder

https://www.dropbox.com/sh/74g4z97ly3bz1au/AACTRkE0hDRww3M_5Uj3tkpMa?dl=0