• Hi @Gordon.
    CODE:

    I2C1.setup({scl:b6, sda:b7});
    
      I2C1.writeTo(0x63, "R,25.3");
      setTimeout(function (e) { getphValue(); }, 1000);
    
    function getphValue() {
      var d = I2C1.readFrom(0x63,7);
      var toChar="";
      var i;
    
      for(i=0; i<d.length; i++) {
        toChar += String.fromCharCode(d[i]);
        //console.log(toChar);
        //console.log("i.length: " + i + " " + "d.length: " + (d.length - 1));
        if(i==(d.length-1)) {
          console.log(toChar);
          toChar="";
          //console.log("toCharVal: " + " " + toChar);
        }
      }
    }
    

    Circuit:

    I removed the 4.7k resisters.

    I have 5.0v wall adapter vcc and gnd hooked up to the IN vcc and gnd on the pwr-iso. OUT from the pwr-iso I have 5v going to the VCC of the ph sensor and GND to the GND of the ph sensor. The power light on the module is on so I know VCC and GND are properly hooked up.

    I have USB from my laptop powering the Espruino board. From B6 of the Espruino to the SCL of the ph sensor and B7 of the Espruino to SDA of the ph sensor.

    This current circuit design produces error:

    >echo(0);
    =undefined
    Uncaught InternalError: Timeout on I2C Write Transmit Mode 2
     at line 8 col 30
      I2C1.writeTo(0x63, "R,25.3");
                                  ^
    in function "onInit" called from line 1 col 8
    onInit();
     
        ^
    

    To test if my PH sensor is working properly, I removed the pwr-iso from the circuit.
    Without pwr-iso circuit design:
    USB from laptop to Espruino USB
    3.3v and GND from Espruino to VCC and GND of ph sensor.
    SDA and SCL from Espruino to SDA and SCL of ph sensor.

    Power light is lit and I can read and write from the ph sensor to the Espruino.

    I have no idea why I get the timeout error when using the pwr-iso. Any ideas?

About

Avatar for d0773d @d0773d started