logo elektroda
logo elektroda
X
logo elektroda

DS18B20 + ESP8266 - what solutions with 6m cable and 230V interference?

evolucja 1824 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18036223
    evolucja
    Level 20  
    Hi,
    I have a problem with the detection of a DS18B20.

    Connected by 1m wire to ESP8266 directly to 3.3V + GND + SYG is detected and without any resistor between SYG and 3.3V.

    Unfortunately on a wire of about 6m (telephone) it does not work. I tried with different resistors from about 1k to 5k and nothing.

    1 Does it matter where I plug in the resistor? At the sensor, ESP or e.g. halfway (because the cable is connected)? Or does it make no difference?

    2 - What else can I do? What resistor is guaranteed to work at this wire length and 3.3V?

    3. could the fact that it goes next to 230V for half its length make a difference?


    Thank you in advance.
  • ADVERTISEMENT
  • #2 18036401
    nolens_volens
    Level 15  
    Hi,
    The sensor has a catalogue supply of min 3.0V
    Don't you have a bigger voltage drop from this 3.3V on these bonded wires?
    The resistor should be at the sensor.
    Something can also be induced from 230V, especially with such an extremely low supply.
    I would start with a thicker wire.

    Regards
    jurek
  • ADVERTISEMENT
  • #3 18038301
    kaczakat
    Level 34  
    The pull-up resistor is given to the bus, not to each sensor, so where to give it when there are more sensors? For this reason I always give it at the uC. The data line is supposed to be restored to a high state through the resistor, so some current has to be transferred there. It is probably better to do this right at the power source than to chase this current through a thin cable to the other side and back to the source? The 230V wire can interfere and if you can't let go otherwise do it with a wire in the shield. You could also go to 5V with some sort of logic level converter, it will be more immune to interference.
    You reduce the value of the pull-up resistor when the line lengthens (more current to bring it back to high, capacitance increases) and when the operating voltage decreases. Here you have both cases + interference from 230V.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 18041613
    khoam
    Level 42  
    evolucja wrote:
    Unfortunately on a cable of about 6m (telephone) does not work.
    .
    Just use a good twisted pair cable - the kind that comes in a LAN cable, not a telephone cable. No shielding will be necessary. For 3V3, a 3k pull-up resistor should be sufficient.
  • ADVERTISEMENT
  • #6 18263372
    oskar777

    Level 26  
    Quote:
    The pull-up resistor is given at the bus
    I gave it at the sensor, because "on the other side" it did not work. This allowed me to use twisted pair for a distance of 25-30m.
  • #7 18264015
    norbis15
    Level 14  
    This looks like the fault of the cable. At 6m you could jerk :) to a two-wire microphone cable and then give GND to the shield, and 3V3 and SYG to the inner wires.
    However, at this length a twisted pair should be sufficient. I use a PULL-UP 1k resistor always at the master.

Topic summary

The discussion revolves around the challenges of using a DS18B20 temperature sensor with an ESP8266 microcontroller over a 6-meter cable, particularly in the presence of 230V interference. Users suggest that the pull-up resistor should be placed at the sensor end to ensure proper signal integrity. Recommendations include using twisted pair cables instead of telephone wires, as they are less susceptible to interference. A pull-up resistor value of around 1k to 3k is advised for 3.3V systems, with considerations for cable quality and length affecting performance. The impact of nearby 230V lines on signal quality is acknowledged, and using shielded cables is suggested as a potential solution.
Summary generated by the language model.
ADVERTISEMENT