Power DS18B20 with 3.3V

Hi everyone,

I have a question that I am sure many have come across before. I am currently using 3 DS18B20 temperature sensors with the OneWire library to log some temperatures into a database. When using 5V USB connecting the temperature sensors to either VIN or 3.3V works great. Moving to the 3.7V LiPo battery supplied does not provide any readings. Any suggestions? I would rather not power the electron with an external USB power pack or a AA battery pack.

I am using a 4.7KΩ pullup resistor. The DS18B20 uses this for both 3.3V and 5V operation (from my understanding): https://www.maximintegrated.com/en/support/faqs/ds18b20-faq.html. The DS18B20 operates at a voltage range of 3V to 5.5V and does not need a level translator so I am not sure what I am doing wrong.

Cheers,
Gareth

When only running on LiPo the Vin pin will not be powered.
So your pull-up needs to go to 3v3 (or any GPIO pin that sources 3.3V).

2 Likes

Just an FYI:
I’m using the water proof sensor in parasitic mode at 3.3v, and I’m seeing quite a few CRC errors with the recommended 4.7k resistor. Based on the reading that I have done, a lower value resistor may yield better results at 3.3v, but I have not yet done any testing to verify that.

@ScruffR, yes I switch from using the VIN pin to the 3.3v pin when operating on the LiPo, but unfortunately, I still get no response. Not even CRC errors. Perhaps it is because I am using the 1 meter, water-proof sensors. I haven’t tried lowering the resistor but not sure if that will be possible - I am currently using an onboard 4.7KΩ. Going to give it a shot.

Solved

@Bear, you were correct. 4.7k was too much. Just used a 3.3k and were in business. Thanks for your response :sunglasses:

3 Likes