Skip to main content

Python library for the Grove - ds18b20 Sensor (si114x).

Project description


DS18B20 Waterproof Temperature Sensor is a digital sensor which can reach the digital data resolution up to 12 bits and has ±0.5°C accuracy from -10°C to +85°C. It includes an analog-to-digital converter to convert the analog signal to the digital output with the resolution up to 12 bits.


This driver depends on:

This is easy to install with the following command.

pip3 install

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install seeed-python-Ds18b20

To install system-wide (this may be required in some cases):

sudo pip3 install seeed-python-Ds18b20

if you want to update the driver locally from PyPI. you can use:

pip3 install --upgrade seeed-python-Ds18b20


connect Ds18b20 to D5 at BaseHat.

import seeed_ds18b20
import time

def main():
    DS18B20 = seeed_ds18b20.grove_ds18b20()
    print("Please use Ctrl C to quit")
    while True:
        temp_c,temp_f = DS18B20.read_temp
        print('temp_c %.2f C   temp_f %.2f F' % (temp_c,temp_f),end=" ")
        print('\r', end='')

if __name__ == "__main__":

API Reference

  • uint16_t,uint16_t read_temp(void):return temperature
temp_c,temp_f = DS18B20.read_temp

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

seeed_python_Ds18b20-1.0.0-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page