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.
Why Calibrate Battery Voltage
Section titled “Why Calibrate Battery Voltage”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.
Check Current Reading
Section titled “Check Current Reading”Via Display
Section titled “Via Display”The battery voltage appears in the status area when:
- No USB power is connected
- Battery is installed
- Device is running on battery
Via Shell Command
Section titled “Via Shell Command”vbatReturns the battery voltage in millivolts.
Measure Actual Voltage
Section titled “Measure Actual Voltage”- Disconnect USB power
- Use a multimeter to measure actual battery voltage
- Note the displayed voltage on the NanoVNA-H
- Calculate the difference
Calculate Offset
Section titled “Calculate Offset”The offset is the difference between actual and displayed voltage:
Offset = Actual_mV - Displayed_mVFor 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
Set Battery Offset
Section titled “Set Battery Offset”Via Shell Command
Section titled “Via Shell Command”# Set offset (in millivolts)vbat_offset 50 # Add 50 mV to readingvbat_offset -30 # Subtract 30 mV from reading
# Query current offsetvbat_offsetSave the Setting
Section titled “Save the Setting”After calibration:
saveconfigVerification
Section titled “Verification”After setting the offset:
- Run
vbatcommand - Compare with multimeter reading
- Adjust offset if needed
- Save configuration
Battery Voltage Ranges
Section titled “Battery Voltage Ranges”Typical lithium-ion battery voltages:
| State | Voltage |
|---|---|
| Full charge | 4.2V |
| Nominal | 3.7V |
| Low | 3.4V |
| Critical | 3.2V |
| Empty | 3.0V |
USB vs Battery
Section titled “USB vs Battery”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.
Practical Example
Section titled “Practical Example”- Disconnect USB, run on battery
- Measure battery with multimeter: 3.82V (3820 mV)
- Run
vbatcommand, shows: 3780 mV - Calculate offset: 3820 - 3780 = +40
- Set offset:
vbat_offset 40 - Verify:
vbatnow shows 3820 mV - Save:
saveconfig
Troubleshooting
Section titled “Troubleshooting”Voltage Always Shows 0
Section titled “Voltage Always Shows 0”- Battery may not be connected properly
- ADC may not be reading (hardware issue)
Voltage Fluctuates
Section titled “Voltage Fluctuates”- 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
Shell Command Summary
Section titled “Shell Command Summary”# Read battery voltagevbat
# Set voltage offset (millivolts)vbat_offset 50
# Query current offsetvbat_offset
# Save configurationsaveconfig