ESP8266 I2C Issue D1Mini vs. ESP-01s

Hi,

I bought a DFR0971 I2C 2-channel DAC and am currently trying to hook that up to an ESP-01S using GPIO 0 and GPIO 2 as SDA and SCL. For initial setup I used the sample code provided by the manufacturer below.

#include "DFRobot_GP8403.h"
DFRobot_GP8403 dac(&Wire,0x58);

void setup() {
  Serial.begin(115200);
  while(dac.begin()!=0){
    Serial.println("init error");
    delay(1000);
   }
  Serial.println("init succeed");
  dac.setDACOutRange(dac.eOutputRange10V);//Set the output range as 0-10V
  dac.setDACOutVoltage(1433,0);//The DAC value for 3.5V output in OUT0 channel
  delay(1000);
  dac.store(); //Save the set 3.5V voltage inside the chip
}

void loop(){

}

Using the code above on an ESP8266 d1 mini board on GPIO 0 and GPIO 2 works just fine. The measured DAC voltage on channel 0 of the DAC is 3.5V while the one on channel 1 is 0V. Using the same code on an ESP-01S using the same GPIO pins however does not work. The DAC is recognized ("init succeed"), but the measured voltage on the DAC channels is 10V and 1.4V, respectively. I already tried multiple d1 mini and ESP-01S boards and even removed the LED on one of the ESP-01S boards because it is connected to GPIO2 and I was suspecting the issue being related to that. However, the issue remains. FYI I changed the standard I2C Pins to 0 and 2 in the generic board .h file and used that for flashing.

Anyone an idea on why it works on a d1 mini and not on an ESP-01S?

different pullup resistors values on boot config pins io 0 and io 2?

btw: I guess you measure 1.0V not 10V

I am using the same config for both since I am using the generic ESP8266 board files for the flash...

It's 10V. It is a 0-10V DAC.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.