logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

ESP8266 and ADE7953 in Shelly 2.5 - code/library for reading data

G.A.P.A 2784 9
Best answers

How can I read power, voltage and current from the ADE7953 in a Shelly 2.5 using an ESP8266?

Use an ADE7953 ESP8266 library, install its files as a separate Arduino library folder, include `ADE7953_ESP82.h`, initialise the chip with `Ade7953_init()` in `setup()`, and then call `Ade7953_getEnergy()`, `Ade7953_getCurrent()`, `Ade7953_getVoltage()` and `Ade7953_getActivePower()` when needed [#18707115] For the Shelly 2.5, the ESP8266 I2C pins are GPIO12 (SDA) and GPIO14 (SCL), so the default GPIO4/GPIO5 settings in `i2c_jk.c` must be changed to those pins; this library does not use `Wire.begin(12, 14)` [#18710939] One user confirmed that the needed places were hardcoded to 4 and 5 in the library, and after replacing them with 12 and 14 the readings worked [#18711255] The same user noted that the values still need scaling, with voltage already OK and current needing scaling [#18711255]
Summary generated by AI based on the discussion content.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18707039
    G.A.P.A
    Level 16  
    Posts: 302
    Help: 7
    Rate: 66
    Hi
    I'm looking for help on how to support the ADE7953 via the ESP8266.
    I want to use the Shelly 2.5 module which has the ADE7953 built in, and all I have been able to figure out are the pins, 12 I2C SDA, 14 I2C SCL, 16 ADE7953 IRQ.

    Does anyone have code or a library with which to make power, voltage and current readings?

    Alternatively, perhaps someone would like to undertake to write such a piece of code, I will make the module available to Shelly for testing.

    Maciek
  • ADVERTISEMENT
  • ADVERTISEMENT
  • ADVERTISEMENT
  • Helpful post
    #4 18707115
    Anonymous
    Level 1  
  • #5 18707450
    G.A.P.A
    Level 16  
    Posts: 302
    Help: 7
    Rate: 66
    Thanks, I'll give it a try and let you know :)
  • ADVERTISEMENT
  • #6 18709086
    Anonymous
    Level 1  
  • #8 18710143
    G.A.P.A
    Level 16  
    Posts: 302
    Help: 7
    Rate: 66
    The second library I also found, the reading doesn't work, and in addition something is sewn inside the library, as soon as the code is uploaded the relay is driven, so the library uses the pin it needs at some point.

    I will try with the first one.
  • Helpful post
    #9 18710939
    Anonymous
    Level 1  
  • #10 18711255
    G.A.P.A
    Level 16  
    Posts: 302
    Help: 7
    Rate: 66
    Hi,
    I sat down today and started looking at the I2C library because I suspected there was a problem with the communication since no value was being written to the variable.
    The place you specified was problematic, I only noticed that further down in the code the variables given during initialisation (i2c_master_gpio_init(12,14);) are substituted, up to a certain point they are hard typed (4 and 5).

    After the change everything laughs fine, I still need to scale the data - so far voltage is ok, current to scale.

    Thank you very much for your invaluable help !

Topic summary

✨ The discussion revolves around integrating the ADE7953 energy monitoring chip with the ESP8266 microcontroller using the Shelly 2.5 module. The user seeks assistance in reading power, voltage, and current data via I2C communication. Several resources are shared, including a GitHub library specifically for ADE7953 with ESP8266 support. Instructions for setting up the library in the Arduino IDE are provided, detailing the necessary files and initialization functions. Users also discuss minor errors in the library files and suggest modifications to accommodate the specific GPIO pins used for I2C. The conversation highlights troubleshooting steps and adjustments made to ensure proper communication and data scaling.
Summary generated by AI based on the discussion content.
ADVERTISEMENT