Code that works on Adafruit feather 32u4 Bluefruit le and Arduino Nano doesn't work on Adafruit ESP32 V2

Hi, this is my first time posting on this forum and I am still a beginner at coding Arduino. Awhile back I had code an Adafruit feather 32u4 Bluefruit le to read a the measurements from a dial indicator and send it to my phone via blue tooth. My project is based on the project by sspence here:

https://www.instructables.com/Interfacing-a-Digital-Micrometer-to-a-Microcontrol/

I now want to upgrade to the Adafruit feather ESP32 V2 to make it send the measurements directly to my computer. So first I tried to make the ESP32 V2 read the dial indicator but for some reason measurements that the V2 is showing on serial monitor is wrong. Even though I upload the exact same code that I used to test the Feather 32u4 Bluefruit le, except for changing the pin number.

byte mydata[14];

int req = 32; //mic REQ line goes to pin 5 through q1 (arduino high pulls request line low)
int dat = 13; //mic Data line goes to pin 2
int clk = 12; //mic Clock line goes to pin 3

int i = 0; int j = 0; int k = 0;
int decimal;
float dpp;
int unit;
int sign = 0;
String value_str;
long value_int;
float value;
const unsigned long timeout = 200;


void setup(){
  
  pinMode(req, OUTPUT);
  pinMode(clk, INPUT_PULLUP);
  pinMode(dat, INPUT_PULLUP);

  digitalWrite(req,LOW); // set request at LOW

  Serial.begin(115200);


}

void loop() {

  unsigned long startingtime;
  startingtime = millis();
    
  digitalWrite(req, HIGH);
    
  for (i = 0; i < 13; i++ ) {
    k = 0;
    for (j = 0; j < 4; j++) {

      while ((digitalRead(clk) == LOW) && ((millis() - startingtime) < timeout)){ // hold until clock is high
          //Serial.println("low");
      }
      while ((digitalRead(clk) == HIGH) && ((millis() - startingtime) < timeout)){ // hold until clock is low
          //Serial.println("high");
      }
      bitWrite(k, j, (digitalRead(dat) & 0x1)); // read data bits, and reverse order )
    }
      
    if (i == 0) { 
      digitalWrite(req, LOW);
    }

    mydata[i] = k;

    }
    
    sign = mydata[4];
    value_str = String(mydata[5]) + String(mydata[6]) + String(mydata[7]) + String(mydata[8] + String(mydata[9] + String(mydata[10]))) ;
    decimal = mydata[11];
    unit = mydata[12];

    value_int = value_str.toInt();
    if (decimal == 0) dpp = 1.0;
    if (decimal == 1) dpp = 10.0;
    if (decimal == 2) dpp = 100.0;
    if (decimal == 3) dpp = 1000.0;
    if (decimal == 4) dpp = 10000.0;
    if (decimal == 5) dpp = 100000.0;

    value = value_int / dpp;

    if (sign == 0) {
    Serial.print(value,decimal);
    }
    if (sign == 8) {
    Serial.print("-"); Serial.print(value,decimal);
    }
    if (unit == 0) {
      Serial.println(" mm");
    } else {
      Serial.println(" in");
    }

}

This is what the measurements suppose to look like in serial monitor (coming from Feather 32u4).

07:41:17.235 -> 0.001 mm
07:41:17.327 -> 0.001 mm
07:41:17.420 -> 0.001 mm
07:41:17.513 -> 0.001 mm
07:41:17.604 -> 0.001 mm
07:41:17.744 -> 0.003 mm
07:41:17.836 -> 0.004 mm
07:41:17.928 -> 0.264 mm
07:41:18.022 -> 1.213 mm
07:41:18.116 -> 2.415 mm
07:41:18.210 -> 3.167 mm
07:41:18.303 -> 3.919 mm
07:41:18.397 -> 4.648 mm
07:41:18.491 -> 5.258 mm
07:41:18.583 -> 5.864 mm
07:41:18.675 -> 6.504 mm
07:41:18.773 -> 7.002 mm
07:41:18.864 -> 7.466 mm
07:41:18.956 -> 7.945 mm
07:41:19.049 -> 8.348 mm

This is what I got using the ESP32 V2

11:08:21.203 ->  in
11:08:21.386 ->  in
11:08:21.480 -> 1712.011963 mm
11:08:21.537 ->  in
11:08:21.761 ->  in
11:08:21.854 -> 13.632000 mm
11:08:21.948 ->  in
11:08:22.134 ->  in
11:08:22.227 -> 2001.114014 mm
11:08:22.320 ->  in
11:08:22.544 ->  in
11:08:22.601 -> 7.966000 mm
11:08:22.694 ->  in
11:08:22.881 ->  in
11:08:22.976 -> 45.714000701904 mm

I tried to see what the raw data looks like, but sure if it can tell me or you guys anything. (raw data from feather 32u4)

08:23:07.224 -> 000000030
08:23:07.316 -> 000000030
08:23:07.410 -> 000000230
08:23:07.501 -> 000102630
08:23:07.596 -> 000229130
08:23:07.689 -> 000338630
08:23:07.785 -> 000435430
08:23:07.876 -> 000527930
08:23:07.970 -> 000603030
08:23:08.064 -> 000665430
08:23:08.156 -> 000716530
08:23:08.253 -> 000777630
08:23:08.345 -> 000827830
08:23:08.438 -> 000875430
08:23:08.530 -> 000949130
08:23:08.624 -> 001009130
08:23:08.717 -> 001081630

Raw data from ESP32 V2

08:15:09.902 -> 0026122260
08:15:09.995 -> 30412854120
08:15:10.087 -> 708835693
08:15:10.180 -> 151515151515151515
08:15:10.367 -> 10241468120
08:15:10.461 -> 70888112111
08:15:10.554 -> 151515151515151515
08:15:10.740 -> 001104430
08:15:10.832 -> 1020206120
08:15:10.925 -> 300097007
08:15:11.016 -> 151515151515151515
08:15:11.203 -> 3000413121
08:15:11.297 -> 151515151515151515
08:15:11.484 -> 1001212212120
08:15:11.578 -> 151004131414
08:15:11.671 -> 151515151515151515
08:15:11.858 -> 000254730
08:15:11.951 -> 1002812060
08:15:12.045 -> 1002805120
08:15:12.138 -> 7000121226
08:15:12.232 -> 151515151515151515
08:15:12.418 -> 000226930
08:15:12.512 -> 1008012260
08:15:12.606 -> 3004161193
08:15:12.698 -> 151515151515151515
08:15:12.884 -> 300410139120
08:15:12.977 -> 70010715613
08:15:13.070 -> 151515151515151515
08:15:13.258 -> 001271030
08:15:13.350 -> 1041280081
08:15:13.443 -> 7088111123

I don't understand why the exact same code won't work on ESP32 V2. There is no problem uploading the code, and I tried different pins but the result is still the same. I bought two ESP32 V2 broad and tried the code on both of them and the same thing happen. So I don't think it's a faulty board. Any help will be much appreciated.

I'd not use GPIO_NUM_32 as an output when that pin has been programmed as a analog input pin under the Arduino IDE.

I don't think pin 32 it's an "analog input pin."

I also hook up both ESP32 V2 and feather 32u4 to an oscilloscope to see the what the signals look like and both setups look the same. ESP32 V2 is using that signal wrong some how.

https://docs.espressif.com/projects/esp-idf/en/release-v4.3/esp32/api-reference/peripherals/adc.html

Note:

ADC1:

  • 8 channels: GPIO32 - GPIO39

I switch my req pin (Request Pin) to pin 15 and the raw measurement is still showing up wrong. I tried many combinations of different pins such as:

req 15, clk 20, dat 22
req 15, clk 26, dat 25
req 15, clk 7, dat 8

None of them work.

I don't think the request line is the problem. Because how this thing work is that the arduino board will set request line high(pin 32). This request line goes to one of the pin in the indicator which then start sending clock signal to the clk pin and the 52 bit data stream to the dat pin.

I hooked up the oscilloscope the dat pin and clk pin. I tested this when my pin setup was req 32, clk 12, dat 13. The clock signal and data that comes from the dial indicator is stable and looks like the ones from when I test the Feather 32u4.

From ESP32 V2. Yellow is the clock line(Pin 12). Blue is the data line(Pin 13). I know the request line(Pin 32) works because if it doesn't, I won't be getting any signal from the dial indicator at all.

So, i don't think the ADC pin is the problem.

From clock line and data line of Feather 32u4.

Update,
I made some progress. I was stuck and didn't know what to do so I tried add 10k ohm resisters to the data and clock line(Pin 13, 12) coming in to the esp32 V2 board, and got better reading from doing that. Not sure why that helps, but the problem is still not completely fixed. After getting good reading from the digital indicator for accouple seconds the readings seem to double up and chances two more times for a minute or two before turning back to normal and restarting the cycle. The only way to get it to read normal again is to turn off and on the digital indicator or wait that couple minutes. I tried changing the resistance to 1k, 5k and 20k ohm but that didn't seem to make much difference.

