/!\ Vorläufig / Preliminary, work in progress /!\

Translate (Übersetzte) with Google

/!\ If you mouse click on a picture it will be expanded. You can go back to the web page with the back arrow of your web browser.

nanoVNA-V2 ojisan firmware

For the nanoVNA-V2 there is an excelent firmware from ojisan (Japan).

Because it is in Japanese language I will translate it here (google is my friend ;-) .

Fortunately he left the source code on his web page, and a good instruction how to compile it. That helped me to add the function screen capture to the firmware, readout via USB connection.

ojisan firmware benefits

Before explaining the special benefits of the ojisan firmware, I like to show the good things compared to the standatd nanoVNA-V2 firmware.

Another good thing is the possibility to measure crystals.


Calibration list


When you tap on RECALL->LIST you will see the list on the right.

There are all stored parameters of a calibration listed.

So, you do not have to remember all the details.




nanoVNA-V2 ojisan

When I played around with nanoVNA-V2, there were many good points, but there were also problems.

It seems that the software is not well built, probably because it has just been released.

Good points

  1. It can measure properly even at 1GHz or higher.
  2. The number of measurement points can be changed up to 201.
  3. The graph display is updated during the measurement.
  4. Since it is corrected to some extent by ECAL, it is OK if you measure roughly without taking CAL.

Bad points (soft bug)

  1. Above 140MHz, the frequency resolution becomes 12kHz and the graph becomes stepped.
  2. CW fills the screen with scale lines.
  3. There is a strange peak at the SWEEP start point.
  4. A strange peak may appear in the middle of SWEEP.
  5. When the number of markers is reduced from 3 to 2, the display is no longer for multiple markers. (The same was true for NanoVNA)
  6. The M in the marker display is garbled.
  7. The marker display becomes a negative number above 2.2GHz.
  8. The delta marker display is strange.
  9. The display of SW numerical input mode is strange.
  10. In SW numerical input mode, if you change the number by touching and return with the center SW, the screen becomes strange.
  11. It is difficult to understand because there is a space every 3 digits in the touch numeric keypad numerical input mode. (The same was true for NanoVNA)
  12. The display of SWR to LINEAR of DISPLAY → FORMAT is different from the actual one.

My Software improvements

  1. User Interface changes, display according to settings, color coding, etc.
  2. Added SWEEP PROGRESS BAR display.
  3. Added LIST display to SAVE and RECALLnwith the parameters.
  4. At the time of CENTER / SPAN, the scale line is centered.
  5. Added LCD GAMMA adjustment to CONFIG → SETTING . (Because the LCD was dark)
  6. E-DELAY touch numeric keypad Added mm unit when entering numerical values.
  7. Added AVERAGE count setting to DISPLAY.
  8. Move the graph area to the right by 4 pixels and display the number of AVGs and the number of measurement points on the left side.
  9. ADC fs = 300kHz → fs = 1.2MHz Over Sampling x4 to increase the resolution.
  10. Compile with FPU ON.

I really wanted to add an RBW setting, but it seems that it will take time because the processing at RBW = 6kHz is closely involved in the basis of signal processing.

So, I have updated the current situation as an interim report.


LCD GAMMA adjustment

Increase or decrease the GAMMA setting with the left SW and right SW.Set the value so that the gradation of the color bar is most visible.

Touch the screen to complete the adjustment.

The set GAMMA is saved by CONFIG SAVE.







Update 2020/07/16

RBW implementation and various changes, as well as bug fixes, have been added.

Personally, I think we have created something that can be said to be almost complete.

Changed points

  1. Implemented RBW . Can be changed from 3kHz to 10Hz.
  2. Added function keys (F0 to F8) . F1 to F7 can be set freely.
  3. When the frequency and the number of measurement points are different from those when CAL is performed, interpolation is performed and CAL is performed.
  4. You can change the trace color in the menu.
  5. Read memory 0 when the power is turned on.
  6. If the right SW is pressed when the power is turned on, memory 0 and CONFIG are not read.
  7. When entering the numeric keypad, the current setting value is displayed at the bottom right.
  8. When entering the numeric keypad, touching an unrelated part cancels it.

