logo elektroda
logo elektroda
X
logo elektroda

Arduino Sketch for BL0937 Simulator on ESP-WROOM-32 for OpenBeken Testing

divadiow 1044 2
ADVERTISEMENT
  • Helpful post
    #1 21459594
    divadiow
    Level 38  
    Posts: 4908
    Help: 430
    Rate: 872
    Here's something GPT and I have been working on to create a BL0937 simulator for OpenBeken testing across different platforms. It's an Arduino sketch that runs on an ESP-WROOM-32 and is currently connected to an RTL8720DN/BW16E NiceMCU_RTL8720_V1 running OpenRTL. The sketch uses PWM to simulate CF, CF1, and SEL, allowing OpenBeken to interpret the signals as if a real BL0937 power monitoring chip were present.

    The readings aren't exactly realistic yet, but this is the closest I've gotten so far.
    Screenshot of the interface showing data for the OpenRTL8720D_FFFFFFFF device.

    Pin assignments and setup details can be found in the comments of the sketch.

    Feel free to use, improve, or modify it as needed—any feedback is welcome!

    Code: Arduino
    Log in, to see the code
  • ADVERTISEMENT
  • #2 21461976
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14460
    Help: 650
    Rate: 12470
    Interesting, is this on default OBK BL0937 calibration?

    It should be possible to even hand-tune it to give better results, but you'd also need to test different simulated powers/voltages/currents.

    Btw, what happened to your device MAC?
    Helpful post? Buy me a coffee.
  • #3 21462889
    divadiow
    Level 38  
    Posts: 4908
    Help: 430
    Rate: 872
    p.kaczmarek2 wrote:
    Interesting, is this on default OBK BL0937 calibration?

    yes. nothing tweaked but the Arduino code.
    p.kaczmarek2 wrote:
    Btw, what happened to your device MAC?

    this was put down to no mac in efuse https://www.elektroda.com/rtvforum/topic4093142-210.html#21449647
    is your BW16E not the same?
ADVERTISEMENT