I have a DS18B20 temperature sensor connected to a Node MCU (ESP-12 / ESP8266) like shown below, where μP is the MCU (any GPIO gives the same result) and Vpu = VDD = 3.3 V, coming from the 3.3 V pin of the MCU.
The sensor works well as long as the MCU is powered through USB. But when I power the MCU using an external 5 V, 700 mA power supply through the Vin pin, the temperature sensor stops working (reads 0 all the time). The MCU, however, continues operating normally.
I have found that I can make the temperature sensor work again by replacing the 4.7 kΩ pull-up resistor with one of 333 Ω, making it a much stronger pull-up.
I am baffled as to why this happens. The 3.3 V output should behave the same no matter if the 5 V power is supplied through USB or Vin (and it does seem stable in both cases according to measurements). And why would such a strong pull-up be needed on the signaling line anyway, since I'm powering the DS18B20 through an external supply (not using parasitic power mode)?