GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - milesburton/Arduino-Temperature-Control-Library: Arduino library for interfacing with Maxim temperature sensors

BranchesTags
Open more actions menu

Latest commit

 

History

306 Commits
306 Commits

Folders and files

NameName
Last commit message
Last commit date
.arduino_ci
.arduino_ci
 
 
.devcontainer
.devcontainer
 
 
.github
.github
 
 
examples
examples
 
 
test
test
 
 
.arduino-ci.yml
.arduino-ci.yml
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
DallasTemperature.cpp
DallasTemperature.cpp
 
 
DallasTemperature.h
DallasTemperature.h
 
 
Gemfile
Gemfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
arduino-cli.yaml
arduino-cli.yaml
 
 
build.sh
build.sh
 
 
keywords.txt
keywords.txt
 
 
library.json
library.json
 
 
library.properties
library.properties
 
 

Repository files navigation

Arduino Temperature Control Library

Arduino CI Arduino-lint JSON check GitHub issues

License: MIT GitHub release Commits since latest

A robust and feature-complete Arduino library for Maxim Temperature Integrated Circuits.

Supported Devices

device power notes
DS18B20 3-5 V the reference
DS18S20 3-5 V 9 bit only
DS1822 3-5 V
DS1820 5 V 9 bit only
MAX31820 3 V ⚠️
MAX31850/1 3-3.7V ⚠️ thermocouple

Installation

Using Arduino IDE Library Manager (Recommended)

  1. Open Arduino IDE
  2. Go to Tools > Manage Libraries...
  3. Search for "DallasTemperature"
  4. Click Install
  5. Also install the required "OneWire" library by Paul Stoffregen using the same method

Manual Installation

  1. Download the latest release from GitHub releases
  2. In Arduino IDE, go to Sketch > Include Library > Add .ZIP Library...
  3. Select the downloaded ZIP file
  4. Repeat steps 1-3 for the required "OneWire" library

Basic Usage

  1. Hardware Setup

    • Connect a 4k7 Ω pull-up resistor between the 1-Wire data line and 5V power. Note this applies to the Arduino platform, for ESP32 and 8266 you'll need to adjust the resistor value accordingly.
    • For DS18B20: Ground pins 1 and 3 (the centre pin is the data line)
    • For reliable readings, see pull-up requirements in the DS18B20 datasheet (page 7)
  2. Code Example

    #include <OneWire.h>
    #include <DallasTemperature.h>
    
    // Data wire is connected to GPIO 4
    #define ONE_WIRE_BUS 4
    
    OneWire oneWire(ONE_WIRE_BUS);
    DallasTemperature sensors(&oneWire);
    
    void setup(void) {
      Serial.begin(9600);
      sensors.begin();
    }
    
    void loop(void) { 
       sensors.requestTemperatures(); 
       
       delay(750); 
       
       float tempC = sensors.getTempCByIndex(0);
       Serial.print("Temperature: ");
       Serial.print(tempC);
       Serial.println("°C");
       delay(1000);
    }

Advanced Features

  • Multiple sensors on the same bus
  • Temperature conversion by address (getTempC(address) and getTempF(address))
  • Asynchronous mode (added in v3.7.0)
  • Configurable resolution

Configuration Options

You can slim down the code by defining the following at the top of DallasTemperature.h:

#define REQUIRESNEW      // Use if you want to minimise code size
#define REQUIRESALARMS   // Use if you need alarm functionality

Library Development

If you want to contribute to the library development:

Using Dev Container

The project includes a development container configuration for VS Code that provides a consistent development environment.

  1. Prerequisites

    • Visual Studio Code
    • Docker
    • VS Code Remote - Containers extension
  2. Development Commands Within the dev container, use:

    • arduino-build - Compile the library and examples
    • arduino-test - Run the test suite
    • arduino-build-test - Complete build and test process

    Note: Currently compiling against arduino:avr:uno environment

Credits

  • Original development by Miles Burton [email protected]
  • Multiple sensor support by Tim Newsome [email protected]
  • Address-based temperature reading by Guil Barros [email protected]
  • Async mode by Rob Tillaart [email protected]

📄 License

MIT License | Copyright (c) 2026 Miles Burton

Full license text available in LICENSE file.

About

Arduino library for interfacing with Maxim temperature sensors

www.milesburton.com/w/index.php/Dallas_Temperature_Control_Library

Topics

arduinoarduino-librarydallastemperatureds18b20embedded-systemsesp8266iotmaxim-integrated-circuitsmulti-sensoronewiresensor-librarysensorstemperature-monitoring

Resources

Readme
MIT license
Activity

Stars

1.0k stars

Watchers

70 watching

Forks

493 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.