Connecting temp sensor DS18B20 direct to A grove port - 5V supply vs 3.3v logic

  • Hi guys

    I would like to use ubiquitous DS18B20 temp sensors (dallas 1-wire) connecting directly to the M5stack core or M5 stickC core I2C port

    Sensor works perfectly with power supply ranging from 3 to 5.5v, on the grove I2C connector I can use 5V power but the SCL/SDA lines (will use one to read the sensor) connected to the ESP32 are 3.3v logic

    Any ideas on how to manage such a situation in general? How to manage 3.3v external logic with 5V power supply from the expansion port ?

    possible option I see..
    -partition resistor
    -clamp diode (TVS, Zener)
    -level shifter
    -3.3v LDO on the external circuit

    any suggestion is appreciated

  • Hi @arzaman, Sorry to answer with a question, but I just want to check I've understood.

    You want to accommodate the 5V supply into this sensor and associated 5V? logic output from it down to the 3V3 input of StickC, Core2, etc?

    A couple of thoughts:
    #1 StickC has a 3V pin out on the end opposite Groove port, so I guess you could go from the head end of the StickC to sensor (reduce all to 3V3).

    #2 Copy the voltage divider circuit a lot of the M5Stack sensors use (they are quite cheap, so you could even use one as a donor and solder your sensor on to it).

    #3 I've a feeling Seeed, DFRobot, Waveshare do a mini board to do such a thing, but probably equivalent to donor M5Stack part.

    If you used the M5Stack Mini Dual Button Unit as a donor/connection board. I suppose you could have two inputs, pin 32 and pin 33, hide the pull up resistors, etc. Or the Proto units, perhaps an easier solder at home proposition.

    Q) If it "can be powered from data line. Power supply range is 3.0V to 5.5V", would 5V power issue go away anyway?
    (NB Alt schemtic for circuit)