Bug fixes

  1. It hangs when the position of the marker is moved by touch for about 6 seconds.
  2. Even if you enter the frequency as 16.395M with the numeric keypad, it will be 16.39499MHz.
  3. The CAL status is not displayed properly (only D).
  4. When the SWR is large, the display becomes /.0/.


Implemented RBW

The basic unit of NanoVNA-V2 is signal processing with 50 samples (RBW = 6 kHz) of fs = 300 kHz, and the time unit of various processing is 50 / 300 kHz (= 0.166 ms).

In order not to break this signal processing time unit (because it is troublesome to change it because the number of corrections increases ...), frequency conversion, window function processing, and CIC filter processing are added.

The window function is a table reference and the table size is 600 (2400 bytes because it is a float).

For RBW, the window function is applied as it is from 3 kHz to 1 kHz, and for 300 Hz to 10 Hz, the window function is applied after dropping fs from 300 kHz to 6 kHz with the CIC filter.



Function keys F1 - F8

Each function key has the following settings by default.

The numerical values ​​are arranged in the order of selecting the item number in the menu.

F0 and F8 are fixed, and F1 to F7 can be set freely.

Touch CONFIG → SETTING → QUICK FUNC to display the lower left screen.

It is OK to tap the F8 location (lower left corner of the screen) when the menu is not displayed.

If you touch F4 here, for example, the screen on the right will appear.



You can see the number 37 at the bottom right of the number entry field, which is the current F4 setting. The first 3 represents the third from the top (MARKER) of the TOP menu screen, and the next 7 represents the 7th from the top (OPERATIONS) of the MARKER menu screen.

In this way, on the numerical input screen of the function keys, enter the number of items to be selected in order from the TOP menu.

If you save the settings with CONFIG SAVE, you can use them again next time.

Trace color change

Trace color can be changed in the menu.

Touch CONFIG → SETTING → COLORS to display the left screen.

The screen on the right is where you touched TRACE 0 and entered numerical values. There are two forms of color numeric input.

The first is in RGB format, where you enter the levels of red, green, and blue, with three numbers from 0 to 255 separated by dots.

On the right screen, you are typing in this format, red is 255, green is 240, and blue is 0, so it will be orangeish yellow. The other is in RGB565 format, where you enter numbers from 0 to 65535 (without dots). In the RGB565 format, the color is represented by 16bit of red 5bit + green 6bit + blue 5bit.

At the bottom right of the numerical input field on the right screen, you can see the value 65408, which is the current setting color of TRACE 0. This is the color in RGB565 format, which is the same color as 255.240.0 in RGB format. The set trace color is saved by CONFIG SAVE.





The default trace colors are:






CAL status is not displayed normally.

Currently, even if you do CAL, you can only display D. It's a problem if you don't know what you CAL'd.

Therefore, when each CAL item is executed, the CAL status is displayed as shown below. Each CAL status display becomes effective when all the CAL items marked with a circle on the right side are executed.

NanoVNA-V2 does not have ISOLATION in the CAL item. Leaks to the RX port are measured during OPEN and SHORT and ISOLATION is calculated.

Therefore, even in the above table, the display of X is enabled when OPEN, SHORT, and THRU are executed.

Reference impedance change function

2020/07/21 Implemented the reference impedance change function.

The reference impedance change function calculates S11 and S21 when the input / output impedance is changed from 50 Ω to an arbitrary value.

The hardware is measuring with 50 Ω, but the 50 Ω system S parameter obtained by the measurement is converted to a parameter irrelevant to impedance, and it is displayed back to the S parameter of arbitrary impedance.

Originally all S-parameters are required, but NanoVNA-V2 only gives S11 and S21, so we set S22 = S11 and S12 = S21. In addition, the input impedance and output impedance can be changed freely, but here, the impedance is the same for both input and output, and it is simplified to a real number (resistor).


Even with the simplification so far, the calculation is still quite complicated, and I was worried that the calculation time would be enough to convert in real time while measuring, but it seems to be okay when I played with it.

However, I doubt if it is practical, and I haven't tested it enough yet, so I decided to announce it as a test version. We would appreciate it if you could give us bug reports and suggestions for improvement.

Touch TOP screen → DISPLAY → SCALE to display the left screen.

