All Projects → mcsakoff → pydigitemp

mcsakoff / pydigitemp

Licence: other
Python implementation of 1-Wire protocol.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to pydigitemp

lwow
Lightweight onewire protocol library optimized for UART hardware on embedded systems
Stars: ✭ 98 (+653.85%)
Mutual labels:  ds18b20, 1-wire
OneWireNg
Arduino 1-wire service library. OneWire compatible. Dallas thermometers support.
Stars: ✭ 32 (+146.15%)
Mutual labels:  ds18b20, 1-wire
Periph
Go·Hardware·Lean
Stars: ✭ 1,700 (+12976.92%)
Mutual labels:  ds18b20, 1-wire
nRF24LE1-sensor
nRF24LE1 remote sensor module, support DHT21/22, DS18B20, photoresistor as light sensor, AES encryption
Stars: ✭ 15 (+15.38%)
Mutual labels:  ds18b20
rpi2mqtt
Connect RaspberryPi GPIOs and 1-Wire temperature sensors to MQTT 🍰🔘📡
Stars: ✭ 20 (+53.85%)
Mutual labels:  1-wire
esp32-ds18b20
ESP32-compatible C library for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.
Stars: ✭ 61 (+369.23%)
Mutual labels:  ds18b20
temperature-machine
Data logger for multiple DS18B20 temperature sensors on one or more machines
Stars: ✭ 56 (+330.77%)
Mutual labels:  ds18b20
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (+30.77%)
Mutual labels:  ds18b20
OneWire
Library for Dallas/Maxim 1-Wire Chips
Stars: ✭ 32 (+146.15%)
Mutual labels:  ds18b20
tehybug
Low Power WIFI environmental data trackers based on ESP8266 Module
Stars: ✭ 15 (+15.38%)
Mutual labels:  ds18b20
avr-ds18b20
AVR library for controlling DS18B20 temperature sensors
Stars: ✭ 52 (+300%)
Mutual labels:  ds18b20
chpc
CHPC: Cheap Heat Pump Controller
Stars: ✭ 27 (+107.69%)
Mutual labels:  ds18b20
temp-probe-exporter
Export Prometheus data from 1-Wire temperature sensors, using an Arduino or Linux system
Stars: ✭ 17 (+30.77%)
Mutual labels:  1-wire
ds18b20
Golang get temperature from ds18b20 sensor connected to a Raspberry PI (GPIO w1 pin).
Stars: ✭ 62 (+376.92%)
Mutual labels:  ds18b20
SONOFF-BASIC-firmware
Sonoff Basic firmware; config by browser, OTA, MQTT, DS18B20
Stars: ✭ 19 (+46.15%)
Mutual labels:  ds18b20
CaravanPi
System for measuring and displaying various values in caravans and motor homes, including climate values, filling levels and levelling data. MagicMirror (https://magicmirror.builders/) is used for presentation. A circuit board design is available now
Stars: ✭ 14 (+7.69%)
Mutual labels:  ds18b20
Johnny Five
JavaScript Robotics and IoT programming framework, developed at Bocoup.
Stars: ✭ 12,498 (+96038.46%)
Mutual labels:  1-wire

PyDigiTemp

Python implementation of 1-Wire protocol.

Originally written to replace digitemp utility in my pet project and get direct access to 1-wire devices. It was created for reading DS1820 temperature sensor connected to RS232 serial port through DS9097 adapter.

Documentation used

Supported Hardware

Bus Drivers

  • DS9097 - COM port adapter which performs RS-232C level conversion.
  • Custom 1-wire serial port interface (see below).

1-Wire Devices

Usage

Find ROM codes for all connected devices:

from digitemp.master import UART_Adapter

print(UART_Adapter('/dev/ttyS0').get_connected_ROMs())
# ['108739A80208006F', '10A75CA80208001A', '2825EA52050000CE']

Get temperature when there is only one 1-wire device on the bus:

from digitemp.master import UART_Adapter
from digitemp.device import TemperatureSensor

sensor = TemperatureSensor(UART_Adapter('/dev/ttyS0'))
sensor.info()
print(sensor.get_temperature())

Get temperature from specific sensor:

from digitemp.master import UART_Adapter
from digitemp.device import TemperatureSensor

bus = UART_Adapter('/dev/ttyS0')
sensor = TemperatureSensor(bus, rom='108739A80208006F')
sensor.info()
print(sensor.get_temperature())

You can directly instantiate a device class to use its features (e.g.: setting resolution):

from digitemp.device import DS18S20
sensor = DS18S20(bus, precise=False)

or:

from digitemp.device import DS18B20
sensor = DS18B20(bus)
sensor.set_resolution(DS18B20.RES_10_BIT)

digitemp.device module provides following device classes:

  • DS18S20 - for DS1820, DS18S20 and DS1920 High-Precision Temperature Sensors (family code: 0x10);
  • DS18B20 - for DS18B20 Programmable Resolution Temperature Sensors (family code: 0x28);
  • DS1822 - for DS1822 Econo Temperature Sensor (family code: 0x22)
  • DS1820, DS1920 - are aliases for DS18S20

See more examples in examples directory.

Schematics

IMPORTANT DISCLAIMER: All circuits presented here are collected from different sources on the Internet and thus are provided on an entirely "as-is and no guarantees" basis. We do not provide a warranty of any kind and cannot be held responsible in any manner.

1-wire serial port interface

See Serial Port Temperature Sensors - Hardware Interface for details.

USB/UART adapter

These are tested:

Not all schematics work in all cases, depending on adapter and cable length.

These are not tested yet:

Thanks

  • Slavko for SVG schematics and testing.

License

Python license. In short, you can use this product in commercial and non-commercial applications, modify it, redistribute it. A notification to the author when you use and/or modify it is welcome.

See the LICENSE file for the actual text of the license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].