Skip to content

Battery Offset

The NanoVNA-H displays battery voltage to help monitor charge level. The voltage reading can be calibrated to match your multimeter for accurate monitoring.

The battery voltage reading may be inaccurate due to:

  • Component tolerances in the voltage divider
  • ADC reference variations
  • Different battery types

Calibration ensures the displayed voltage matches reality.

The battery voltage appears in the status area when:

  • No USB power is connected
  • Battery is installed
  • Device is running on battery
Terminal window
vbat

Returns the battery voltage in millivolts.

  1. Disconnect USB power
  2. Use a multimeter to measure actual battery voltage
  3. Note the displayed voltage on the NanoVNA-H
  4. Calculate the difference

The offset is the difference between actual and displayed voltage:

Offset = Actual_mV - Displayed_mV

For example:

  • Multimeter shows: 3850 mV
  • NanoVNA displays: 3800 mV
  • Offset needed: +50

Or if the display reads high:

  • Multimeter shows: 3750 mV
  • NanoVNA displays: 3800 mV
  • Offset needed: -50
Terminal window
# Set offset (in millivolts)
vbat_offset 50 # Add 50 mV to reading
vbat_offset -30 # Subtract 30 mV from reading
# Query current offset
vbat_offset

After calibration:

Terminal window
saveconfig

After setting the offset:

  1. Run vbat command
  2. Compare with multimeter reading
  3. Adjust offset if needed
  4. Save configuration

Typical lithium-ion battery voltages:

StateVoltage
Full charge4.2V
Nominal3.7V
Low3.4V
Critical3.2V
Empty3.0V

When USB is connected:

  • Device is powered by USB
  • Battery may be charging
  • Voltage reading may show charging voltage (up to 4.2V)

For accurate battery-only readings, disconnect USB.

  1. Disconnect USB, run on battery
  2. Measure battery with multimeter: 3.82V (3820 mV)
  3. Run vbat command, shows: 3780 mV
  4. Calculate offset: 3820 - 3780 = +40
  5. Set offset: vbat_offset 40
  6. Verify: vbat now shows 3820 mV
  7. Save: saveconfig
  • Battery may not be connected properly
  • ADC may not be reading (hardware issue)
  • Normal under load (sweep uses more current)
  • Check battery connections
  • Battery may be worn out

Display Shows Wrong Voltage Even After Calibration

Section titled “Display Shows Wrong Voltage Even After Calibration”
  • Re-verify multimeter reading
  • Try a fresh battery for comparison
  • Check that offset was saved
Terminal window
# Read battery voltage
vbat
# Set voltage offset (millivolts)
vbat_offset 50
# Query current offset
vbat_offset
# Save configuration
saveconfig