Sunday, March 07, 2021

Microphone amplifier for signal generator external modulation input

 Needed a small microphone signal amplifier to connected to the external modulation input of the Wavetek 3001 signal generator so I can test an AM de-modulator.

Nothing fancy here, just basic electret microphone amplifier. Microphone is of the basic type sold for computers voice calls.

 The diagram/schematic:


The result:

Works OK for basic testing, maybe in the future will join a noise and dual tone generator.

Have a nice day!

Saturday, January 30, 2021

ADF4351 Signal Generator

 Not much here, just a simple signal generator based on ADF4351 module from "fleebay".

 I just needed to generate one single frequency that can go up or down in 100Khz steps via two push buttons. Added an optional LCD to display the main frequency and the third harmonic since I'm using it to verify some equipment on 10Ghz.

Test board:

On the frequency counter:

Schematic based on an Arduino Nano controler:

Spectrum output on lower frequencies (414Mhz) and output level at "0" (add 20db attenuation at the spectrum input):

and the third harmonic:

Power at "3" (second harmonic now visible)

 3rd harmonic as seen on a 10Ghz adapter for a 1.5Ghz spectrum analyzer:
(not calibrated):


 /// code start
   ADF4351 signal generator
   CT2GQV 2020

   Based on code from: ADF4351 example program

   VFO with 100Khz steps starting from a predifined frquency (UL frequencia) using 2 buttons for up and down.
   Display on 16x2 I2C LCD of the frequency set and the third harmonic value
   Also serial output of the main frequency set.

#include <Arduino.h>
#include "adf4351.h"
#include <LiquidCrystal_I2C.h>

#define SWVERSION "1.3"
#define PIN_SS 9  ///< SPI slave select pin, default value
ADF4351  vfo(PIN_SS, SPI_MODE0, 1000000UL , MSBFIRST) ;
unsigned long frequencia = 3333320000UL ; // 3.333.334 (10 Ghz n=3)
// unsigned long frequencia = 2000000000UL ; // 2.000.000 (10 Ghz n=5)
// unsigned long frequencia =    414000000UL ; //    414.000 (10.368 Ghz n=25)
// for 442Mhz use the bellow and comment the above
//   unsigned long frequencia =  442000000UL ; // 442Mhz or 1.326 Ghz , tird harmonic

// I2C LCD virtual pinout
#define I2C_ADDR    0x27  // I2C Address for my LCD, found with I2C scanner
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7
LiquidCrystal_I2C       lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);

// buttons for up/down in frequency, puleed up from 5v with a 10K resistor, analog pin will be short to ground for button press
int button1 = 1;
int button2 = 2;

void setup()
  Serial.begin(9600) ;
  Serial.print("adf4351 VFO CT2GQV "); Serial.println(SWVERSION) ;

  pinMode(button1, INPUT);
  pinMode(button2, INPUT);

  lcd.begin (16, 2, LCD_5x8DOTS); lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE); lcd.setBacklight(HIGH); // 20x4 lines display LCD
  lcd.setCursor(0, 0);  lcd.print("Signal Generator  ");
  lcd.setCursor(0, 1);  lcd.print("Ver: "); lcd.print(SWVERSION);

  Wire.begin() ;
     setup the chip (for a 10 mhz ref freq)
     most of these are defaults
  vfo.pwrlevel = 3 ; // measured at 3.3Ghz after 1m cable >> "0" = -8 dBm / "1" =  -5.8dbm / "2" = -3.3dbm / "3" = -0.4dbm
  vfo.RD2refdouble = 0 ; ///< ref doubler off
  vfo.RD1Rdiv2 = 0 ;   ///< ref divider off
  vfo.ClkDiv = 150 ;
  vfo.BandSelClock = 80 ;
  vfo.RCounter = 1 ;  ///< R counter to 1 (no division)
  vfo.ChanStep = steps[2] ;  ///< set to 10 kHz steps

     sets the reference frequency to 10 Mhz
  if ( vfo.setrf(10000000UL) ==  0 )
    Serial.println("REF.SET: 10 Mhz") ;
    Serial.println("ERROR: reference freq set error") ;
     initialize the chip
  vfo.init() ;

     enable frequency output
  vfo.enable() ;


  if ( vfo.setf(frequencia) == 0 ) {
    Serial.print("VFO.SET:") ; Serial.println(vfo.cfreq) ;
    lcd.setCursor(0, 0);  lcd.print("F   :"); lcd.print(frequencia/1000);
    lcd.setCursor(0, 1);  lcd.print("F(3):"); lcd.print((frequencia/1000)*3);
  } else {
    Serial.println("ERROR: Set init Frequency") ;

vfo.ChanStep = steps[4] ; ///< change to 100 kHz

void loop()
  int buttonState1 = analogRead(button1);
  int buttonState2 = analogRead(button2);
  // serial debug for the button for +/- frequency
  // Serial.print("B1,B2:"); Serial.print(buttonState1); Serial.print(",");  Serial.println(buttonState2);

// up frequency
  // button pin is puled down to ground...or close to it (100) as long as lower than 2049
  if (buttonState1 <= 100) {
    frequencia += vfo.ChanStep;
    if ( vfo.setf(frequencia) == 0 )
      Serial.print ("VFO.SET: "); Serial.println(vfo.cfreq) ;
      lcd.setCursor(0, 0);  lcd.print("F   :"); lcd.print(frequencia/1000);
      lcd.setCursor(0, 1);  lcd.print("F(3):"); lcd.print((frequencia/1000)*3);
// end up frequency 

// down frequency
  if (buttonState2 <= 100) {
    frequencia -= vfo.ChanStep;
    if ( vfo.setf(frequencia) == 0 )
      Serial.print ("VFO.SET: "); Serial.println(vfo.cfreq) ;
      lcd.setCursor(0, 0);  lcd.print("F   :"); lcd.print(frequencia/1000);
      lcd.setCursor(0, 1);  lcd.print("F(3):"); lcd.print((frequencia/1000)*3);
// end down frequency 

// button software debounce
/// code end

Some other signal generators based on similar modules and also the ADF4355: (for the ADF4355)


Have a nice day!

Wednesday, January 27, 2021

EIP-371 Source Locking Microwave Counter repair

 I've done a previous repair on this device because I got it without being working on the 18Ghz range. I suspect this will not be the last one given it's age.

Anyhow, one of this days I turned it on to check the output frequency of a FVC99 module and it was displaying all entrance selector LED's on (should be one at a time) and no change on the input by pressing the band selector. Also there was no activity on the display for the source locking.

I suspect the usual bad contacts (it's slot based construction) or power supply, more to the power supply side since the equipment hadn't been moved (it's a bit sensitive on moving/vibrations and that had been the cause of the first repair).

 First thing I did was removing and inserting all the boards one by one trying to find the one responsible for the selector LED's, I have the manual but didn't feel like to read it. In the end, had no luck. Then I realized there's another board that does not slide, instead is attached to the side panel. So I moved that one to the side and checked all the connections. 

 Image, now, after connecting back, started working, I can now select the input and have the digits lit:

I can measure again but I'm preparing a home made counter in case this one fails again in the future.

Have a nice day!

Sunday, January 03, 2021

Return loss bridge

 Small project made last year (4 days ago) just for fun and to try out the SWR feature of the spectrum analyzer.

Design is based on this one to the exception of the ferrite material, I used 43 instead of 77.

RF source will be the tracking generator, load will be device under test and detector the spectrum analyzer RF input.

For the 50 Ohm resistors (R1,R2,R3) I used two leaded 100 Ohm in parallel, SMD and shorter leads between components would help more on the high frequency side of the spectrum.


 Some data taken:

With no load connected in one direction and then the opposite one (cable swap), if all is perfectly balanced it should show equal lines, in this case....almost there, in any case the return loss line is all but flat...

Now measuring a 50 Ohm load, ideally should give the lowest possible result and a flat line for all the frequency range:

At 1.6Mhz: 1.22, so not very usable at the low range, probably due to lack of inductance on the core.

At 10.8 Mhz, 1.05, much more inline with and expected result (very low VSWR).

At 152 Mhz looks like it starts to break the measurement again.

And forget it at 433 Mhz since it's too off.

The load used was a Narda 370 BNM, 5W and good to 18Ghz.

Basically it's very usable on the HF range or just as general curve tracer for antenna VSWR at VHF frequency ranges.

You can also take the same info without the SWR measurement option on the Spectrum Analyzer, just use the tracking generator, normalize in the open position (no device under testing connected) and then look for the SWR from the return loss measured, you can use this table or calculate it yourself.


Have a great Year!

Tuesday, December 29, 2020

LXI - Rigol DSA815 Spectrum Analyzer - remote control

 Following on the series for "GPIB" control of instruments, this post is about LXI control, in particular the Rigol DSA815-TG spectrum analyzer. It is more Linux oriented but commands can be ported to other systems.
Did this out of need since I could not find a single explanatory source of information for all the commands listed besides the programing guide and as all programing guides, they never have a simple; "how to to this"
Most of the command are using the "lxi" tool v1.21. You can use also the gui version "lxi-gui"

LXI is nothing more than LAN extensions for instrumentation control. Same end result as GPIB or Serial port control, that is, you have a system that controls and queries the instrument, only the medium is different on this case, it uses a more modern approach, the Ethernet/LAN.

Recently acquired a Rigol DSA815-TG 1.5Ghz spectrum analyzer and although at the moment I only use computer control for taking some screenshots would be interesting to know how to take more advantage of instrument remote control.

First thing you will need is connect your instrument via the LAN port to your local network, in my case I just connect it back to back to my laptop. Then you will need to set the IP via instrument panel, in my case I used a static IP in the same range as the Ethernet port of the laptop.

Laptop was configured with IP / netmask (/24 for the hard core one)

In case you don't know your instrument IP, case configured by DHCP for example, you can use the "lxi" tool discover command to "automatically" discover the instruments available on you local are network.

# lxi discover
Searching for LXI devices - please wait...
Broadcasting on interface lo
Broadcasting on interface enp9s0
  Found "Rigol Technologies,DSA815,DSA8A22XXXXXX," on address
Broadcasting on interface wlp12s0
Found 1 device

If you are more inclined to review some additional protocol specifications,you can find it here.
A simple wireshark capture allows to have an idea of the inner workings of the discovery process.



At this stage you can query the instrument with the classic "*IDN?" command:

#  lxi scpi --address "*IDN?"
A: Rigol Technologies,DSA815,DSA8A22XXXXXX,
Note: I replaced part of the instrument identifier string with X's.


You can also use a normal "telnet" to port 5555 and make de same query:
# telnet 5555
Connected to
Escape character is '^]'.
Rigol Technologies,DSA815,DSA8A22XXXXX,

Now let's take some data from the instrument, a screenshot for a start, using the lxi tool screenshot option:

 # lxi screenshot --address trace.bmp

Result is is "trace.bmp file saved on the current working directory:

The screenshot will literary take a screenshot of what's visible on the screen be it a trace or a configuration screen.

Even more complicated screenshot for the command line die hard's:
# echo ":PRIV:SNAP? BMP" | nc -w 5 5555 | dd bs=1 skip=11 of=screen.bmp

Continuing with some other commands...

Display brightness query:

# lxi scpi --address "DISP:BRIG?"
Note: answer with be a numeric value of the the setting, in my case is "1"

If you need to change to "2" the screen brightness:
# lxi scpi --address "DISPlay:BRIGhtness 2"

Turning the tracking generator/TG on:

# lxi scpi --address "OUTP:STATE 1"

Querying the tracking generator/TG status:
# lxi scpi --address "OUTP:STATE?"
Output will be 1 or 0 if ON or OFF.

Setting and querying the start frequency:

# lxi scpi --address "FREQ:START 124Mhz"
# lxi scpi --address "FREQ:START?"
Note: it will answer the previous set frequency: "124000000"

For stop frequency should be "FREQuency:STOP", bellow for a 450Mhz stop frequency
# lxi scpi --address "FREQ:STOP 450Mhz"
The result will be like this on the spectrum analyzer:

 Now we need to take/download traces: this for me is the most interesting part since we can take the traces and then compute over the results, for instance in SWR (when trial license expires ) or 3db bandwidth for example.

Download data of trace 1
# lxi scpi --address ":TRACe:DATA? TRACe1"
Output, (shortened version) will be similar to this:
#9000009014 -2.017071e+01, -5.862679e+01, -6.025334e+01, -6.129734e+01, -6.015621e+01, -6.299181e+01, -5.941000e+01, -6.174416e+01, -5.768233e+01, -6.222626e+01, -6.008302e+01, -6.109689e+01, -6.196978e+01, -6.302518e+01, -6.228621e+01, -6.230527e+01, -6.312371e+01, -6.304392e+01, -6.187805e+01, -6.133699e+01, -6.096120e+01, -5.720531e+01, -5.873640e+01, -6.165216e+01, -5.796873e+01, -5.905419e+01, -5.763849e+01, -6.094759e+01, -6.073965e+01,..

You can "pipe" the command to file this way:
# lxi scpi --address ":TRACe:DATA? TRACe1" > trace1.csv
Open "trace1.csv" on a spreadsheet software and plot a graph:

To download trace 3 for example:
# lxi scpi --address ":TRACe:DATA? TRACe3"
If nothing is set for that trace the output will look like this:
#9000009014 -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02, -4.000000e+02,...(continues)

As last command on this series, let's query the instrument language:
 # lxi scpi --address "SYST:LANG?"
Output is on my case: "ENGl"


- In the future will try to add more commands in this document and write some scripts for automation, maybe even a GUI program. 

- If you copy past the command in this post, don't forget to set your instrument IP instead of the one I used (

- Rigol DSA800 programing guide can be downloaded at:

Hope this helps someone,

Have a nice day!




Saturday, December 26, 2020

VHF Low Pass filter for DRA818V module

 It is best to use the DRA818V VHF voice transceiver module with a low pass filter.

Since I'm building a VHF/UHF transceiver using the 818V and 818U modules, the VHF low pass filter was missing from the build.


This design was based from the one here and only some small values changes made , I placed adjustable cap's on the center elements (the 56pF), so used 10-60pF trimmer cap and used 32pF on the ends (10+22pF parallel). 


 After build did some measurement on the spectrum analyzer:

Final iteration of the trimmers:

 Attenuation at 200Mhz:

Filter shape from 100 to 300Mhz without normalization: I need to finish the remaining of the transceiver..


Have a great day!

Sunday, October 25, 2020

Wavetek 3001 signal generator repair - II

 Following the first repair of the Wavetek 3001, I knew that there was another issue with the 400Hz modulation oscillator, it was doing some "FM" oscillations so in practice I could only use the 1Khz tone.

Troubleshooting and comparing with the 1Khz oscillator, it was visible the waveform at C6/CR2 junction oscillating/FM'ing a little. Interesting enough by probing with the scope at the drain of Q2 it disappeared. I tried first to swap C6 to no effect, then swapped CR2 and it stopped but trying with the diode in and inverted polarization it would continue the same so it was either wrong assembled at the factory or it's for the moment just masking any other situation, probably Q2.
Before the previous testing I replace IC2 with IC1 (for the 1Khz) to no good effect so decided the issues was not the opamp.

I left like that, with the diode replaced (used a 1n4148 for the moment, didn't  even checked the exact spec in the manual)

After demodulation on an envelop detector it's now fine:

..envelope detector circuit and input signal (-25dBm) without the 56 ohm input load resistor connected on the circuit:

..I might start an AM receiver from here...

Since it's a bit of a pain to take and access the modulator/modulation board I opted to solder the diode from the pcb track side and leave it for the moment, also left the original diode in place with one leg open:

Since some times the unleveled light still comes on I suspect further recapping at the internal modules might be needed in the future.

Have a great day!