GithubHelp home page GithubHelp logo

latonita / esphome-ina228 Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 2.0 48 KB

Esphome component for digital power monitors INA228, INA229, INA237, INA238, INA239

Python 25.70% C++ 74.30%
charge current esphome ina228 ina238 monitor power sense ina229 ina237

esphome-ina228's People

Contributors

latonita avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tahc81 firefly220

esphome-ina228's Issues

Compilation for SPI fails

Hello,
Not sure what happens, but code for SPI version fails to compile. Code (shortened):

esphome:
  name: solar-battery
  friendly_name: Solar Battery
  comment: ${device_description}
esp32:
  board: esp32dev
  framework:
    type: esp-idf

external_components:
  - source: github://syssi/esphome-jk-bms@main
  - source: github://syssi/esphome-jbd-bms@main
  - source: github://latonita/esphome-ina228@main
    components: [ina2xx_base, ina2xx_i2c]
    refresh: 0s

spi:
    clk_pin: GPIO27
    mosi_pin: GPIO26
    miso_pin: GPIO25
i2c:
  sda: GPIO18
  scl: GPIO19

sensor:
  - platform: ina2xx_spi
    cs_pin: GPIO33
    shunt_resistance: 0.001130 ohm
    max_current: 40 A
    adc_range: 0
    adc_time: 4120 us
    adc_averaging: 128
    temperature_coefficient: 50

image

If I change sensor platform to ina2xx_i2c and add replace cs_pin: GPIO33 with address: 0x40 code compiles

Also, there seems to be missing support for multiple SPI and I2C buses.

Power value not inverting

First of all thank you so much for building this. I've been working on hardware since last summer and I'm not much of a developer. I was looking to get someone to help me finish the work I had a friend do back then and decided to double check github and here this is. Wonderful work, and I think i'm gonna move from the INA237 to the INA238 in my next prototype.

Anyways, I'm getting great results so far, but the power value doesn't go negative when running in reverse, but shuntV and current do. I've included a screenshot.
Screenshot 2024-02-12 at 8 01 58 AM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.