Skip to content

Reverting changes made by PR #7520 and adjusting ADC - #7878

Merged
fifieldt merged 7 commits into
meshtastic:developfrom
HarukiToreda:develop
Sep 6, 2025
Merged

Reverting changes made by PR #7520 and adjusting ADC#7878
fifieldt merged 7 commits into
meshtastic:developfrom
HarukiToreda:develop

Conversation

@HarukiToreda

Copy link
Copy Markdown
Contributor

Summary

Reverts changes made by PR #7520 and adjusts the ADC calibration factor to 4.916.

The T114 originally used an ADC value of 4.90, based on the physical resistor divider on the board. PR #7520 raised this to 4.99 to artificially force the displayed battery voltage to read 4.19 V, which the firmware considers “100%” or fully charged. This approach ignores real-world battery behavior and introduces misleading readings.

To correct this, I decided to find a value that serves as a good medium across devices, prioritizing the display of the true voltage level over a cosmetic “fullness” percentage. I tested six different boards using an RK6006 programmable power supply set to a constant 4.14 V, ensuring the input source was not a variable.


Why This Fix Is Needed

The firmware’s assumption that 4.19 V = 100% is flawed. In reality:

  • Many batteries with built-in protection stop charging at 4.17 V.

  • Some boards, like the T1114, cut off at 4.15 V.

By forcing the ADC to align with 4.19 V, the displayed voltage is inflated and no longer reflects the true battery state. This can cause issues for users who rely on accurate voltage for cutoff logic in solar or power-managed systems.

The previous calibration (4.90) reflected actual hardware, though subject to resistor tolerances. The adjustment to 4.99 only created a cosmetic “perfect” 100% while distorting actual values.


Test Data (with ADC = 4.99 from PR #7520)

Node Supplied Voltage Displayed Voltage Error
#1 4.14 V 4.20 V +0.06 V
#2 4.14 V 4.19 V +0.05 V
#3 4.14 V 4.19 V +0.05 V
#4 4.14 V 4.16 V +0.02 V
#5 4.14 V 4.25 V +0.11 V
#6 4.14 V 4.18 V +0.04 V

Error range: +0.02 V to +0.11 V (≈ 0.5%–2.7%)


Test Data (with ADC = 4.916)

Node Supplied Voltage Displayed Voltage Error
#1 4.14 V 4.14 V 0.00 V
#2 4.14 V 4.14 V 0.00 V
#3 4.14 V 4.14 V 0.00 V
#4 4.14 V 4.11 V -0.03 V
#5 4.14 V 4.18 V +0.04 V
#6 4.14 V 4.13 V -0.01 V

Error range: −0.03 V to +0.04 V (≈ ±1%).


Why 4.916

  • Six boards tested, calibration factors ranged from 4.854–4.948.

  • Average = 4.916, minimizing error across devices.

  • Keeps readings within ±0.04 V of true.

  • Grounded in repeatable hardware testing.


Benefits

  • Restores true hardware-based accuracy.

  • Maintains error across devices below ±1%.

  • Prevents misleading over-voltage reporting.

  • Provides a single calibration factor validated across multiple devices.


In short: This PR reverts the artificial adjustment from #7520 and replaces it with a tested calibration factor (4.916), validated on six devices with a controlled 4.14 V supply.

20250905_184437

20250905_195657

Adding a counter to show the last time a GPS coordinate was detected to ensure the user is aware how long since the coordinate updated or to identify any errors. I commented out the date so that it can be moved to the Clock screen that is more fitting since it's related data.
This is a PR to show when a phone shares GPS location with the node so you can reliably know what coordinate is being shared with the Mesh.
@HarukiToreda HarukiToreda added bad config bugfix Pull request that fixes bugs labels Sep 6, 2025
@fifieldt
fifieldt merged commit e7b7479 into meshtastic:develop Sep 6, 2025
80 checks passed
thebentern pushed a commit that referenced this pull request Sep 6, 2025
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
jeek pushed a commit to jeek/Meshtastic-Exploiteers-Hacker-Pager that referenced this pull request Jun 30, 2026
Itzdavid01 pushed a commit to Itzdavid01/firmware that referenced this pull request Sep 5, 2026
Itzdavid01 pushed a commit to Itzdavid01/firmware that referenced this pull request Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants