Solar Lora
Debunking the Charging Illusion! A Complete Guide to Meshtastic Battery Voltage Calibration

When using Meshtastic devices, you might encounter a strange issue: even when the device is battery powered, it still displays a power plug (��charging) icon, mistakenly believing that an external power source/charger is being used. This problem is usually caused by the ADC sampling voltage exceeding 4.2V, leading the device to incorrectly determine its power supply status.
The key to solving this problem is adjusting the ADC multiplier to ensure the device correctly calculates the battery voltage. This tutorial will explain this in detail:
· Working principle of ADC coefficients
· How to manually calibrate ADC coefficients
· Default ADC coefficients for different Meshtastic devices
· How to adjust the ADC coefficients to resolve the issue of misjudging external power supply?
Before delving into how to calibrate ADC coefficients, we need to understand how ADCs (Analog-to-Digital Converters) work and why Meshtastic devices require voltage correction.
An ADC (Analog-to-Digital Converter) is a component that converts analog voltage signals into digital signals. In meshtastic devices, the battery voltage is an analog signal, which the device's MCU (Microcontroller Unit) cannot directly read. Therefore, the ADC converts this voltage into digital data that the MCU can understand.
However, embedded MCUs (such as nRF52 and ESP32) typically handle voltage ranges of 0-3.3V or 0-1.1V, while lithium batteries typically operate between 3.0V and 4.2V, far exceeding the direct measurement range of the MCU's built-in ADC. Directly connecting a battery could overload the ADC or even damage the chip.
Therefore, when designing equipment, a resistor divider circuit is usually added to the ADC input to reduce the battery voltage and bring it into the range that the MCU can measure.
Mathematically speaking, this is a mapping relationship, mapping the voltage range of 3.0V-4.2V to the voltage range of 0-3.3V or 0-1.1V.
How does resistor voltage division affect ADC sampling?

The core principle of the voltage divider circuit is to proportionally divide the battery voltage using two resistors, R1 and R2, so that the voltage read by the ADC is within a safe range. The calculation formula is as follows:
in:
· It is the actual voltage of the battery;
· This is the voltage read by the ADC;
· and are the resistors used for voltage division on the device.
Because R1 and R2 may differ for each Meshtastic device model, there is a fixed proportional relationship between the voltage read by the ADC and the actual battery voltage. Therefore, in order for the software to accurately calculate the true battery voltage, we need an ADC multiplier to correct this proportional relationship.
To ensure that Meshtastic devices can correctly calculate the battery voltage, the firmware uses a coefficient to correct the ADC read value, restoring it to the true battery voltage:
Calculated battery voltage
in:
· The calculated battery voltage is the calculated battery voltage;
· This is the voltage actually measured by the ADC;
· The (ADC coefficient) is a correction factor that depends on the voltage divider resistor ratio of the device.
Different devices use different voltage divider resistors, so the default value of the ADC coefficient may vary from device to device. If the default ADC coefficient of a device is inaccurate, it will lead to incorrect battery voltage calculations, thus affecting the determination of the power supply mode.
Ideally, all devices should have a reasonable ADC coefficient at the factory. However, in real-world use, the following factors can cause inaccurate ADC coefficients:
1. Hardware design tolerances
2. Firmware defaults may not be compatible with specific devices: Meshtastic adapts to a variety of different hardware, and the default ADC coefficients in the firmware may not be suitable for your device.
3. DIY devices (such as fakeTec) require adjusting the ADC coefficients based on the actual voltage divider resistor parameters used.
Therefore, to ensure that the Meshtastic device can accurately calculate the battery voltage, we can manually adjust the ADC coefficients to match the actual situation of the device.
ADC calibration process for Meshtastic devices
On Meshtastic devices, battery voltage is read and calculated using an ADC (Analog-to-Digital Converter). However, due to differences in hardware design across devices, the default ADC coefficients may not be suitable for all devices. If the ADC coefficients are set incorrectly, the device will calculate the battery voltage incorrectly, leading to an incorrect power supply mode determination (e.g., the device may mistakenly believe that an external power source is being used).
Therefore, we need to manually calibrate the ADC multiplier to match the actual device voltage. The basic calibration process includes measuring the actual battery voltage, checking the battery voltage calculated by the device, and writing the new value to the device. Below, we will explain each step in detail and provide specific operating methods.
Preparation before calibration
Before performing ADC calibration, thorough preparation is necessary to ensure the accuracy and reliability of the calibration process. The following are the preparations required before calibration:
First, ensure the device is battery powered, not USB powered. During calibration, the device must be entirely battery powered and cannot be connected to a USB cable or external power source. Connecting to USB power may affect the ADC sampling values, leading to inaccurate calibration data. Therefore, before calibration, be sure to unplug the USB cable and ensure the device operates solely on battery power.
Secondly, a fully charged battery is required. Theoretically, a fully charged lithium battery should have a voltage between 4.2V ±1%. Using a fully charged battery provides a known, stable voltage reference, avoiding the impact of voltage fluctuations due to changes in battery charge on the calibration results. Therefore, it is recommended to fully charge the battery before calibration and ensure the device is disconnected from the charger during measurement.
Third, prepare a multimeter, which will be used to measure the battery voltage.
Fourth, before starting, please record the ADC coefficients of the current device for comparison and adjustment. The default ADC coefficients may differ between different devices, so we need to query the current ADC coefficients and record their initial values.
Read the current ADC coefficients
The ADC coefficient is a key parameter used by the device to calculate battery voltage, and different device models may use different default values. Below are the default ADC coefficients for some common Meshtastic devices:
Equipment Model | Default ADC coefficients |
chatter2 | 5.0 |
DIY | 1.85 |
esp32-s3-pico | 3.1 |
heltec_v1 & v2 | 3.2 |
heltec_v3 & wsl_v3 | 4.9 |
heltec_wireless_paper | 2.0 |
nano-g1-explorer | 2.0 |
rak4631 | 1.73 |
tlora_t3s3_v1 | 2.11 |
If the device's default ADC coefficients are not suitable for your device, it may result in inaccurate calculations of the battery voltage, thus affecting the determination of the power supply mode.
Method 1: Use Meshtastic application query
1. Open the Meshtastic App (available for Android and iOS).
2. Enter the device configuration (Radio Configuration).
3. Find the Power option.
4. Under the ADC Multiplier Override option, you can see the ADC coefficients currently used by the device.
Method 2: Use CLI query
If you are using the Meshtastic command-line tool (CLI), you can enter the following command to query the current ADC coefficients:
meshtastic --get power.adc_multiplier_override
The terminal will return a result similar to:
power.adc_multiplier_override = 3.2
This indicates that the current ADC coefficient of the device is 3.2. Please record this value for adjustment in subsequent steps.
Read the battery voltage calculated by the device
In Meshtastic devices, you can use the app or CLI to query the calculated battery voltage of the current device and compare it with the actual battery voltage measured by a multimeter.
Method 1: Use Meshtastic App to query
1. Open the Meshtastic App.
2. Access the Device Info page.
3. Find the battery voltage.
4. For example, if it displays:
Battery Voltage: 3.82V
5. This means the device is currently calculating the battery voltage to be 3.82V.
Method 2: Use CLI query
If you are using a command-line tool (CLI), you can enter the following command:
meshtastic --get power.battery_voltage
The terminal may return:
power.battery_voltage = 3.82
This means the device currently perceives the battery voltage as 3.82V. Please record this value; we will use it in the next step to calculate the new ADC coefficients.
Calculate the new ADC coefficients
On Meshtastic devices, the ADC multiplier determines the accuracy of the battery voltage calculation. If the calculated battery voltage differs from the actual measurement, the ADC multiplier needs to be adjusted for greater accuracy. Two methods can be used for this calculation:
1. The official ADC calculator provided by Meshtastic (recommended) is suitable for beginners and eliminates the need for manual calculations.
2. Manually calculate ADC coefficients; suitable for advanced users; can be operated in a network-free environment.
Method 1: Use the Meshtastic ADC calculator (Recommended)
Meshtastic provides an ADC calculator that can automatically calculate new ADC coefficients. This method is simple and easy to use, suitable for most users. The calibration steps are as follows:
Step 1: Fully charge the battery
First, fully charge the battery. The method for indicating a fully charged state may vary depending on the device, but the voltage should be 4.2V ±1% when fully charged. Ensure the device is fully charged before performing calibration.
Step 2: Check the battery percentage displayed on the device.
In the Meshtastic App or on your device screen, find the Battery Charge Percent, which will usually display something like this:
B 3.82V 60%
The 60% figure represents the battery charge percentage, and the current calculated battery voltage is 3.82V.
If the battery percentage is not displayed, it means that the current Operative ADC Multiplier coefficient of the device is too high. It needs to be reduced (it is recommended to reduce it by 0.1 each time) until the device can display the battery percentage correctly.
Step 3: Input data into the ADC calculator
1. Open the Meshtastic official ADC calculator:
Meshtastic Power Configuration - Calibration Process
2. Enter the battery percentage displayed on the device (e.g., 60%).
3. The ADC coefficient currently used by the Current ADC Multiplier input device (e.g., 5.0).
4. Click the Calculate button, and the calculator will automatically calculate the new Operative ADC Multiplier and display the new value (e.g., 5.42) in Calculated New Operative ADC Multiplier.
5. Record the calculated new ADC coefficients; we will apply them to the device later to ensure accurate battery voltage calculations.
Method 2: Manually calculate ADC coefficients
If you cannot use the ADC calculator, you can also manually calculate the new ADC coefficients. The steps are as follows:
Data collection
1. Use a multimeter to measure the battery's actual voltage (e.g., 4.2V).
2. Check the battery voltage calculated by the device (e.g., 3.82V).
3. Record the current ADC coefficient of the device (e.g., 3.2).
Calculate the new ADC coefficients using the formula.
New coefficient, current coefficient, actual battery voltage, voltage calculated by the device.
Substitute the data into
the new coefficients .
New coefficient
For most users, the Meshtastic ADC calculator is recommended because it is simple and intuitive, requiring no manual calculations. If you prefer to understand the calculation process, you can use the manual method.
Set new ADC coefficients
Method 1: Modify in Meshtastic App
1. Open the Meshtastic App.
2. Enter the device configuration (Radio Configuration).
3. Select the Power option.
4. Find ADC Multiplier Override.
5. Enter the new ADC coefficient (e.g., 3.52).
6. Save the settings and restart your device.
Method 2: Using CLI settings
Enter the following command to apply the new ADC coefficients to the device:
meshtastic -- set power.adc_multiplier_override 3.52
Then restart the device:
meshtastic --reboot
The new ADC coefficients will take effect after the device is restarted.
Author: Hays Chan | Community Group Member
Translator:Joe Tan | KEEPTEEN | meshtastic node repeater
Website: https//www.keepteen.com
0users like this.

