GithubHelp home page GithubHelp logo

zanduino / dsfamily Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 2.0 469 KB

Support for Maxim's DS-Family of 1-Wire digital temperature sensors

License: GNU General Public License v3.0

C++ 100.00%
ds18b20 ds1820 ds18x20 arduino arduino-library calibration 1-wire ds1822 ds1825 ds18s20 ds28ea00 avr thermometer maxim-ds-family temperature

dsfamily's Introduction

License: GPL v3 Build Format Wiki Doxygen arduino-library-badge

DS-Family library

Arduino library for using any/all of the "DS" Family of Maxim Integrated 1-Wire thermometers. This library is specifically geared towards installations with several devices, particularly where the number of attached devices is not known at design time. Each 1-Wire device has a unique 8 Byte ROM code which is used to address the device, so keeping 16 device addresses in memory can use a significant amount of available RAM. This library uses the available Atmel EEPROM memory to store the 8-Byte addresses and reference to the devices is done via an integer index rather than device number.

Supported Arduino hardware

Due to the use of EEPROM to store the 1-Wire DS thermometer information at runtime, currently only the AVR-Family of processors are supported. Work is ongoing to support the ESP32 and ESP8266 plaforms which have EEPROM emulation. If enough interest is present, a solution for the other common platforms can be implemented using "normal" memory.

Supported Maxim DS-Devices

The following Maxim Integrated DS-Family 1-Wire thermometers are supported:

DS-Family Device Datasheet
DS1822 DS1822 Datasheet
DS1825 DS1825 Datasheet
DS18B20 DS18B20 Datasheet
DS1820 DS1820 Datasheet
DS18S20 DS18S20 Datasheet
DS28EA00 DS28EA00 Datasheet

Temperature measurements

The DS-Family of devices have either fixed or variable levels of precision, ranging from 9 to 12 bits. All of the devices return a signed 16-bit integer result. Each unit returned equates to 0.0625°C, for example a temperature value of "325" equates to 20.3125°C. To avoid floating point arithmetic on the Atmel processors, multiply by 625 and then divide by 100, giving an integer "2031" which would be the temperature Celsius times 100; or centidegrees. The DS1820/DS18S20 models normally return values in 0.5°C increments but the library modifies those results so that all thermometers report the same way; the values for the DS1820/DS18S20 are just less accurate at 9bits precision.

Calibration

The library can enhance the accuracy of readings with multiple devices by using the 2 user bytes to store measurement offset values. The calibration process assumes that all the thermometers are at the same temperature (there are various methods of doing this, for instance putting all the thermometers in sealed baggie inside a sealed plastic container for a long period of time and then measuring) and computes the mean temperature of all devices and then applies a positive or negative offset to each thermometer in order to achieve a common reading. Standard deviation of measurements is significantly improved when using calibrated thermometers.

1-Wire Library

The Maxim DS-Family of thermometers use the 1-Wire microLAN protocol. There is an excellent library for 1-Wire, written by Paul Stoffregen and located at http://www.pjrc.com/teensy/td_libs_OneWire.html. There is also an informative page at http://playground.arduino.cc/Learning/OneWire describing how to use the library. As there are parts of the code that are unnecessary for this DS implementation and to make this library useable without having to download other libraries or components, the code from version 2.0 (extracted 2016-11-23), has been included.

Documentation

In addition to the GitHub DSFamily Wiki, the library and example programs utilize Doxygen documentation, whose output can be found at Doxygen Documentation

Zanshin Logo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.