This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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.

Supported Hardware

Master

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

Slave

Usage

Find ROM codes for all connected devices:

from digitemp.master import UART_Adapter
from digitemp.device import AddressableDevice

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

Get temperature:

from digitemp.master import UART_Adapter
from digitemp.device import DS1820

bus = UART_Adapter('/dev/ttyS0')  # DS9097 connected to COM1

# only one 1-wire device on the bus:
sensor = DS1820(bus)

# specify device's ROM code if more than one 1-wire device on the bus:
sensor = DS1820(bus, rom='10D67E5B02080037')

# display sensor's information
sensor.info()

# get temperature
print(sensor.get_temperature())
# 25.48

Set resolution for DS18B20 and DS1822):

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

sensor.set_resolution(DS18B20.RES_9_BIT)

digitemp.device module provides following 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

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.

1-wire USB/UART adapter

These are tested:

  • [ds18b20-uart.svg](docs/ds18b20-uart.svg)
  • [ds18b20-uart-par.svg](docs/ds18b20-uart-par.svg)
  • [ds18b20-uart-dioda.svg](docs/ds18b20-uart-dioda.svg)
  • [ds18b20-uart-diodapar.svg](docs/ds18b20-uart-diodapar.svg)

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

These are not tested yet:

  • [ds18b20-uart-mosfet.svg](docs/ds18b20-uart-mosfet.svg)
  • [ds18b20-uart-npn.svg](docs/ds18b20-uart-npn.svg)

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.

Release History

Release History

1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.post1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pydigitemp-1.3.tar.gz (10.2 kB) Copy SHA256 Checksum SHA256 Source Nov 22, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting