Wednesday, December 2, 2020

Easy Tracking Generator + for the TinysA Updated 12/04

 Well it has been a while since I did an update post for the TinySA or anything else.  It has been a combination of some computer problems that I had to correct along with the associated data recovery.  I also made a mistake and bought a FireStick for my TV.  With all the streaing channels available it is WAY TOO EASY to spend a lot of time watching some of the older movies and TV shows.  I have also been doing a little bit of another type of Home Brewing.  Just finished up the 2nd. generation batch of UJSSM, and starting on the 3rd. generation.

So, lets get back to the TinySA.  There has been quite a bit of information by way of groups.io, and several YouTube channels with coverage of the unit.  Because of these the developer has released several updates to the firmware.  These have corrected some of the problems fund in the early versions, and some added features.  Because of these updates, I have been more impressed with the TinySA.

The one thing it is missing is a tracking generator. But, since I have a NanoVNA it was not an immediate issue.  I finally decided I would build a very simple from available eBay or other outlet modules. The most basic tracking generator is just a RF source at the first IF of the SA and a mixer. The RF from this source is mixed with the LO of the SA to give you a signal that tracks the sweep frequency of the SA.  I looked around at some of the PLL modules, and planned on doing something with an Arduino.  Then I found several versions of ADF4351 modules that were complete RF generators.  There were 3 versions that differed mainly  in the type of display and controls.  I went for one that has a full graphics display touch-screen controls, instead of the ones with text only display and push-buttons.




This is a self contained unit only needing 5 volts supplied through a USB connector.  Along with fixed frequency output, it also has a sweep function.  There is also a connector that brings out the 25  MHz reference used by the PLL.  With a frequency range of 35 MHz. to 4.4 GHz. it is quite a impressive for the $35-$50 they sell for depending on the supplier. The other versions are available for around $20 to $30.

 Along with this I needed a RF Mixer.  I found a small passive DBM module using an ADE25 for around $12.  They both use SMA connectors, so it should be easy to wire-up and test. Total of around $50 for the tracking generator with nearly zero development time sounds good.

I had previously ordered a RF test board to use with the NanoVNA.  The filters included on this fixture should work well for checking the tracking generator.  Since this also comes with SMA connectors on the test cables everything should be realy easy to test.  

Now the hard part of the whole project was waiting for the parts to come in.  With the whole Covid mess parts delivery times for anything from the Far-East have been greatly increased.  Most of these have gone from 1 to 2 weeks to 5 or 6.  Although I had ordered these parts over a 2 week period they all came in with 2 days of each other.

After powering the RF generator from a 5 volt USB power pack, I connected it to the Low input cnnector and set it for 100 MHz. output.  There is a slider control for setting the output level, so I set that for around 50%.  


Looking at the signal it was on frequency, with what looks like some phase-noise. This would not be unusual for a PLL generated signal. Amplitude level is very usable, with this at 50% output, there should be plenty of drive for the ixer.

Looking at a wider sweep, you can see that the output is a square wave, with strong odd harmonics,  and there is a fairly high level of the 25MHz. reference signal showing up in the output wavefrm.

Now that I know I have output from the RF generator, it was time to connect everything up as a tracking generator.  I connected the output of the RF gen. to the LO connector on the Mixer, and the High output on the TinySA to the RF connector on the Mixer.  I connected the cables on the RF test board to the 30 MHz. Low pass filter. One of the cables went to the
IF connector on the Mixer and the other to the LO input on the TinySA.  I set the TinySA for a 100 MHz. scan, and enabled the LO output in the expert config menu.  On the RF Generator, I set the output frequency 433.9 MHz., which looked like it gave the best results.  I was very happy with the response , so I connected the 100 MHz. high pass filter on the test board.  Setting the sweep range up to 150 MHz. I also saw a very nice looking waveform.

These looked very nice, but they were fairly wideband filter responses.  I wondered what a much narrower band filter would look like.  The test board has a 6.5 MHz. notch filter that would make a very nice test of a narrower bandwidth filter.
Connecting it up, and adjusting the sweep paramaters, I was very happy to see that a narrower bandwith filter response also looked very nice.   Since I have a NanoVNA, I will probably just use that for checking filters,  but it is nice to have an option if needed.

The TinySA has a High frequency input that does not have the filtering of the Low frequency input. This is much more likley show spurs and other unwanated signals.  I wondered if I could use the sweep fnction of the RF generator to provide a signal that could  be used for checking higher frequency filter networks.  For this I setup the test bard for its 433MHz bandpass filter.  I disconnected the RF Mixer, and connected the  PBF directly between the RF generator and the TinySA High connector.  I set the RF generator to sweep about 20 MHz on each side of the 433MHz .  I set the TinySA center frequency to 433MHz. and a span of 50MHz.  Because the RF generator sweep is not tracking the TinySA sweep, I turned on max hold in the display calc menu.  Then let everything run for a couple minutes.

It isn't very pretty, but it did plot the response of the filter.  Since this looks like it is a SAW filter with no impedance matching, the respnse could be fairly accurate.  I have to connect to the NanoVNA and compare some time.

Another thing I had seen in a YouTube video was using a RF gen and mixer to extend the frequency range of an SA.  Since the Mixer mdule I have should be good to 2.5GHz. and the RF generator will go even higher, I want to see if I can look at the WIFI signals in the house.  I connected the RF generator output to the Mixer LO and the Mixer IF output to the TinySA Low input.  I connected the small whip antenna that came with the TinySA to the Mixer RF connector. The  2.4 Gig WIFI frequency range is around 2410 to 2480 MHz, so I set the TinySA for a sweep of 1 to 100 MHz.  I then set the RF generator to 2400MHz. fixed frequency.  I also set the TinySA display to max hold.  I played a short YouTube video on my computer to make sure I had WIFI activity from my computer to monitor.  After a couple minutes I saw the presence of the WIFI signal on the TinySA.  Checking the frequency, I can see it coresponds to the WIFI channel I have my network configured for.

It looks like using the mixer and RF generator it is fairly easy to extend the range of the TinySA if needed. There is a fair amunt of attenuation through this passive DBM, so I might try using one of the small LNA modules to see if I can improve the sensitivity at these higher frequencies. 

I am very happy with the results I have seen so far.  I will probably design and 3D print a little case for the RF generator, and possibly add some mounting for the mixer on the case.  This and some shorter cables would make it easier to use.  I had thought about making some connecting couplers, but after using it I think I like the versatility I get with just using connecting cables.



Update 12/04

I designed and  3D printed a simple case for the RF generator, and added a raiser on the back to mount the Mixer.  It is high enough to allow easy connection of the SMA connectors.

Here is a shot of it assembled and the cables connected for use as a tracking generator.  The cables I have are a little long, so I coiled the LO cable just to make it neater. 


And finallly a picture of it connected to the TinySA, ready for use.   I cropped the picture, so you can't see the small coax cable that would go to the DUT.
It makes a nice small configuration when used as a tracking generator, or to expand the range of the TinySA.  Now I guess I will have to design a small box to house the units when not in use.

For best dynamic range I should probably put an attenuator in the LO line to provide the correct LO drive level.   I can put my step attenuator on the IF port so I can adjust the output level.  If needed I might make a Low Pass filter for the output.  Since I have a NanoVNA for filter alignment and testing this is mostly an experiment.  I think I will probably use it more to extend the frequency range of the tinySA

I have a couple other little add-ons for the TinySA that I hope to finish shortly.  That is depending on how long it takes for the parts to get here.






Sunday, August 16, 2020

A little about the TinySA

I have received several questions about the  TinySA. So, just a little history and overview of the hardware of the TinySA before I get into the settings and actual use.  


TinySA Main Menu




After I joined  Home Brew Test Equipment in Groups.io, I became interested in a series of posts by Erik Kaashoek detailing a SpectrumAnayzer he was building using mostly small modules that are available on E-Bay. The original version covered up to around 2GHz.  One of the hardest parts of this build was a simple to construct 1st IF filter.  Erik then came up with a simpler design that would cover up to a couple hundred Megahertz, using inexpensive, readly available parts.  It is based on a couple SI4432 wireless transceiver modules.  

https://www.silabs.com/documents/public/data-sheets/Si4430-31-32.pdf

These are basically a complete SDR transceiver in an about 1 cm. square IC, and cover a frequency range of 240 to 960 Mhz. They are designed for digital data transmission in applications such as remote time pressure monitors, therefore very inexpensive.  There are several different modules, with support circuitry available for well under $5.  The other thing that simplifies the design, is using a 433 MHz. 1st. IF, where Erik could use readily available 433 MHz SAW filters to obtain required selectivity. I had attempted to copy portions of the design, but without much experience or equipment suitable for use above the HF range, I ran into several problems.  I decided to just wait and see what  others finally came up with.  And, I am really glad that I did.  When I saw the unit was prduced by Hugen, I jumped at the first production run.  Hugen has done a fantastic job with his several versions of the NanoVNA, and I am very satisfied with the units I have from him.

The easiest way to describe a Spectrum Analyzer is a wide band receiver with a visual diaplay of signal strength over a selected frequency range.  In most simpler designs, they use a 1st. IF higher than the range of the instruent to reduce problems with images.  In the case of the TinySA this is 433MHz.  The primary frequency response of the TinySA is .1 to 350MHz.  It also has an additional range of 240 to 960 Mhz. , but with several major limitations.  Here is a block diagram of the basic TinySA RF stages. In the description of operation, I am going to indicate  menu selections by using the format [MENU ITEM] .

For the default SA  [LOW input] mode the signal comes in the LOW connector and goes through a low pass filter and variable attenuator to a mixer.  The first SI-4432 is now configured as a transmitter and produces the correct local oscillator signal to produce the desired 433 MHz. IF. This signal to go to the band pass filter.  The second SI-4432 is configured as a receiver tuned to 433 MHz.  Its internal DSP can be configured to different bandwiths from around 2.6 kHz. to over 600 kHz. , this can be set through the Resolution Band Width [ RBW ] menu.  In receiver mode the SI-4432 also produces a Receiver Signal Strength Indicator value (RSSI) whcih is read by the microcontroller. This is converted to the proper value depending on the unit type selected and displayed.  The LO signal is also brought out to the HIGH connector for use with an external tracking generator.

Another mode is [HIGH input] , where the first SI-4432 is set to receiver mode and tuned across the selected frequency range.  This  can cover from 240 to 960 MHz.  Since this goes directly into the through the HIGH connector SI-4432, there is no filtering or attenuation.  This can lead to images and other unwanted signals showing up in the display.

The unit can also be used as a signal generator. In the [LOW output] mode the unit has a frequency range of .1 to 350 MHz. The signal goes through the low pass filter and out the LOW connector.  Using several different menu items, you can set frequency [FREQ], [SPAN] and [SWEEP TIME], adjust the output [LEVEL] from -76 to -6 dBm.  You can also select several types of [MODULATION],   [AM 1K],[ AM 10K], [NBFM], [WBFM]. You can get a 240 to 960 MHz. signal out the HIGH connector when in the[HIGH output] mode, but there is no filtering of the signal, so it is rich in harmonics.  The options are similar but[LEVEL] can  be set  from -38 to +13 dBm, and there is no AM modulation available.

There is also a [CAL output] mode that brings a calibration square wave selective in steps from 1 to 30 MHz. out to the HIGH connector.  This signal is used fr the self test mode.

There are quite a few menu options available, and I will not go through all of them.  I want to hit on some that I found to be useful or intersting.  More information on the menu tree and other information  can be found at  https://tinysa.org

The menu structure is very similar to that of the NanoVNA, you can use the selection wheel. push button or the touch screen for most functions.  I prefer the touch screen for most things, but find the selection wheel seems to work a little easier for oving markers around.

One of handiest things I found are the presets, You can store up to 4 custom preset frequency ranges, then select the desired from a menu.  There is also the default full range to choose from.  Unfortunatly they are only listed as 1 through 4, can't do a custom label, but I guess you can't have everything.

Frequency [FREQ]  selection can be set by either setting a [START] and [STOP], or [CENTER] and [ SPAN].  Either one works, and it dependson on what you are doing for the best method to use. All of them bring up a on-screen display similar to a calculator, which makes it very easy to make the desired setting. Under the [FREQ] menu you can also set the [RBW] for the measurement.  There is also an option for [ZERO SPAN] which sets it to a single frequency and the unit functions somewhat like a Frequency Selective Voltmeter. 

There is also an option for [SPUR REMOVAL].  Since the PLLs in the SI-4432s  and mixer products can generate spurs. Multiple readings are taken with the IF and or LO frequencies moved around and combined to help remove them.  This will also increase the sweep time.


Well, I think that is enough for now.  I will continue next time with some of the options available for display of the data.





Tuesday, August 4, 2020

The New Toy is here


Well the new toy arrived today, and I have spent the last several hours just playing with it.  It came a fairly well packaged box within a box, with a layer of bubble wrap. I tried to get some pictures, but was having some problems with the camera, so going to use a couple from a post by Herb on the TinySA .IO group.  Overall packaging looks great with a custom printed box , and a molded holder for all the components inside.  This is much nicer than I have seen for most products of any type in this price range


After charging the battery, I ran the Touch screen calibration and the self-test. This self-test has you connect the included SMA cable between the High and Low connector. It uses an internally generated signal for inital testing. Several values can be calibrated later through dedicated menu items. I was able to get a picture of the self-test screen part way through the process.



After the self test, I connected the TinySA to my computer, running the TinySA.exe program.  This allowed my to take screen captures of the display, instead of trying to get a steady picture with a hand-held camera.

First test was to use my SI5351 signal generator as the signal source.  Conecting everything up I made several screen captures at 10,30,100 Mhz., and one at 50 Mhz with the waterfall display turned on.

The output of the 5351 is a square wave, so you can see the high harmonic content of the signal.  With the odd harmonics are much stronger than the even.  Power level is just about what I measured with my home-brew AD8307 power meter.  Any differency in frequency readout are due to the fact that my signal generator is not calibrated, and the step size of the TinySA.  In the stand alone mode the maximum number of steps is only 296.

Well I guess that is enough for now, so I can get back to playing with the new toy.  Just with the little while I have played with the TinySA, I can say that I am impressed with it.  The UI is very nice, but it will take a while to become really familiar with the menu structure and all the settings available.  

It does not have a tracking generator, but you can use the Low out put as a signal generator in the .1 to 350Mhz range.  When used in the SA mode this output is 433 MHz above the test frequency.  So with a 433 MHz signal source and a mixer it should not bee too difficult to make a tracking generator for the system.

Now to get back to playing.

0805 update
Just a quick update on what I  found when going through the menu options.  Since I had been looking at harmonics, under the Measure menu there is an option for Harmonics.  It allows you to enter the fundamental frequency, then it computes the start and stop frequencies to cover the fundamental and the first three harmonics.  After the sweep it marks and displays the fundamental frequency and amplitude, and the 3 harmonic values shown as dBc relative to the fundamental.


So. Back to playing and lets see what other things I can find.










Saturday, July 25, 2020

Impatiently waiting for a new toy

If you have been following my blog for a while, you know that I have made several starts on a simple Spectrum Analyzer.  In most cases, as I progressed in the project I came to the point where I needed to build some other project.  Little things, like when I needed to test a band-pass filter, I needed to build a SNA first.  Then I found I would probably need something with a higher frequency response  for working on a SA with the frequency range I wanted.

Over a year ago I found some information on a very small VNA for around $60.  Since this NanoVNA was  less than 1/10 the price of any other VNA with a built in display, I jumped at it.  It gave me an instrument that had the frequency response I would need to work on a SA.  

There was an IO group formed to support the little VNA.
Following that group I found another group about Home Brew Test Equipment.  One of the ongoing projects in that group was a Tiny SA. Several different versions of that were being developed and it looked very promising. Around the first of the year a TinySA group was started for several people who were testing a future commercial version of the TinySA.  Some of the info on this group looked very interesting, especially a short video on the nearly finished product.

http://tinysa.org/video/intro.mp4  Also a lot of information and specifications at  
https://tinysa.org/wiki/pmwiki.php?n=Main.HomePage

Just the other day I saw a post on the TinySA group, that the product was available for order.  The TinySa is being produced by the same person who originally produced the NanoVNA.  With that as a recommendation I quickly placed my order, since I understand there is only an initial production run of 300 being made.


https://www.alibaba.com/product-detail/Hand-held-tiny-Spectrum-analyzer-TinySA_1600085564565.html

The availability of a less than $100  SA with a range of 100kHz to 350MHz  (240- 950 MHz. without bandpass filter )will make the life of the home-builder a lot more fun if not easier.

Now all I have to do is wait #@*& !






Monday, June 15, 2020

VFO-BFO with ESP32