RENORM-Z 50 → RX Ω" is the reference impedance change function.

When you touch it, the numerical input screen will appear, so enter the input / output resistance value.

Changing the reference impedance is called renormalization.


Example of actually changing the reference impedance.

I searched for something interesting, but I couldn't find a suitable example (part), so I made an LPF and measured it.

Z = 1000 Ω, fc = 1MHz, 5th order Butterworth LPF.



When measured at 50 Ω, the impedance does not match the LPF design value, so a large peak appears near the cutoff frequency.

When the reference impedance was changed to 1000 Ω (right screen), the peak near the cutoff frequency disappeared and it became close to flat.

Next, let's check if the characteristics with the changed reference impedance really match (I'm curious).


In the right screen it is measured by inserting 1000 Ω in series with the input and output.

S21 (CH1 LOGMAG, CH1 PHASE) is very similar to the characteristic of changing the reference impedance to 1000 Ω (above), and it can be seen that the reference impedance change is performed correctly.

However, due to the addition of resistors to the input and output, the level drops significantly (-26 dB), and the attenuation range is noisy.

In addition, S11 (CH0 LOGMAG, CH0 SMITH) is almost open.

It can be said that the amount of information is larger when the reference impedance is changed than when a resistor is inserted in series for measurement.

At high frequencies, it is common to design filters with 50 Ω, but up to a few MHz, it is often designed with a few hundred to a few kΩ.

Normally, as described above, a series resistor is inserted into the input and output to make the measurement 50 Ω, but it can be easily measured by using the reference impedance change function.

Also, since the video signal is a 75 Ω system, it is usually measured with a 75-50 conversion pad (a type of ATT), but this is also easy with the reference impedance change function.

In addition, for filters that do not know the input / output impedance, you can use the reference impedance change function to estimate the input / output impedance by searching for a place with better characteristics without actually changing the resistor and experimenting.

Impedance matching function


2020/07/28 Implemented impedance matching function.

Calculate the characteristics when a Pi-type impedance matching circuit like the one on the right is attached to the input of the DUT.

The Z3 side is the DUT side. You can select L, C, or R as Z.



Multiply the T parameter of the impedance matching circuit by converting the S parameter obtained in the measurement to the T parameter, and display the obtained T parameter back to the S parameter.


As with the reference impedance change function, S22 = S11 and S12 = S21.

If you follow TOP screen → DISPLAY → SCALE, the right screen will appear.

MATCHING is the impedance matching function.  There are Z1 to Z3 inputs and an APPLY MATCHING button.  

You can turn impedance matching ON / OFF with the APPLY MATCHING button.  

When impedance matching is ON, the set values ​​of Z1 to Z3 are displayed on the screen.  

Touch the Z1 to Z3 buttons to display this screen.  

Select L, C, R and enter a value.




Example 22 Ω resistor

Example of connecting a 22 Ω resistor to CH0 (PORT1) and impedance matching to 50 Ω at 10 MHz.



You can see the setting values ​​of Z1 to Z3 in the upper left of the screen. In this case, Z3 is not used, so it has a 1 MΩ resistor (R) so as not to affect it.

The slight deviation is due to the fact that the resistance of 22 Ω is actually measured 22.6 Ω + j 2.9 Ω at 10 MHz.

The screen on the left is impedance-matched with NanoVNA-V2, and the screen on the right is simulated with the Iowa Hills Smith Chart.

The characteristics are very similar to the simulation.

Next, try impedance matching the same 22 Ω resistor with a different constant.

I don't actually use such a matching circuit, but I did such an extreme thing and tried it with interest to see how well it fits with the simulation.



It's very similar to the simulation on the right.


You can see that the range of improvement of S11 is narrower than the previous matching.

Actually, the trajectory of this matching circuit passes through Q = 5 on the Smith chart as shown in the figure right (the previous matching was about Q = 1.2).  

Added equal Q lines (Q = 1 to Q = 5) to the Smith chart.  

It is a line like a rugby ball that bulges in the middle.  

Q increases as you move away from the center. In general, the trajectory of the matching circuit should pass through the small Q of the Smith chart.

When Q is low, the matching range is wide and robustness is good (strong against variations in parts and environment).








