Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🌡️ Arduino library for interfacing with Maxim temperature sensors like DS18B20, DS18S20, and MAX31850. 🔌 Supports multiple sensors, ⚡ asynchronous operation, and 🎯 configurable resolution for precise temperature monitoring.

License

NotificationsYou must be signed in to change notification settings

milesburton/Arduino-Temperature-Control-Library

Repository files navigation

Arduino CIArduino-lintJSON checkGitHub issues

License: MITGitHub releaseCommits since latest

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

📌 Supported Devices

devicepowernotes
DS18B203-5 Vthe reference
DS18S203-5 V9 bit only
DS18223-5 V
DS18205 V9 bit only
MAX318203 V⚠️
MAX31850/13-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 fromGitHub 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 theDS18B20 datasheet (page 7)
  2. Code Example

    #include<OneWire.h>#include<DallasTemperature.h>// Data wire is connected to GPIO 4#defineONE_WIRE_BUS4OneWireoneWire(ONE_WIRE_BUS);DallasTemperaturesensors(&oneWire);voidsetup(void) {  Serial.begin(9600);  sensors.begin();}voidloop(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) andgetTempF(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:

#defineREQUIRESNEW// Use if you want to minimise code size#defineREQUIRESALARMS// Use if you need alarm functionality

📚 Additional Documentation

Visit ourWiki for detailed documentation.

🔧 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 CommandsWithin 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

📄 License

MIT License | Copyright (c) 2025 Miles Burton

Full license text available inLICENSE file.

About

🌡️ Arduino library for interfacing with Maxim temperature sensors like DS18B20, DS18S20, and MAX31850. 🔌 Supports multiple sensors, ⚡ asynchronous operation, and 🎯 configurable resolution for precise temperature monitoring.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors44


[8]ページ先頭

©2009-2025 Movatter.jp