Project Disconnecting, Temp Sensor going to -127

I looked at the wemos circuit and found that the USB 5v and the 5v pin input are both going to the on-board regulator. They are only separated with a diode to prevent 5v from going to the usb connector from the 5v pin.

It is hooked up to GPIO 14 which accordint to the Wemos Pin config does not have a pull up or down.

https://wiki.wemos.cc/products:d1:d1_mini_pro#pin

hm, than i do not have other ideas. try

  • a linear tegulator
  • supply the sensor with 3.3v instead of 5v
  • check for wireing connection problems (these sensors are very sensible for bad connection)
  • try to play with pullup value
  • replace the sensor

by the way, what freqency you read this sensor?

OK after a lot of troubleshooting I think I found a problem. It tried a linear regulator instead of the buck convertor. Same problem. supplied the sensor 3.3v sensor and everything else you suggested. I tried replacing the sensor with another one without wires connected directly to the pcb and while that worked, when I changed back to the other sensor with the wires extended the problem was back. Later I found that if I just lightly touched the metal usb connector (which was connected to my PC) to the ground of the whole circuit the sensor read correctly. To power the whole circuit I have a figure 8 cable that has no ground connection. So I connected a piece of wire from my house earth connection to the earth of the transformer everything was working. This is such a weird problem. So now I just have to replace the figure 8 cable to a socket that has an earth connection. like an IEC Plug.

I am not sure I followed everything correctly… but are you running multiple power sources?.. one for for MCU and one for sensors?

If so then you DO need to have a shared ground between them… not necessarily to mains earth ground, but shared/common at least to each other.

No I only have one power supply which converts 240v to 12v, A buck convertor which converts 12v to 5v. I think the cheap 12v psu is interfering and if I connect earth the problem is fixed.
I also have a relay that is controlled with the wemos and the relay connects 240v for a pump from the same 240v that is going to the transformer. But that should be isolated right?

Most definitely YES… you don’t want to ā€œshareā€ any connection there :wink:

EDIT: I think that Buck convertor technically qualifies as a 2nd power source… and should automatically have a shared ground with it’s 12v source… but that might not be the case and thus the root of your issue.