I made a circuit  board layout for the ESP 32 based VFO-BFO using the Wemos ESP 32 Mini controller module.  Sent Gerber files off to China and had 10 made up, they arrived in a little over a week with Express shipping. I built one up and found a few minotr errors I had made in some dimensions, but the boards still worked fine.  I decided I would use this with a Bitx 40 board I have laying around.  I think I will use Pete N6QWs method for doing Upper and Lower sideband selection.  That means adding or subtracting the desired frequency from the IF frequency . For the Bitx 40 that means setting the SI5351 frequency to 5 or 19 MHz range depending on the sideband selected. Only tricky part is getting the exact IF frequency, of the Bitx 40.



 The board layout has provisions for a up to 7 pushbutton switches that can be read by a single analog input pin.
I chose to use a double row header so I could add individual switches as desired or a switch array connected through a single ribbon cable.   I also brought out the connections, 3.3v, and ground for use by a rotary encoder with switch.. 

The connector for the SI5351 module is mounted on the bottom, so the boards can be stacked.  Also, a female header strip can be mounted on the bottom for a 1.8" TFT display which  then can also be stacked.  I have provision for an optional 5 volt regulator so you can power the  assembly form 7-12 volts if desired, instead of directly with 5 volts


One thing I like about the Wemos module is that I only have to make connections to the inside rows of header pins.  If I need additional control pins, I can put header pins in the outside rows of connections and just plug onto them.  This means I do not have to worry about those pins in the PCB layout.

After playing around with the options this gives me,I decided to modify the layout to make the small corections in layout positions I found. 
I am also going to bring out some of the pins I had not originally used , and add a couple connectors for additional connections to the I2C and SPI signals.  This will allow me to use the same board as display-controller for several other projects I have been slowly working on.  Now just need to send this off to a board house in China, then wait.

Tuesday, May 19, 2020

An updated version of my VFO-BFO

A couple of the projects I have been working on have been put on hold because of the shipping delays caused by the Covid shutdown in many places.  Looking around for something that only required what I knew I have on hand.   I rembered seeing a YouTube video of a SI5351 based VFO with a small TFT display that very nicely simulated a mechanical dial.  Going back I found the video, and there was a link to the website of JF3HZB, the schematic , and Arduino code for the project.  It uses the same 128 x 160 TFT display I have in my VFO-BFO, and a ESP-32 dev. board.  Looking at what pins are required, the small Wemos Mini I have should work nicely.
I downloaded the software, and got  it to compile without any problem. After looking at the code, I can see where having two 240 Mhz. cores doing the processing is nearly a necesity for something like this.  And also still has plenty of  room and power to addd other features.  I quickly built a simple board to see how it looks, and works . 
After getting the basic software running for the display, I did some modifications to add a couple things I want to have on the display. a LSB/USB indicator and I will probably add a T/R indiator light of some type.  The response of the display is really nice, except for some small jumping around that is coming from the really cheap rotary encoder I used.  I have  a couple better ones that I will use after I get a board designed, now I will see if I can correct with some filtering capacitors.

I plan on using one of the Adafruit SI5351 modules I have, so will have to see what if any changes I have to make to use them with 3.3 volt logic instead of 5 volt.  I have not looked at the 5351 library used with the original  software, so do not know if I will keep it or use the same library I have used before.

Trying to think about what I want to include on the board design. All the pins required are on the inside set of pins on the Wemos module. That means I can just add some header pins to the top of the Wemos module instead of having to route them  on the board. This should allow for fairly easy expansion. 

I like the single analog pin method for monitoring multiple push buttons.  I will probably add the resistor chain and some header pins on the board to make it easy to add several push button controls.  Also thinking of having provision to add a retoary encoder directly on the board, or  a connector for adding an external encoder.
 I will get started on the board layout, then decide if I want to order some from one of the board houses.  They all offer DHL shipping, so should not have to wait too long to get them.

I tried to make a video of the board working, but couldn't find a way to keep the camera steady while operating the encoder.
So here is a link to the original YouTubevideo I watched.
https://www.youtube.com/watch?v=3PV2kLOippY


Thursday, April 16, 2020

Best thing to come from the lockdown so far.

With almost everything being shut down from the virus, there must be something good happening.  I think I have found at least one thing.  Since we can't gather together the ability to hold meetings via video conferencing has been really taking off.  

