CrowPanel 5 and Dallas DS18b20 sensors

I would like to connect several DS18b20 sensors to CrowPanel 5" board in order to have temperatures displayed. So far I do not succeed because I have not solved what IO pins are available for OneWire. Have anyone experied and solved this?

«1

Comments

  • I succeed with OneWire bus using IO 10 but the problem is that I lose touch (i2c) capability what I need in my case. OneWire using Pin 38 seems to be unavailable. Is there any ideas how to solve this problem?

  • Dear penatar ,
    Thank you for reaching out. We are sorry for the inconvenience caused.
    Our technical support team is currently looking into the issue in your feedback. Please be patient, and we will get back to you as soon as possible.
    Best regards,

  • Dear Penatar,
    Thank you for your patience while we were looking into this issue.
    The sensor you are using is a 1-Wire interface and cannot be used on the i2c port. The i2c port and the touch function share pins, and both require an i2c interface to be used simultaneously.
    Pin 38 must be connected to a pull-up resistor to be used with a 1-wire sensor. Connect one end of the resistor to the DQ pin of the 1-Wire sensor and the other end to the power high level.
    Thanks!

  • I do have pullup (4.7K) resistor between DQ and 3.3 V. I cannot have any values from OneWire devices if I am using pin38 GPIO-D connector. If I am using pin20 as OneWire (I2C connector) I get correct values (but touch do not work of course). It seems to me that pin38 is defined as output by hardware and because of that it impossible to use it for OneWire. What should I do or Is there anything I can do?

  • @penatar said:
    I do have pullup (4.7K) resistor between DQ and 3.3 V. I cannot have any values from OneWire devices if I am using pin38 GPIO-D connector. If I am using pin20 as OneWire (I2C connector) I get correct values (but touch do not work of course). It seems to me that pin38 is defined as output by hardware and because of that it impossible to use it for OneWire. What should I do or Is there anything I can do?

    Dear penatar,
    Thank you for reaching out.

    Our technical support team is currently looking into the issue in your message. Please be patient, and we will get back to you as soon as possible.

    Thanks! Have a good day!

  • edited May 8

    Dear Penatar,
    Apologize for the delayed response. This pin can be configured as an input, please refer to the following code:

  • I have already done that (using IO38 on GPIO-D connector)! it doesn't work. Do not find any sensors.

  • @penatar said:
    I have already done that (using IO38 on GPIO-D connector)! it doesn't work. Do not find any sensors.

    Dear Penatar,
    Can I see how the pull-up resistor is connected ? Normally, it can be used after it is connected properly . Please take a video and send it to us for further analysis.
    Thanks! Have a good day!

  • What is the difference between pin 20 and pin 38? OneWire connection works if I use pin 20 (I2C). When I configure OneWire to use pin 38 and move the same connector to GPIO-D, no sensors are found. The same OneWire-DS18b20 connection is used in both cases.





  • edited May 10

    ****This is simple test code I have used. : **

    #include <OneWire.h>
    #include <DallasTemperature.h>
    
    // OneWire väylä GPIO20
    #define ONE_WIRE_BUS 20            // in order to test IO38 as OneWire I change this
    
    // Luo OneWire- ja DallasTemperature-oliot
    OneWire oneWire(ONE_WIRE_BUS);
    DallasTemperature sensors(&oneWire);
    
    void setup() {
      Serial.begin(115200);
      Serial.println("DS18B20 reader — CrowPanel 5\"");
    
      sensors.begin();
    
      Serial.print("Sensors found: ");
      Serial.println(sensors.getDeviceCount());
    }
    
    void loop() {
      sensors.requestTemperatures(); // Pyydetään lukemat kaikilta antureilta
    
      int antureita = sensors.getDeviceCount();
      for (int i = 0; i < antureita; i++) {
        float lämpötila = sensors.getTempCByIndex(i);
        Serial.print("Sensor ");
        Serial.print(i);
        Serial.print(": ");
        if (lämpötila == DEVICE_DISCONNECTED_C) {
          Serial.println("No connection ");
        } else {
          Serial.print(lämpötila);
          Serial.println(" °C");
        }
      }
    
      Serial.println("---------------------------");
      delay(2000); // 2 sekunnin välein lukemat
    }
    

    if I use io20 then I receive:

    08:34:25.589 -> load:0x403c8700,len:0x4
    08:34:25.589 -> load:0x403c8704flen:0xc20
    08:34:25.589 -> load:0x403cb700,len:0x30e0
    08:34:25.589 -> entry 0x403c88b8
    08:34:25.664 -> DS18320 reader - CrowPanel 5"
    08:34:25.795 -> Sensors founö: 2
    08:34:26.413    ->  Sensor  0:  26.06   °C
    08:34:26.455    ->  Sensor  1:  26.25   °C
    08:34:26.455 -> ------------------------------
    08:34:29.143    ->  Sensor  0:  26.06   °C
    08:34:29.184    ->  Sensor  1:  26.19   °C
    08:34:29.184 -> ------------------------------
    

    If I use io38 then:

    ESP-ROM:esp32s3-20210327
    Build:Mar 27 2021
    rst:0x1 (FCWERON),boot:Oxa (SPI_FAST_FLASH_BOCT)
    SPIWP:Oxee
    mode:DIO, clock div:l
    load:0x3fce2820,len:0xll8c
    load:0x403c8700,Ien:0x4
    load:0x4 03c87 04, len:0xc20
    load:0x403cb700, Ien:0x30e0
    entry 0x403c88b8
    DS18B20 reader - CrcwPanel 5"
    Sensors found: 0
    
Sign In or Register to comment.