Picture of my circuit diagram. Note: The three resisters in the drawing are actually 10k not 1k ohm.

The Raw reading from the digital indicator.

07:45:46.454 ->  DTI1 000000030  //This is the correct reading.
07:45:46.549 ->  DTI1 000000030
07:45:46.641 ->  DTI1 000000030
07:45:46.733 ->  DTI1 000000030
07:45:46.827 ->  DTI1 000000030
07:45:46.920 ->  DTI1 000000030
07:45:47.014 ->  DTI1 000000030
07:45:47.105 ->  DTI1 000000030
07:45:47.198 ->  DTI1 000000030
07:45:47.293 ->  DTI1 000000030
07:45:47.386 ->  DTI1 000000030
07:45:47.481 ->  DTI1 000000030
07:45:47.572 ->  DTI1 000000030
07:45:47.664 ->  DTI1 000000030
07:45:47.756 ->  DTI1 000000030
07:45:47.849 ->  DTI1 000000030
07:45:47.943 ->  DTI1 000000030
07:45:48.038 ->  DTI1 000000030
07:45:48.130 ->  DTI1 000000030
07:45:48.224 ->  DTI1 000000030
07:45:48.317 ->  DTI1 000000030
07:45:48.410 ->  DTI1 000000030
07:45:48.504 ->  DTI1 000000030
07:45:48.596 ->  DTI1 000000030
07:45:48.690 ->  DTI1 000000030
07:45:48.783 ->  DTI1 000000030
07:45:48.875 ->  DTI1 000000030
07:45:48.969 ->  DTI1 000000030
07:45:49.062 ->  DTI1 000000030
07:45:49.156 ->  DTI1 000000030
07:45:49.250 ->  DTI1 000000030
07:45:49.343 ->  DTI1 000000030
07:45:49.434 ->  DTI1 000000030
07:45:49.526 ->  DTI1 000000030
07:45:49.619 ->  DTI1 000000030
07:45:49.712 ->  DTI1 000000030
07:45:49.805 ->  DTI1 000000030
07:45:49.899 ->  DTI1 000000030
07:45:49.992 ->  DTI1 000000030
07:45:50.086 ->  DTI1 000000030
07:45:50.180 ->  DTI1 000000030
07:45:50.275 ->  DTI1 000000030
07:45:50.367 ->  DTI1 000000030
07:45:50.461 ->  DTI1 000000030
07:45:50.554 ->  DTI1 000000030
07:45:50.648 ->  DTI1 000000030
07:45:50.741 ->  DTI1 000000030
07:45:50.835 ->  DTI1 000000030
07:45:50.974 ->  DTI1 000000030
07:45:51.067 ->  DTI1 000000030
07:45:51.159 ->  DTI1 000000030
07:45:51.251 ->  DTI1 000000030
07:45:51.346 ->  DTI1 000000030
07:45:51.440 ->  DTI1 000000030
07:45:51.535 ->  DTI1 000000030
07:45:51.626 ->  DTI1 000000030
07:45:51.719 ->  DTI1 000000030
07:45:51.811 ->  DTI1 000000030
07:45:51.903 ->  DTI1 000000030
07:45:51.996 ->  DTI1 000000030
07:45:52.089 ->  DTI1 000000030
07:45:52.184 ->  DTI1 000000030
07:45:52.276 ->  DTI1 000000030
07:45:52.368 ->  DTI1 000000030
07:45:52.461 ->  DTI1 000000030
07:45:52.552 ->  DTI1 000000030
07:45:52.647 ->  DTI1 000000030
07:45:52.741 ->  DTI1 000000030
07:45:52.833 ->  DTI1 000000030
07:45:52.926 ->  DTI1 000000030
07:45:53.019 ->  DTI1 000000030
07:45:53.113 ->  DTI1 000000030
07:45:53.205 ->  DTI1 000000030
07:45:53.298 ->  DTI1 000000030
07:45:53.390 ->  DTI1 000000030
07:45:53.483 ->  DTI1 000000030
07:45:53.577 ->  DTI1 000000030
07:45:53.671 ->  DTI1 000000030
07:45:53.765 ->  DTI1 000000030
07:45:53.857 ->  DTI1 000000030
07:45:53.950 ->  DTI1 000000030
07:45:54.043 ->  DTI1 000000030
07:45:54.136 ->  DTI1 000000030
07:45:54.229 ->  DTI1 000000030
07:45:54.321 ->  DTI1 000000030
07:45:54.415 ->  DTI1 000000030
07:45:54.508 ->  DTI1 000000030
07:45:54.602 ->  DTI1 000000030
07:45:54.693 ->  DTI1 000000030
07:45:54.787 ->  DTI1 000000030
07:45:54.880 ->  DTI1 000000030
07:45:54.976 ->  DTI1 000000030
07:45:55.068 ->  DTI1 000000030
07:45:55.160 ->  DTI1 000000030
07:45:55.252 ->  DTI1 000000030
07:45:55.345 ->  DTI1 000000030
07:45:55.439 ->  DTI1 000000030
07:45:55.531 ->  DTI1 000000030
07:45:55.627 ->  DTI1 000000030
07:45:55.718 ->  DTI1 000000030
07:45:55.810 ->  DTI1 000000030
07:45:55.904 ->  DTI1 000000030
07:45:55.998 ->  DTI1 000000030
07:45:56.091 ->  DTI1 000000030
07:45:56.184 ->  DTI1 000000030
07:45:56.277 ->  DTI1 000000030
07:45:56.370 ->  DTI1 000000030
07:45:56.464 ->  DTI1 000000030
07:45:56.556 ->  DTI1 000000030
07:45:56.649 ->  DTI1 000000030
07:45:56.741 ->  DTI1 000000030
07:45:56.881 ->  DTI1 000000030
07:45:56.975 ->  DTI1 000000030
07:45:57.022 ->  DTI1 000000030
07:45:57.115 ->  DTI1 000000030
07:45:57.208 ->  DTI1 000000030
07:45:57.352 ->  DTI1 000000030
07:45:57.444 ->  DTI1 000000030
07:45:57.536 ->  DTI1 000000030
07:45:57.632 ->  DTI1 000000030
07:45:57.724 ->  DTI1 000000030
07:45:57.816 ->  DTI1 000000030
07:45:57.909 ->  DTI1 000000030
07:45:58.002 ->  DTI1 000000030
07:45:58.096 ->  DTI1 000000030
07:45:58.190 ->  DTI1 000000030
07:45:58.285 ->  DTI1 000000030
07:45:58.379 ->  DTI1 000000030
07:45:58.475 ->  DTI1 000000030
07:45:58.565 ->  DTI1 000000030
07:45:58.658 ->  DTI1 000000030
07:45:58.753 ->  DTI1 000000030
07:45:58.844 ->  DTI1 000000030
07:45:58.938 ->  DTI1 000000030
07:45:59.032 ->  DTI1 000000030
07:45:59.123 ->  DTI1 000000030
07:45:59.217 ->  DTI1 000000030
07:45:59.311 ->  DTI1 000000030
07:45:59.404 ->  DTI1 000000030
07:45:59.497 ->  DTI1 000000030
07:45:59.590 ->  DTI1 000000030
07:45:59.682 ->  DTI1 000000030
07:45:59.775 ->  DTI1 000000030
07:45:59.869 ->  DTI1 000000030
07:45:59.962 ->  DTI1 000000030
07:46:00.030 ->  DTI1 000000030
07:46:00.119 ->  DTI1 000000030
07:46:00.212 ->  DTI1 000000030
07:46:00.305 ->  DTI1 000000030
07:46:00.399 ->  DTI1 000000030
07:46:00.493 ->  DTI1 000000030
07:46:00.587 ->  DTI1 000000030
07:46:00.680 ->  DTI1 000000030
07:46:00.774 ->  DTI1 000000030
07:46:00.869 ->  DTI1 000000030
07:46:00.961 ->  DTI1 000000030
07:46:01.054 ->  DTI1 000000030
07:46:01.148 ->  DTI1 000000030
07:46:01.244 ->  DTI1 000000030
07:46:01.335 ->  DTI1 000000030
07:46:01.429 ->  DTI1 000000030
07:46:01.523 ->  DTI1 000000030
07:46:01.617 ->  DTI1 000000030
07:46:01.710 ->  DTI1 000000030
07:46:01.803 ->  DTI1 000000030
07:46:01.897 ->  DTI1 000000030
07:46:02.036 ->  DTI1 000000030
07:46:02.084 ->  DTI1 000000030
07:46:02.223 ->  DTI1 000000030
07:46:02.315 ->  DTI1 000000030
07:46:02.407 ->  DTI1 000000030
07:46:02.502 ->  DTI1 000000030
07:46:02.595 ->  DTI1 000000030
07:46:02.688 ->  DTI1 000000030
07:46:02.781 ->  DTI1 000000030
07:46:02.874 ->  DTI1 000000030
07:46:02.969 ->  DTI1 000000030
07:46:03.062 ->  DTI1 000000030
07:46:03.157 ->  DTI1 000000030
07:46:03.249 ->  DTI1 000000030
07:46:03.342 ->  DTI1 000000030
07:46:03.436 ->  DTI1 000000030
07:46:03.531 ->  DTI1 000000030
07:46:03.624 ->  DTI1 000000030
07:46:03.718 ->  DTI1 000000030
07:46:03.811 ->  DTI1 000000030
07:46:03.904 ->  DTI1 000000030
07:46:03.996 ->  DTI1 000000030
07:46:04.090 ->  DTI1 000000030
07:46:04.184 ->  DTI1 000000030
07:46:04.277 ->  DTI1 000000030
07:46:04.369 ->  DTI1 000000030
07:46:04.461 ->  DTI1 000000030
07:46:04.555 ->  DTI1 000000030
07:46:04.647 ->  DTI1 000000030
07:46:04.738 ->  DTI1 000000030
07:46:04.831 ->  DTI1 000000030
07:46:04.924 ->  DTI1 000000030
07:46:05.017 ->  DTI1 000000030
07:46:05.112 ->  DTI1 000000030
07:46:05.204 ->  DTI1 000000030
07:46:05.295 ->  DTI1 000000030
07:46:05.388 ->  DTI1 000000030
07:46:05.481 ->  DTI1 000000030
07:46:05.574 ->  DTI1 000000030
07:46:05.666 ->  DTI1 000000030
07:46:05.760 ->  DTI1 000000030
07:46:05.852 ->  DTI1 000000030
07:46:05.944 ->  DTI1 000000030
07:46:06.037 ->  DTI1 000000030
07:46:06.131 ->  DTI1 000000030
07:46:06.222 ->  DTI1 000000030
07:46:06.314 ->  DTI1 000000030
07:46:06.408 ->  DTI1 000000030
07:46:06.500 ->  DTI1 000000030
07:46:06.593 ->  DTI1 000000030
07:46:06.687 ->  DTI1 000000030
07:46:06.779 ->  DTI1 000000030
07:46:06.873 ->  DTI1 000000030
07:46:06.967 ->  DTI1 000000030
07:46:07.060 ->  DTI1 000000030
07:46:07.155 ->  DTI1 000000030
07:46:07.249 ->  DTI1 000000030
07:46:07.343 ->  DTI1 000000030
07:46:07.436 ->  DTI1 000000030
07:46:07.530 ->  DTI1 000000030
07:46:07.623 ->  DTI1 000000030
07:46:07.717 ->  DTI1 000000030
07:46:07.810 ->  DTI1 000000030
07:46:07.904 ->  DTI1 000000030
07:46:07.996 ->  DTI1 000000030
07:46:08.088 ->  DTI1 000000030
07:46:08.180 ->  DTI1 000000030
07:46:08.274 ->  DTI1 000000030
07:46:08.368 ->  DTI1 000000030
07:46:08.462 ->  DTI1 000000030
07:46:08.554 ->  DTI1 000000030
07:46:08.649 ->  DTI1 000000030
07:46:08.741 ->  DTI1 000000030
07:46:08.836 ->  DTI1 000000030
07:46:08.929 ->  DTI1 000000030
07:46:09.025 ->  DTI1 000000030
07:46:09.116 ->  DTI1 000000030
07:46:09.210 ->  DTI1 000000030
07:46:09.303 ->  DTI1 000000030
07:46:09.396 ->  DTI1 000000030
07:46:09.491 ->  DTI1 000000030
07:46:09.585 ->  DTI1 000000030
07:46:09.677 ->  DTI1 000000030
07:46:09.814 ->  DTI1 000000030
07:46:09.908 ->  DTI1 000000030
07:46:10.001 ->  DTI1 000000030
07:46:10.094 ->  DTI1 000000030
07:46:10.188 ->  DTI1 000000030
07:46:10.281 ->  DTI1 000000030
07:46:10.375 ->  DTI1 000000030
07:46:10.468 ->  DTI1 000000030
07:46:10.558 ->  DTI1 000000030
07:46:10.654 ->  DTI1 000000030
07:46:10.747 ->  DTI1 000000030
07:46:10.842 ->  DTI1 000000030
07:46:10.935 ->  DTI1 000000030
07:46:11.029 ->  DTI1 000000030
07:46:11.124 ->  DTI1 000000030
07:46:11.220 ->  DTI1 000000030
07:46:11.311 ->  DTI1 100000060   //Starts doubling
07:46:11.406 ->  DTI1 100000060
07:46:11.497 ->  DTI1 100000060
07:46:11.591 ->  DTI1 100000060
07:46:11.685 ->  DTI1 100000060
07:46:11.779 ->  DTI1 100000060
07:46:11.871 ->  DTI1 100000060
07:46:11.965 ->  DTI1 100000060
07:46:12.057 ->  DTI1 100000060
07:46:12.151 ->  DTI1 100000060
07:46:12.243 ->  DTI1 100000060
07:46:12.336 ->  DTI1 100000060
07:46:12.430 ->  DTI1 100000060
07:46:12.523 ->  DTI1 100000060
07:46:12.614 ->  DTI1 100000060
07:46:12.708 ->  DTI1 100000060
07:46:12.801 ->  DTI1 100000060
07:46:12.895 ->  DTI1 100000060
07:46:12.988 ->  DTI1 100000060
07:46:13.084 ->  DTI1 100000060
07:46:13.176 ->  DTI1 100000060
07:46:13.267 ->  DTI1 100000060
07:46:13.361 ->  DTI1 100000060
07:46:13.455 ->  DTI1 100000060
07:46:13.547 ->  DTI1 100000060
07:46:13.645 ->  DTI1 100000060
07:46:13.735 ->  DTI1 100000060
07:46:13.829 ->  DTI1 100000060
07:46:13.921 ->  DTI1 100000060
07:46:14.014 ->  DTI1 100000060
07:46:14.108 ->  DTI1 100000060
07:46:14.200 ->  DTI1 100000060
07:46:14.292 ->  DTI1 100000060
07:46:14.384 ->  DTI1 100000060
07:46:14.477 ->  DTI1 100000060
07:46:14.571 ->  DTI1 100000060
07:46:14.665 ->  DTI1 100000060
07:46:14.757 ->  DTI1 100000060
07:46:14.851 ->  DTI1 100000060
07:46:14.944 ->  DTI1 100000060
07:46:15.038 ->  DTI1 100000060
07:46:15.130 ->  DTI1 100000060
07:46:15.224 ->  DTI1 100000060
07:46:15.317 ->  DTI1 100000060
07:46:15.410 ->  DTI1 100000060
07:46:15.502 ->  DTI1 100000060
07:46:15.595 ->  DTI1 1000000120
07:46:15.690 ->  DTI1 3000000120  //Double again?
07:46:15.782 ->  DTI1 3000000120
07:46:15.873 ->  DTI1 3000000120
07:46:15.966 ->  DTI1 3000000120
07:46:16.060 ->  DTI1 3000000120
07:46:16.154 ->  DTI1 3000000120
07:46:16.247 ->  DTI1 3000000120
07:46:16.340 ->  DTI1 3000000120
07:46:16.433 ->  DTI1 3000000120
07:46:16.527 ->  DTI1 3000000120
07:46:16.619 ->  DTI1 3000000120
07:46:16.712 ->  DTI1 3000000120
07:46:16.808 ->  DTI1 3000000120
07:46:16.900 ->  DTI1 3000000120
07:46:16.991 ->  DTI1 3000000120
07:46:17.086 ->  DTI1 3000000120
07:46:17.179 ->  DTI1 3000000120
07:46:17.272 ->  DTI1 3000000120
07:46:17.364 ->  DTI1 3000000120
07:46:17.456 ->  DTI1 3000000120
07:46:17.550 ->  DTI1 3000000120
07:46:17.644 ->  DTI1 3000000120
07:46:17.781 ->  DTI1 3000000120
07:46:17.877 ->  DTI1 3000000120
07:46:17.971 ->  DTI1 3000000120
07:46:18.019 ->  DTI1 3000000120
07:46:18.113 ->  DTI1 3000000120
07:46:18.251 ->  DTI1 3000000120
07:46:18.344 ->  DTI1 3000000120
07:46:18.437 ->  DTI1 3000000120
07:46:18.530 ->  DTI1 3000000120
07:46:18.624 ->  DTI1 3000000120
07:46:18.715 ->  DTI1 3000000120
07:46:18.809 ->  DTI1 3000000120
07:46:18.903 ->  DTI1 3000000120
07:46:18.995 ->  DTI1 3000000120
07:46:19.088 ->  DTI1 3000000120
07:46:19.182 ->  DTI1 3000000120
07:46:19.276 ->  DTI1 3000000120
07:46:19.368 ->  DTI1 3000000120
07:46:19.462 ->  DTI1 3000000120
07:46:19.556 ->  DTI1 3000000120
07:46:19.648 ->  DTI1 3000000120
07:46:19.744 ->  DTI1 3000000120
07:46:19.837 ->  DTI1 3000000120
07:46:19.930 ->  DTI1 3000000120
07:46:20.022 ->  DTI1 3000000120
07:46:20.115 ->  DTI1 3000000120
07:46:20.208 ->  DTI1 3000000120
07:46:20.302 ->  DTI1 3000000120
07:46:20.396 ->  DTI1 3000000120
07:46:20.489 ->  DTI1 3000000120
07:46:20.581 ->  DTI1 3000000120
07:46:20.676 ->  DTI1 3000000120
07:46:20.769 ->  DTI1 3000000120
07:46:20.862 ->  DTI1 3000000120
07:46:20.955 ->  DTI1 3000000120
07:46:21.047 ->  DTI1 3000000120
07:46:21.142 ->  DTI1 3000000120
07:46:21.235 ->  DTI1 3000000120
07:46:21.328 ->  DTI1 3000000120
07:46:21.420 ->  DTI1 3000000120
07:46:21.514 ->  DTI1 3000000120
07:46:21.607 ->  DTI1 3000000120
07:46:21.702 ->  DTI1 3000000120
07:46:21.794 ->  DTI1 3000000120
07:46:21.888 ->  DTI1 3000000120
07:46:21.983 ->  DTI1 3000000120
07:46:22.075 ->  DTI1 3000000120
07:46:22.167 ->  DTI1 3000000120
07:46:22.261 ->  DTI1 3000000120
07:46:22.355 ->  DTI1 3000000120
07:46:22.449 ->  DTI1 3000000120
07:46:22.541 ->  DTI1 3000000120
07:46:22.635 ->  DTI1 3000000120
07:46:22.728 ->  DTI1 3000000120
07:46:22.822 ->  DTI1 3000000120
07:46:22.915 ->  DTI1 3000000120
07:46:23.007 ->  DTI1 3000000120
07:46:23.102 ->  DTI1 3000000120
07:46:23.195 ->  DTI1 3000000120
07:46:23.288 ->  DTI1 3000000120
07:46:23.380 ->  DTI1 3000000120
07:46:23.474 ->  DTI1 3000000120
07:46:23.567 ->  DTI1 3000000120
07:46:23.661 ->  DTI1 3000000120
07:46:23.754 ->  DTI1 3000000120
07:46:23.848 ->  DTI1 3000000120
07:46:23.942 ->  DTI1 3000000120
07:46:24.034 ->  DTI1 3000000120
07:46:24.126 ->  DTI1 3000000120
07:46:24.219 ->  DTI1 3000000120
07:46:24.312 ->  DTI1 3000000120
07:46:24.406 ->  DTI1 3000000120
07:46:24.498 ->  DTI1 3000000120
07:46:24.590 ->  DTI1 3000000120
07:46:24.683 ->  DTI1 3000000120
07:46:24.776 ->  DTI1 3000000120
07:46:24.871 ->  DTI1 3000000120
07:46:24.965 ->  DTI1 3000000120
07:46:25.059 ->  DTI1 3000000120
07:46:25.153 ->  DTI1 3000000120
07:46:25.247 ->  DTI1 3000000120
07:46:25.340 ->  DTI1 3000000120
07:46:25.434 ->  DTI1 3000000120
07:46:25.526 ->  DTI1 3000000120
07:46:25.620 ->  DTI1 3000000120
07:46:25.713 ->  DTI1 3000000120
07:46:25.805 ->  DTI1 3000000120
07:46:25.898 ->  DTI1 3000000120
07:46:25.990 ->  DTI1 3000000120
07:46:26.084 ->  DTI1 3000000120
07:46:26.176 ->  DTI1 3000000120
07:46:26.270 ->  DTI1 3000000120
07:46:26.364 ->  DTI1 3000000120
07:46:26.457 ->  DTI1 3000000120
07:46:26.551 ->  DTI1 3000000120
07:46:26.643 ->  DTI1 3000000120
07:46:26.739 ->  DTI1 3000000120
07:46:26.831 ->  DTI1 3000000120
07:46:26.924 ->  DTI1 3000000120
07:46:27.019 ->  DTI1 3000000120
07:46:27.157 ->  DTI1 3000000120
07:46:27.251 ->  DTI1 3000000120
07:46:27.343 ->  DTI1 3000000120
07:46:27.440 ->  DTI1 3000000120
07:46:27.528 ->  DTI1 3000000120
07:46:27.624 ->  DTI1 3000000120
07:46:27.717 ->  DTI1 3000000120
07:46:27.809 ->  DTI1 3000000120
07:46:27.902 ->  DTI1 3000000120
07:46:27.997 ->  DTI1 3000000120
07:46:28.090 ->  DTI1 3000000120
07:46:28.183 ->  DTI1 3000000120
07:46:28.276 ->  DTI1 3000000120
07:46:28.369 ->  DTI1 3000000120
07:46:28.461 ->  DTI1 3000000120
07:46:28.554 ->  DTI1 3000000121
07:46:28.647 ->  DTI1 700000081   //Another change
07:46:28.740 ->  DTI1 700000081
07:46:28.834 ->  DTI1 700000081
07:46:28.926 ->  DTI1 700000081
07:46:29.021 ->  DTI1 700000081
07:46:29.114 ->  DTI1 700000081
07:46:29.208 ->  DTI1 700000081
07:46:29.300 ->  DTI1 700000081
07:46:29.392 ->  DTI1 700000081
07:46:29.486 ->  DTI1 700000081
07:46:29.581 ->  DTI1 700000081
07:46:29.673 ->  DTI1 700000081
07:46:29.767 ->  DTI1 700000081
07:46:29.860 ->  DTI1 700000081
07:46:29.952 ->  DTI1 700000081
07:46:30.045 ->  DTI1 700000081
07:46:30.139 ->  DTI1 700000081
07:46:30.232 ->  DTI1 700000081
07:46:30.325 ->  DTI1 700000081
07:46:30.418 ->  DTI1 700000081
07:46:30.512 ->  DTI1 700000081
07:46:30.606 ->  DTI1 700000081
07:46:30.699 ->  DTI1 700000081
07:46:30.792 ->  DTI1 700000081
07:46:30.886 ->  DTI1 700000081
07:46:30.982 ->  DTI1 700000081
07:46:31.072 ->  DTI1 700000081
07:46:31.166 ->  DTI1 700000081
07:46:31.259 ->  DTI1 700000081
07:46:31.352 ->  DTI1 700000081
07:46:31.446 ->  DTI1 700000081
07:46:31.541 ->  DTI1 700000081
07:46:31.635 ->  DTI1 700000081
07:46:31.730 ->  DTI1 700000081
07:46:31.821 ->  DTI1 700000081
07:46:31.914 ->  DTI1 700000081
07:46:32.006 ->  DTI1 700000081
07:46:32.100 ->  DTI1 700000081
07:46:32.192 ->  DTI1 700000081
07:46:32.287 ->  DTI1 700000081
07:46:32.380 ->  DTI1 700000081
07:46:32.473 ->  DTI1 700000081
07:46:32.565 ->  DTI1 700000081
07:46:32.659 ->  DTI1 700000081
07:46:32.752 ->  DTI1 700000081
07:46:32.845 ->  DTI1 700000081
07:46:32.938 ->  DTI1 700000081
07:46:33.032 ->  DTI1 700000081
07:46:33.125 ->  DTI1 700000081
07:46:33.219 ->  DTI1 700000081
07:46:33.313 ->  DTI1 700000081
07:46:33.405 ->  DTI1 700000081
07:46:33.498 ->  DTI1 151515151515151515  
07:46:33.684 ->  DTI1 000000030 //It resets due to this part of the code
07:46:33.778 ->  DTI1 000000030 //"&& ((millis() - startingtime) < timeout))."
07:46:33.871 ->  DTI1 000000030 //The time out is set to 200 ms, for some reason, 
07:46:33.965 ->  DTI1 000000030 //the clock line goes low or high for longer than 
07:46:34.058 ->  DTI1 000000030 //200ms so that reset the loop. I think. 
07:46:34.151 ->  DTI1 000000030 
07:46:34.244 ->  DTI1 000000030
07:46:34.337 ->  DTI1 000000030

Since adding resisters improve the reading by a bit I feel like the voltage from the digital indicator coming in to the ESP32 V2 might be the problem. So I measure the two line and this is what I got.

  • 1.5 - 1.7 volt coming in through the data line(Pin13).

  • about 3V from the clock line(Pin 12).

That's all I have right now, if you guys know anything or have an idea for trying some thing out please let me know.

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