# Example for `ina219` driver An example to use `ina219`. ## What it does It configures and calibrates `ina219`. It shows bus voltage, shunt voltage, current thorough the bus, power thorough the bus in a loop. ## Wiring Connect `SCL` and `SDA` pins to the following pins with appropriate pull-up resistors. | Name | Description | Defaults | |------|-------------|----------| | `CONFIG_EXAMPLE_I2C_MASTER_SCL` | GPIO number for `SCL` | "5" for `esp8266`, "6" for `esp32c3`, "19" for `esp32`, `esp32s2`, and `esp32s3` | | `CONFIG_EXAMPLE_I2C_MASTER_SDA` | GPIO number for `SDA` | "4" for `esp8266`, "5" for `esp32c3`, "18" for `esp32`, `esp32s2`, and `esp32s3` | ## Notes The example assumes that expected max current is 5 A, and the shunt resistor is 100 milliohm. The defaults can be modified under `Example configuration` in `menuconfig`. Care should be taken when you measure high current (more than 1 A). Breadboard is not designed for high current. `CONFIG_NEWLIB_LIBRARY_LEVEL_NORMAL` must be `y` on `esp8266`.
To create a project from this example, run:
idf.py create-project-from-example "esp-idf-lib/ina219=1.0.5:default"