I’m trying to build a simple sensor for the pool, based on a Wemos D1 mini pro.
The sensor is DS18B20 with a 3 m cable.
So as I can understand it from the ESP home pages, it needs 3.3v and gnd, and of course a data.
It also needs a 4.7kOhm pull up resistor between the 3.3v and the datapin (I’ve tried using D8).
Unfortunately the local electronics pusher only had 4.64 kOhm’s, so I’m trying with that.
So I made a simple gnd, 3.3v and data connection, with the 4.64 kOhm between 3.3v and D8.
But if I have that attached, it won’t flash the D1.
I’ve now removed them, and now it will flash it, but of course it can’t find any ‘Dallas’ sensors now.
So what to do? Is the 4.64 kOhm not good enough? Has anybody toyed with this?
Resistor values are approximate. 4.64 is quite accurate actually.
Now esp modules pins are tricky specially when boot and flashing.
Try another pin on the module. Also you don’t need to have it connected to flash it. You can flash and connect it later and should work anyway.
Along with the other excellent (and probably more-correct) suggestions here, I offer the idea that perhaps the 3-5v power supply is just barely enough, and the additional load of the sensor may be pulling it too low to flash properly.
Running my setup with 3.3v from a nodemcu with a 6 meter cable to ds18b20 and works just fine. Even without resistor the thing does proper measurements which are backed by a checksum on the one wire bus.
Wow, I’m humbled, here I am fiddling with stuff I’ve never done before, and then I get help from all you guys, thankyou very much @glmnet, @esphomeGuru, @glyndon for the great suggestions.
As esphomeguru pointed out, using D8 was not a good idea, moving it to d5, and it’s working perfectly now, Now I just need to make a watertight seal for the wire going out with the temp sensor, not a big deal, I just don’t have the part atm. Have to go for a drive tomorrow for that, again, thankyou all for your great help!
For my outdoor temp/light/barometer sensor, I put the ESP and sensor inside a yellow plastic prescription bottle. Made a watertight wire exit just by caulking the wire where it passes through a small hole in the lid.
Why a yellow bottle? It’s UV-resistant, and will help keep UV from deteriorating the photo-sensor over time. (not to mention it’s free)
Just be sure to position the temp sensor below the ESP, since the ESP gives off heat which will throw the temp readings off.