Last Saturday we held the monthly meeting of the North Georgia QRP Club via Zoom.  We had around 25 people show up. Mostly members, but also a couple guests including Hans Summers from QRPLabs checking in from Turkey.  He gave a brief history of the QCX transceiver. and informed us that they are only a couple hundred short of having sold 10,000 kits.  He also spoke a little about the multi mode, all HF band QSX that is in development.  We also heard from some of out local members, and got to see some pictures of their shack, and work bench. Except for a couple little glitches, from not being familiar with the software every thing went quitae well.  Now waiting for the next meeting.

NO this is not the FBI's Most wanted List, or is it?



Last evening I got to attend another meeting.  This one would be a little frather drive from Atlana than the NOGA meeting.  This was with the homebrew group from the Peal Amateur Radio Club located in the Greater Toronto area.   I usually only get together with some of them at FDIM, so this is a plus for me.
This meeting used a different software package, but also worked quite well. Except for also being the first time most of have used it. We had 17 people in the meeting including several that joined in via cell phone. As with the NOGA meeting there was a guest calling in.  He was Rex Harper from QRP ME, and he spoke about the 'Buildithon' project that has been scheduled at FDIM this year.  He is still working on the kits, and is planning on having a virtual Buildithon.  Also heard about the progress being made on the Direct Conversion Receiver, which is to be the club 'Buildithon' this year.

Possibly the RCMP most wanted list ?




With the aid of the video conferencing software we are still able to get together with our friends.  Of course most of us have more time to get on the air, work on projects, or start on the list of things the Wife has been wanting done 'forever'.

My last comment on the matter is something a friend said in one of his e-mails.   " I feel like a teenager again, gas is cheap, and I'm GROUNDED"




















Thursday, April 9, 2020

UHF Version of TinySA

I had started on the TinySA from Groups.io HBTE, but am still waiting on some parts that I had orderd than have yet to show up.  Looking around I found a UHF version that covers 240 to 940 MHz. This only uses a single si4432 transceiver module, which I have on hand. So I will try to do a similar UHF version of the TinySA.  Since this does not need the input LPF, mixer, and a high local oscillator, it should turn out to be a small instrument.

I have previously used a ESP32 development module, but that was quite large.  Looking around aroound I found a Wemos ESP 32 mini that looked like it would do nicely. 
It gets much of its size from having the IO pins as two rows of 2 wide headers .

  Fortunatly the SPI and I2c pins are all located on the inside rows of pins, and there are enough extra pins available for the every thing else I need.
I can also put right angle headers in the outside row of pins and connect directly to them without having to have additional connectors on the circuit board.

I had neen very happy using a joystick for the user input device, but they are a little large for what I had in mind, and also they used 3 IO pins.  I also wanted a couple extra control buttons available for the UI.  I decided to go to keypad made up of a resistor divider string with switches to ground at each intersection.  This can be read using a single ADC input.

Using surface mount components, the entire keypad can be layed out on the top side of the PCB, without taking up any extra space in he cabinet.  I designed and 3D printed a small case, and the buttons for the keypad.


The software to read the keypad is quite easy.  First you have to find out what ADC vlue is returned with no keys pressed and when each key is pressed.  These values are reduced about 10% to prevent false readings.  These values are put into an array.

The keypad function checks to see if a keyis pressed ( reading lower than none pressed value).  If it is a short delay to debounce and another reading is taken ,then simple for loop compares this to the values in the array.  The value of the last array item lower then the read value is returned to the calling program.

int readKeypad() {
  int i;
  int key;
  // analog value for each key press measured and adjusted down about 10% to prevent
  // wrong readings    0 position is no key pressed
  int key_val[] = {3500, 3200, 2900, 2600, 2200, 1700, 900, -1};
  if (analogRead(keyPadPin) > key_val[0])  // No key pressed
    return 0;                     // just return
  else
    delay(5);                   // debounce
  i = analogRead(keyPadPin);         // get pressed key reading
  for (int n = 0; n < 8; n++) { // check to see which key is pressed
    if (i <= key_val[n])         // compare against array of measured values
      key = n + 1;              // bump up so you can use simple if test for a pressed key
  }
  if (key > 7 )key = 0;           // helps to clean up clean up extended switch bounce
  return key;
  delay(25);                     // set max repeat rate

}

This works quite well, except for a little key bounce from the really cheap switches I had on hand.  I put everything in the printed case, and loaded a modified version of the menu system I had used with joystick.  

Now I need to grab some of the si4432 code from the TinySA on the HBTE group  and see if I can get it working in the receive mode, then write some sweep and display functions.

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.