Using a DS18B20 one-wire temperature sensor with a Raspberry Pi Pico

I’ve just found this simple tutorial for using a “one-wire” temperature sensor with the Pico. The author has used a breakout module that includes the necessary resistor to stabilise the signal, but has also given instructions for wiring up the sensor if you don’t happen to have the module. They’ve then coded it using MicroPython to get readings out and into the Thonny monitor, although what you choose to do with the readings is up to you – you could add an I2C display and graph the results, perhaps?

I’ve been doing some research for this sensor and found this page/documentation from Adafruit for using the sensor with CircuitPython, so you have options in terms of how you access the readings.

The DS18B20 sensor can also be found in the CamJam EduKit 2, on a long wire with a waterproof sheath (and includes the 4k7 resistor for the circuit), although you can obviously get these cheaper from AliExpress or eBay by doing some searching around if you didn’t want the rest of the kit.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.