Giter Site home page Giter Site logo

richardbowden / esp32-ds18b20-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from davidantliff/esp32-ds18b20-example

0.0 0.0 0.0 218 KB

ESP32-compatible example for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.

License: MIT License

C 88.74% Makefile 3.71% CMake 7.55%

esp32-ds18b20-example's Introduction

esp32-ds18b20-example

Platform: ESP-IDF Build Status license

Introduction

This is an example application for the Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer device.

It supports a single or multiple devices on the same 1-Wire bus.

It is written and tested for v3.3 and v4.1-beta1 of the ESP-IDF environment, using the xtensa-esp32-elf toolchain (gcc version 5.2.0, crosstool-ng-1.22.0-80-g6c4433a).

Ensure that submodules are cloned:

$ git clone --recursive https://github.com/DavidAntliff/esp32-ds18b20-example.git

Build the application with:

$ cd esp32-ds18b20-example
$ idf.py menuconfig    # set your serial configuration and the 1-Wire GPIO - see below
$ idf.py build
$ idf.py -p (PORT) flash monitor

The program should detect your connected devices and periodically obtain temperature readings from them, displaying them on the console.

Dependencies

This application makes use of the following components (included as submodules):

Hardware

To run this example, connect one or more DS18B20 devices to a single GPIO on the ESP32. Use the recommended pull-up resistor of 4.7 KOhms, connected to the 3.3V supply.

idf.py menuconfig can be used to set the 1-Wire GPIO.

If you have several devices and see occasional CRC errors, consider using a 2.2 kOhm pull-up resistor instead. Also consider adding decoupling capacitors between the sensor supply voltage and ground, as close to each sensor as possible.

If you wish to enable a second GPIO to control an external strong pull-up circuit for parasitic power mode, ensure CONFIG_ENABLE_STRONG_PULLUP=y and CONFIG_STRONG_PULLUP_GPIO is set appropriately.

See documentation for esp32-ds18b20 for further information about parasitic power mode, including strong pull-up configuration.

Features

This example provides:

  • External power supply detection.
  • Parasitic power supply detection.
  • Static (stack-based) or dynamic (malloc-based) memory model examples.
  • No global variables.
  • Device search.
  • Addressing optimisation for a single (solo) device on a bus.
  • CRC checks on ROM code and temperature data.
  • Programmable temperature measurement resolution (9, 10, 11 or 12-bit resolution).
  • Temperature conversion and retrieval.
  • Simultaneous conversion across multiple devices.

Source Code

The source is available from GitHub.

License

The code in this project is licensed under the MIT license - see LICENSE for details.

Links

Acknowledgements

"1-Wire" is a registered trademark of Maxim Integrated.

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.