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.

Files for seeed-python-Ds18b20, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size seeed_python_Ds18b20-1.0.0-py2.py3-none-any.whl (4.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page