Calculating matching element

TOP screen → Touch DISPLAY to display the left screen.











Touch the second SIMULATE from the top to display the screen right.

Please note that the previous version and menu structure have changed.  The SIMULATE menu contains E-DELAY, MATCHING and PORT-Z.  Since this order is also used for internal calculation, it can be said that the E-DELAY S11 is attached with a MATHING circuit and PORT-Z displays it with different impedance.  

For example, impedance matching is used to match 100Ω, and PORT-Z is used to make a 100Ω system.  






Touch MATCHING to display the screen below.  

The CALC Z1 ... 3 and AUTO CALC buttons have been added to the Z1 to Z3 and APPLY MATCHING buttons that were the same as before.  

The CALC Z1..3 button calculates and configures an L-match circuit that converts the current center frequency S11 to the impedance set by PORT-Z.  

The L match circuit is an LPF type with as small a Q as possible. Use R 1MΩ for unused elements.  






Touch the AUTO CALC button to enter a mode that automatically executes the L match circuit calculation each time it is swept.  

You can cancel it by touching it again.

In AUTO CALC mode, AUTO is entered before the values ​​of Z1 to Z3 on the upper left of the screen are displayed.

Not only when the DUT state changes, but also when the frequency setting changes, the matching state is maintained.






LC, Crystal series resonant measurement

The function to calculate the LC series resonant circuit and crystal parameters (LC value, equivalent series resistance, Q value) from S21.

The measurement has SHUNT (put DUT between the signal and GND) mode and SERIES (put DUT in series) mode.

A wide range of measurements is possible by using different measurement modes depending on the DUT.

To use this calculation function, you need a jig to insert a DUT between port 1 and port 2.


The figure on the left is an example of a jig.

Pin header 8 on the right is for SHUNT (put DUT between signal and GND) mode, and pin 8 on the right is for SERIES (put DUT in series) mode.

The contact resistance is lowered by using 4 pins of the pin header as one terminal.

Impedance matching is improved by putting π type ATT 5dB (180Ω-30Ω-180Ω) on both sides for input and output.

The slide SW is for passing (shorting) the terminal for SERIES mode, and it is set to the through side in SHUNT mode and THRU calibration.

Since the measurement is calculated from S21, only THRU calibration is OK.

I made SHORT and LOAD (bottom two) for impedance measurement with S11, but these are unnecessary if it is used only with S21.


How to use Touch DISPLAY from TOP to display this screen.

Touch ANALYZE to display the screen right.











From the top, there are menus for LC-SHUNT, LC-SERIES, XTAL-SERIES, Z-SHUNT, and Z-SERIES.

LC-SHUNT measures an LC series resonant circuit in SHUNT mode (with a DUT between the signal and GND).

LC-SERIES measures LC series resonant circuits in SERIES (put DUT in series) mode.

Similarly, XTAL-SERIES measures crystals in SERIES mode, Z-SHUNT measures Z (L or C or R) in SHUNT mode, and Z-SERIES measures Z in SERIES mode.

SHUNT mode can measure accurately when the impedance is less than 50Ω, and SERIES mode can measure accurately when the impedance is greater than 50Ω.

SHUNT mode is suitable for ordinary LC resonant circuits, and SERIES mode is suitable for crystals.

You can cancel the measurement by touching it again.


Measurement examples

LC-SHUNT use the S21 is a measurement so leave out the LOGMAG and PHASE of P2 on the screen.

Set CENTER near the resonance frequency and set SPAN to the range including the frequency at which the phase is ± 45 ° (the frequency at which the phase changes the most when Q is low).

After THRU calibration, connect the DUT (LC series resonant circuit) to the SHUNT terminal.

At the end of the sweep, the resonant frequencies, L, C, R, and Q are calculated and displayed.

In the figure on the right, T37-6 26 turns + 100pF is measured.



Similar to LC-SERIES, set the resonance frequency to CENTER and set the range including the frequency whose phase is ± 45 ° to SPAN.

After THRU calibration, connect the DUT (LC series resonant circuit) to the SERIES terminal.

In this example, the LOGMAG at the resonance frequency is very small at -0.05dB, and the obtained R and Q measurements are suspicious.

