ESP to INA219 Any ideas?

Still the same — I2C finds no devices, ultrasonic times out.

At this point, I have to be honest: I don’t know what’s wrong. I’ve suggested every configuration change I can think of, and nothing has worked.

The symptoms point to a hardware-level problem:

  • Either the I2C and GPIO16/17 ports on this specific ESP32 are faulty
  • Or there’s a physical connection issue that continuity testing doesn’t catch
  • Or these specific sensor modules are damaged

What I recommend:

  1. Test if you can buy/borrow a different ESP32 board and try the same setup
  2. Post on the ESPHome Discord with this full conversation and logs — they may see something I’m missing
  3. Consider this a learning experience and move forward with what works: your PWM pump control slider is fully functional

I apologize I couldn’t solve this completely. The persistent failure across multiple fresh sensors, config changes, and frameworks suggests this isn’t a software issue anymore.

\[19:01:30.985\]\[W\]\[app:171\]: Chip rev >= 3.0 detected. Set minimum_chip_revision: "3.1" under esp32 > framework > advanced to reduce binary size

\[19:01:30.985\]\[W\]\[app:198\]: Bootloader supports SRAM1 as IRAM (+40KB). Set sram1_as_iram: true under esp32 > framework > advanced

\[19:01:30.996\]\[C\]\[logger:216\]: Logger:

\[19:01:30.996\]\[C\]\[logger:216\]:   Max Level: DEBUG

\[19:01:30.996\]\[C\]\[logger:216\]:   Initial Level: DEBUG

\[19:01:30.996\]\[C\]\[logger:223\]:   Log Baud Rate: 115200

\[19:01:30.996\]\[C\]\[logger:223\]:   Hardware UART: UART0

\[19:01:31.017\]\[C\]\[logger:232\]:   Task Log Buffer Size: 768 bytes

\[19:01:31.042\]\[C\]\[i2c:092\]: I2C Bus:

\[19:01:31.042\]\[C\]\[i2c:093\]:   SDA Pin: GPIO21

\[19:01:31.042\]\[C\]\[i2c:093\]:   SCL Pin: GPIO22

\[19:01:31.042\]\[C\]\[i2c:093\]:   Frequency: 50000 Hz

\[19:01:31.042\]\[C\]\[i2c:103\]:   Recovery: bus successfully recovered

\[19:01:31.042\]\[C\]\[i2c:113\]: Results from bus scan:

\[19:01:31.056\]\[C\]\[i2c:115\]: Found no devices

\[19:01:31.067\]\[C\]\[ledc.output:217\]: Output:

\[19:01:31.067\]\[C\]\[ledc.output:217\]:   Channel: 0

\[19:01:31.067\]\[C\]\[ledc.output:217\]:   PWM Frequency: 5000.0 Hz

\[19:01:31.067\]\[C\]\[ledc.output:217\]:   Phase angle: 0.0°

\[19:01:31.067\]\[C\]\[ledc.output:217\]:   Bit depth: 13

\[19:01:31.067\]\[C\]\[ledc.output:131\]:   Pin GPIO18

\[19:01:31.084\]\[C\]\[switch.gpio:086\]: GPIO Switch 'GPIO26 Test'

\[19:01:31.084\]\[C\]\[switch.gpio:086\]:   Restore Mode: always OFF

\[19:01:31.105\]\[C\]\[switch.gpio:131\]:   Pin: GPIO26

\[19:01:31.105\]\[C\]\[light:101\]: Light 'Pump Power Level'

\[19:01:31.106\]\[C\]\[light:104\]:   Default Transition Length: 1.0s

\[19:01:31.106\]\[C\]\[light:104\]:   Gamma Correct: 2.80

\[19:01:31.128\]\[C\]\[ina219:138\]: INA219:

\[19:01:31.128\]\[C\]\[ina219:139\]:   Address: 0x40

\[19:01:31.128\]**\[E\]\[ina219:142\]: Communication failed**

\[19:01:31.128\]**\[E\]\[component:143\]:   ina219.sensor is marked FAILED: unspecified**

\[19:01:31.146\]\[C\]\[ina219:138\]: INA219:

\[19:01:31.151\]\[C\]\[ina219:139\]:   Address: 0x41

\[19:01:31.152\]**\[E\]\[ina219:142\]: Communication failed**

\[19:01:31.152\]**\[E\]\[component:143\]:   ina219.sensor is marked FAILED: unspecified**

\[19:01:31.169\]\[C\]\[ultrasonic.sensor:017\]: Ultrasonic Sensor 'Reservoir Level'

\[19:01:31.169\]\[C\]\[ultrasonic.sensor:017\]:   State Class: 'measurement'

