Content-Length: 330350 | pFad | http://github.com/meshtastic/firmware/pull/6070

E1 Expose INA219 measurement as battery voltage for Seeed Xiao ESP32S3 by syssi · Pull Request #6070 · meshtastic/firmware · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose INA219 measurement as battery voltage for Seeed Xiao ESP32S3 #6070

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

syssi
Copy link
Contributor

@syssi syssi commented Feb 16, 2025

The Meshtastic firmware lacks the ability to publish INA power monitor measurements as battery voltage readings when BATTERY_PIN is not defined. This limitation affects users who want to monitor battery levels using INA sensors.

Additionally, when a valid GPIO/A0 pin is assigned as BATTERY_PIN, users can measure analog voltage directly through that pin without requiring firmware recompilation. This feature provides more flexibility for hardware configurations.

This improvement would benefit users by:

  1. Enabling battery voltage monitoring through INA sensors even without a dedicated battery pin
  2. Allowing dynamic analog voltage measurements through GPIO pins
  3. Reducing the need for custom firmware builds

Related issues:

#5248
#5880

@CLAassistant
Copy link

CLAassistant commented Feb 16, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@caveman99 caveman99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally refrain from 'reserving' Pins for optional functionality not present on the PCB. Exypecially since these boards only have a very small number of available GPIO's. I'd rather accept a PR providing the INA functionality through other modifications not blocking a random GPIO Pin.

@caveman99 caveman99 force-pushed the fix-state-of-charge-via-ina219 branch from 8cfd16e to 1d680f3 Compare February 17, 2025 14:35
@syssi
Copy link
Contributor Author

syssi commented Feb 17, 2025

@caveman99 Some variants.h are using BATTERY_PIN -1. Is this an option?

@fifieldt
Copy link
Contributor

What we need is this: #3409

@syssi
Copy link
Contributor Author

syssi commented Feb 18, 2025

I agree auto-detection would be nice. IMO this is out of scope of this pull request.

@caveman99
Copy link
Member

@caveman99 Some variants.h are using BATTERY_PIN -1. Is this an option?

Yes that would be an option, but every toolchain behaves quite differently. Did you actually test the mod?

@caveman99 caveman99 force-pushed the fix-state-of-charge-via-ina219 branch from 2052690 to f6e0e26 Compare February 18, 2025 08:04
@syssi
Copy link
Contributor Author

syssi commented Feb 18, 2025

Yes. The seeed-xiao-s3 build works fine with BATTERY_PIN -1:

INFO  | ??:??:?? 2 [Power] Init sensor: INA219
INFO  | ??:??:?? 2 [Power] Opened INA219 sensor on i2c bus
DEBUG | ??:??:?? 2 [Power] Using INA on I2C addr 0x40 for charging detection
DEBUG | ??:??:?? 2 [Power] Battery: usbPower=0, isCharging=0, batMv=4052, batPct=89

@caveman99 caveman99 force-pushed the fix-state-of-charge-via-ina219 branch from f6e0e26 to 587974b Compare February 19, 2025 12:21
@thebentern thebentern merged commit bb73555 into meshtastic:master Feb 19, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/meshtastic/firmware/pull/6070

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy