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 Seeed-grove.py
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='')
time.sleep(0.5)
if __name__ == "__main__":
main()
- uint16_t,uint16_t read_temp(void):return temperature
temp_c,temp_f = DS18B20.read_temp
This software is written by seeed studio
and is licensed under The MIT License. Check License.txt for more information.
Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.
Seeed Studio is an open hardware facilitation company based in Shenzhen, China.
Benefiting from local manufacture power and convenient global logistic system,
we integrate resources to serve new era of innovation. Seeed also works with
global distributors and partners to push open hardware movement.