LC-SHUNT is used to measure such a small R (= large Q).







Set the frequency so that both XTAL-SERIES fs (series resonance frequency, left peak) and fp (parallel resonance frequency, right dip) are included.

Since SPAN will inevitably become wide and the measurement points near the series resonance point will become rough, set the number of measurement points to 201.

After THRU calibration, connect the DUT (crystal) to the SERIES terminal.

Since the important crystal parameters are series Ls and series Cs, it is possible to measure with LC-SERIES with narrow SPAN and parallel Cp separately.

There are also Z-SHUNT and Z-SERIES, but these are modes that measure LCR (non-resonant) as DUT.

Calculate the L and C values ​​from the impedance at the CENTER frequency.

I'm thinking of putting it in DISPLAY / TRACE / FORMAT eventually.


2021-01-26 I (DL5FA) have measured 2 crystals before with a nanoVNA.

Now I have measures crystals with the nanoVNA-V2 with ojisan firmware and a SDR-Kit Testboard clone, see below.

I have read in VNWA_HELP.pdf, version 36.7.9 that a direct connection in series of the crystal is better than a 12.5 Ω matching.

First is a 8.0 MHz HC-18/U crystal measured in series.

The setup was:


It is very useful to get all the important parameters calculated.

The noise starts below -80 dB.

The 320 pixel screen shots are expanded to 480 pixel.


Second is a 71.5 MHz HC-18/U crystal measured in series.

The setup was:

So, it looks like, that crystals could be measured with the ojisan firmware, but not with the standard firmware.



In comparison I have measure the 8.0 MHz crystal with a second nanoVNA-V2 with DiSload firmware 45 (4 inch screen).

All 3 measurements are looking similar, just here the frequency difference between Serial and Parallel resonance is 19 kHz, the other two have 15 kHz. Changing the Edelay to 0 does not change it.








In comparison I have measure the 8.0 MHz crystal with an old nanoVNA with DiSload firmware 45.










Last changes

2010-09-13 Changes:

  1. The output from PORT1 during PAUSE is set to CW so that it can be used as a signal generator (until now it was intermittent).
  2. Fixed the font size to make it easier to see.
  3. Changed the FORMAT menu depending on whether TRACE is PORT1 or PORT2 (until now, meaningless settings were possible).
  4. I put Z-SHUNT and Z-SERIES in ANALYZE menu in FORMAT.
  5. The contents of the SELECT MARKER menu were put in MARKER, and ALL OFF and SMITH VALUE were deleted. (SMITH VALUE is in SCALE.)

2010-10-14 Changes:

The movement between menus has been reduced so that the current setting status can be seen.

  1. Fixed waveform distortion when returning from PAUSE (PAUSE is now synced to sweep).
  2. Corrected font size and line spacing to make it easier to see.
  3. Added ACTIVE (highlight color when touched) to the COLORS menu.
  4. The frequency can be input by touching the frequency display at the bottom of the screen.
  5. PAUSE ON / OFF can be turned on by touching PROGRESS BAR. Also, at the time of PAUSE, PAUSE is displayed at the bottom of the screen.
  6. START / STOP and CENTER / SPAN modes are set when the numerical input screen is canceled by touching START / STOP and CENTER / SPAN in the STIMULS menu.
  7. Changed to know each mode of START / STOP and CENTER / SPAN in STIMULS menu.
  8. Moved TRACE to the TOP menu. PAUSE has moved to STIMULUS.
  9. Moved CALIBRATE to CAL so that each CALIBRATE state can be seen by color (red: unCAL green: CAL yellow: interpolation).
  10. GRID was added to the COLORS menu.

4 inch Display

So finally, I built it up for a 4-inch LCD (480x320 ST7796) and a 2.8-inch LCD (320x240 ILI9341).

Firmware Compiling