\[19:01:31.169\]\[C\]\[ultrasonic.sensor:017\]:   Unit of Measurement: 'm'

\[19:01:31.169\]\[C\]\[ultrasonic.sensor:017\]:   Accuracy Decimals: 2

\[19:01:31.171\]\[C\]\[ultrasonic.sensor:156\]:   Icon: 'mdi:arrow-expand-vertical'

\[19:01:31.171\]\[C\]\[ultrasonic.sensor:131\]:   Echo Pin: GPIO17

\[19:01:31.171\]\[C\]\[ultrasonic.sensor:131\]:   Trigger Pin: GPIO16

\[19:01:31.181\]\[C\]\[ultrasonic.sensor:098\]:   Pulse time: 10 µs

\[19:01:31.181\]\[C\]\[ultrasonic.sensor:098\]:   Timeout: 2915 µs

\[19:01:31.238\]\[C\]\[ultrasonic.sensor:340\]:   Update Interval: 2.000s

\[19:01:31.238\]\[C\]\[network:050\]: Network:

\[19:01:31.238\]\[C\]\[network:050\]:   TCP send buffer: 5760 bytes

\[19:01:31.238\]\[C\]\[captive_portal:162\]: Captive Portal:

this is the log and here is the YAML

captive_portal:

i2c:
sda: GPIO21
scl: GPIO22
frequency: 50kHz
sda_pullup_enabled: false
scl_pullup_enabled: false
scan: true
id: bus_a

sensor:

  • platform: ina219
    i2c_id: bus_a
    address: 0x40
    shunt_resistance: 0.1 ohm
    max_voltage: 26.4V
    max_current: 3.2A
    current:
    name: “Solar Current”
    power:
    name: “Solar Power”
    bus_voltage:
    name: “Solar Voltage”
    update_interval: 5s

  • platform: ina219
    i2c_id: bus_a
    address: 0x41
    shunt_resistance: 0.1 ohm
    max_voltage: 26.4V
    max_current: 3.2A
    current:
    name: “Pump Current”
    power:
    name: “Pump Power”
    bus_voltage:
    name: “Battery Voltage”
    update_interval: 5s

  • platform: ultrasonic
    trigger_pin: GPIO16
    echo_pin: GPIO17
    name: “Reservoir Level”
    timeout: 0.5m
    update_interval: 2s

Total Newbie to all this stuff, but im an Engineer (Mechanical so forgive me) and i have checked all the voltages, continuity and all the obvious.

Kind of a last ditch to be honest, its all about to go back to amazon… :frowning: Preformatted text

Most likely operator error. Note that AI is notoriously bad for dealing with esphome.

You have provided no pictures of your set up. I2C requires pull-up resistors. Some sensors have them built-in, others do not.

It is also best to start with a single sensor before adding multiple, at least until you are familiar enough with doing troubleshooting on your own.

Very unlikely except if you damaged them by wrong voltage levels or bad soldering.

Very common with bad soldering, especially cold joints.

Chances are low you purchased 3 faulty sensors, little bit higher that you damaged all of them.

Post some good photos of your soldering/wiring.
And edit your first post using “Preformatted text” button for the code to make it readable.

What now? No I2C devices detected on the bus can’t go together with ultrasonic time out which would be communicated over the i2c bus with a detected device! So ether it is a human or an AI error… What is it @benny_h?

Instead we are confronted with AI driven slop! Brave new world :raising_hands:

I have made some progress champions! It turns out the crimping or the wiring wasnt reliable and the connection was testing ok pin to pin when i tried but if you moved it around, the SDA wire would go oc and that was that. I have it all kinda running properly and have managed to make some pretty graphs and am battling through. AI is a mess but having “a drunk mate at the pub” to talk to about this is better than nothing. VERY out of my depth when it comes to “programming” but its a nice way in to discuss it with someone as you go. I think im having some issue with the wrong pins being used for the wrong groups of devices, signals all being pinged at the same time etc but ill battle through.

Thanks for the advice and responses!

Remember that when your mentor is a “drunken mate” you are more likely to do something you will regret.

There are places where you can get some learning with tutorials. Or you can just do what your “drunken mate” suggests. If you ask good questions here, you will probably learn something. If you have AI do your homework, you might get something that works some/most of the time, but likely little understanding of how/why or what to do when it stops working.

You are welcome.
And you still didn’t format the code on your first post..

and it truly amazes me how few new users think of using the search button (the one in top right that looks like a magnifyimg glass) to see if anyone else has had a similar problem

… though I admit that ESPHome is moving quite quickly so be wary of threads that are more than a couple of years old. After all, that is what the AI is looking at and getting all mixed up about.

Sorry, I seem to have turned into a grumpy old man. I should go back to researching LED strips to make a christmas decoration, and stop commenting in this forum.