Skip to content

Add fuel gauge max17048#459

Open
Suke0811 wants to merge 4 commits intomasterfrom
fuel-gauge-max17048
Open

Add fuel gauge max17048#459
Suke0811 wants to merge 4 commits intomasterfrom
fuel-gauge-max17048

Conversation

@Suke0811
Copy link
Collaborator

The parts were tested on the ballu Gen2.1 for SoC estimation along with INA219. MAX estimates SoC based on voltage.
Alrt pin hasn't been used yet tho.


This pull request introduces a new part definition for the MAX17048 1-cell Li-Ion fuel gauge, along with its integration into the package exports. The main changes are the addition of a new device class with proper electrical modeling, footprint assignment, and typical usage block, as well as updating the package's __init__.py to make the part available for import.

New part implementation:

  • Added the Max17048_Device class in FuelGauge_Max17048.py, modeling the MAX17048 fuel gauge with ports for power, ground, I2C, alert, and QSTRT, including electrical characteristics and footprint assignment.
  • Created the Max17048 block in FuelGauge_Max17048.py, which wraps the device with a decoupling capacitor, QSTRT grounding, alert pull-up resistor, and default I2C address assignment for typical usage.

Package integration:

  • Updated __init__.py to export the new Max17048 part, making it available for use elsewhere in the codebase.

@Suke0811 Suke0811 requested a review from ducky64 March 18, 2026 10:15
Copy link
Collaborator

@ducky64 ducky64 left a comment

Choose a reason for hiding this comment

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

Thanks, should be a useful part to have in the library.

I've reviewed it against the datasheet and suggested corrections. Also some stylistic suggestions for library consistency. But should be good after corrections.



class Max17048(DefaultExportBlock):
"""MAX17048 fuel gauge with decoupling and internal ties"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Style-wise, I have the whole device description here. I also don't duplicate the part number on the docstring - it would be assumed from the class name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

how about

"""1-Cell Li-Ion voltage based fuel gauge. Senses its pwr as the battery voltage."""

@Suke0811 Suke0811 requested a review from ducky64 March 20, 2026 19:42
@Suke0811 Suke0811 enabled auto-merge (squash) March 20, 2026 19:43
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.

2 participants