1.. zephyr:code-sample:: max17048 2 :name: MAX17048 Li-Ion battery fuel gauge 3 4 Read battery percentage and power status using MAX17048 fuel gauge. 5 6Overview 7******** 8 9This sample shows how to use the Zephyr :ref:`fuel_gauge_api` API driver for the MAX17048 fuel gauge. 10 11.. _MAX17048: https://www.maximintegrated.com/en/products/power/battery-management/MAX17048.html 12 13The sample periodically reads battery percentage and power status 14 15Building and Running 16******************** 17 18The sample can be configured to support MAX17048 fuel gauge connected via either I2C. It only needs 19an I2C pin configuration 20 21Features 22******** 23By using this fuel gauge you can get the following information: 24 * Battery charge status as percentage 25 * Total time until battery is fully charged or discharged 26 * Battery voltage 27 * Charging state: if charging or discharging 28 29 30Notes 31***** 32The charging state and the time to full/empty are estimated and based on the last consumption average. That means that 33if you plug/unplug a charger it will take some time until it is actually detected by the chip. Don't try to plug/unplug 34to see in real time the charging status change because it will not work. If you really need to know exactly the moment 35when the battery is being charged you will need other method. 36 37Sample output 38************* 39 40``` 41*** Booting Zephyr OS build 16043f62a40a *** 42Found device "max17048@36", getting fuel gauge data 43Time to empty 1911 44Time to full 0 45Charge 72% 46Voltage 3968 47Time to empty 1911 48Time to full 0 49Charge 72% 50Voltage 3968 51``` 52