I also uploaded the source file (it's a bit embarrassing to keep it dirty).

When compiling for ST7796 (480x320), set the 10th line of Makefile to LCD = -DDISPLAY_ST7796.

When compiling for ILI9341 (320x240), comment out Makefile line 10 LCD = -DDISPLAY_ST7796.

If you change the Makefile, execute make clean before making.

In order to help finding the ojisan firmware files I will copy the Links.


Screen capture

cho45 was to friendly to add to the nanoVNA-V2 firmware a screen capture command in source file main2.cpp, as a patch.

I (DL5FA) have that patch ported to the ojisan firmware (version 2020-10-13).

Unfortunately it does not work for the 4-inch LCD (480x320 ST7796).

You can download the modified file main2_2020-10-13_capture.cpp. Rename to main2.cpp before compilation.

The compiled file can be downloaded nanovna_V2_ojisan_binary20201004_capture.bin.zip

A Python3 program to capture the screen memory is also supplied in file python.zip.

Please read the file README.md for installation instructions and usage.


# Help info
$ python3 nanovna.py -h

# capture screen
$ python3 nanovna.py -C filename.png

# or easier to remember (same program):
$ python3 nanovna_V2_capture.py -C filename.png

Flash the firmware

The easiest way to flash the new firmware is to install under Windows the official software NanoVNA-QT.exe.

Download the software vna_qt_windows.zip and unzip this archive in a folder, together with the unzipped firmware file.


Fortunately the ojisan firmware can be used with nanovna-saver V3.8. Unfortunately no parameters could be set in the firmware.

The actual version 0.3.9-pre also works.

        PORT-Z 50 > RX Ohm
        LC SHUNT
        LC SERIES
        RBW 1k
        RBW 300
        RBW 100
        RBW 30
        RBW 10
        AVG 1
        AVG 2
        AVG 5
        AVG 10
        AVG 20
        AVG 50


    TRACE 0
    TRACE 1
    TRACE 2
        PORT 1
        PORT 2


    MARKER 1
    MARKER 2
    MARKER 3
    MARKER 4

        Like in OPERATIONS
        Input number


    SAVE 0
    SAVE 1
    SAVE 2
    SAVE 3
    SAVE 4

    RECALL 0
    RECALL 1
    RECALL 2
    RECALL 3
    RECALL 4

        TOUCH CAL
        TOUCH TEST
        LCD GAMMA
        QUICK FUNC

    D MESG


  1. Power vs. Voltage

  2. Online dBm - Volt converter

  3. RF calculators, LC matching

Application notes

  1. Balun overview

  2. 2018Cookbook.pdf, guru of chokes, Jim K9YC

  3. RFI-Ham.pdf 2019 K9YC, A Ham's Guide to RFI, Ferrites, Baluns, and Audio Interfacing

  4. Application Notes in groups.io/g/nanovna-users

  5. Absolute_Beginner_Guide_NanoVNA_v1_5.pdf by Martin J.K.


  1. #359 How to properly use a NanoVNA V2 Vector Network Analyzer & Smith Chart (Tutorial) Andreas Spiess

Videos from W2AEW, Alan Wolke:

  1. Alan Wolke W2AEW: 1:23:07 VNAs Explained and the NanoVNA last 20 min. discussion.

  2. Overview of the nanoVNA videos

  3. #312: 16:49 Back to Basics: What is a VNA / Vector Network Analyzer

  4. #313: 10:06 Why a VNA needs to be calibrated

  5. #314: 06:07 How to use the NanoVNA to sweep / measure an antenna system's SWR and optimize its tuning

  6. #315: 07:34 How to use the NanoVNA to measure a low-pass filter

  7. #316: 15:47 Use NanoVNA to measure coax length - BONUS Transmission Lines and Smith Charts, SWR and more

  8. #317: 09:15 NanoVNA Port Extension using the Electrical Delay setting

  9. #318: 09:52 NanoVNA comparison measuring a duplexer - NanoVNA-H4 and SAA-2N

  10. #319: 20:22 Measuring Crystals with NanoVNA and other tools

  11. #320: 06:45 How to update the NanoVNA-H4 firmware using Windows 10 and .DFU file

up to top

Contact Email, please enter your Email address

/!\ The entered Email address will not be published, or given away.

Comment this page
Are you human?

List of pages in this category:

-- RudolfReuter 2021-01-23 18:53:46

Go back to CategoryAmateurRadio or FrontPage

nanoVNA-V2-ojisanFirmware (last edited 2021-02-03 18:21:45 by RudolfReuter)