All Projects → DavidAntliff → esp32-ds18b20

DavidAntliff / esp32-ds18b20

Licence: MIT license
ESP32-compatible C library for Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer.

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to esp32-ds18b20

OneWireNg
Arduino 1-wire service library. OneWire compatible. Dallas thermometers support.
Stars: ✭ 32 (-47.54%)
Mutual labels:  esp32, ds18b20, one-wire
MQTT VPN
IP over MQTT for ESP controllers and Linux
Stars: ✭ 95 (+55.74%)
Mutual labels:  esp32, esp-idf
ESP32-LCD-I2S
Espressif ESP32 driving a controller-less monochrome lcd with parallel I2S bus
Stars: ✭ 54 (-11.48%)
Mutual labels:  esp32, esp-idf
esp-idf-parallel-tft
8bit parallel TFT & 4-line resistance touch screen Driver for esp-idf using i2s paralell mode
Stars: ✭ 45 (-26.23%)
Mutual labels:  esp32, esp-idf
esp32-ota
ESP32 OTA based on ThingsBoard Open-source IoT Platform
Stars: ✭ 45 (-26.23%)
Mutual labels:  esp32, esp-idf
Homekit
Homekit for ESP32 with Arduino framework
Stars: ✭ 80 (+31.15%)
Mutual labels:  esp32, esp-idf
ESP32-USB-Soft-Host
An Arduino wrapper to @sdima1357's usb_soft_host esp-idf example
Stars: ✭ 119 (+95.08%)
Mutual labels:  esp32, esp-idf
Arduino Esp32
Arduino core for the ESP32
Stars: ✭ 7,741 (+12590.16%)
Mutual labels:  esp32, esp-idf
gfx demo
GFX Demo for Arduino and the ESP-IDF
Stars: ✭ 63 (+3.28%)
Mutual labels:  esp32, esp-idf
esp32-e-paper-weatherdisplay
An ESP32 and 4.2" ePaper Display reads Dark Sky weather API and displays the weather using ESP-IDF
Stars: ✭ 110 (+80.33%)
Mutual labels:  esp32, esp-idf
OneWire
Library for Dallas/Maxim 1-Wire Chips
Stars: ✭ 32 (-47.54%)
Mutual labels:  esp32, ds18b20
avr-ds18b20
AVR library for controlling DS18B20 temperature sensors
Stars: ✭ 52 (-14.75%)
Mutual labels:  ds18b20, temperature-sensor
ds18b20
Golang get temperature from ds18b20 sensor connected to a Raspberry PI (GPIO w1 pin).
Stars: ✭ 62 (+1.64%)
Mutual labels:  ds18b20, temperature-sensor
opcua-esp32
Embedded OPC UA Server on ESP32 based on open62541 stack
Stars: ✭ 82 (+34.43%)
Mutual labels:  esp32, esp-idf
esp32-owb
Maxim One Wire Bus driver for ESP32.
Stars: ✭ 115 (+88.52%)
Mutual labels:  one-wire, esp-idf
esp32-freqcount
ESP32 Frequency Counter using Pulse Counter and Remote Control modules
Stars: ✭ 48 (-21.31%)
Mutual labels:  esp32, esp-idf
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (-72.13%)
Mutual labels:  ds18b20, one-wire
esp-idf-json
Example of JSON Serialize and Deserialize in ESP-IDF
Stars: ✭ 29 (-52.46%)
Mutual labels:  esp32, esp-idf
esp-idf-w25q64
SPI Flash Memory W25Q64 Access Library for esp-idf
Stars: ✭ 12 (-80.33%)
Mutual labels:  esp32, esp-idf
esp32-epaper-display
Server and software to use an ESP32 as a connected display
Stars: ✭ 73 (+19.67%)
Mutual labels:  esp32, esp-idf

esp32-ds18b20

Introduction

This is a ESP32-compatible C component for the Maxim Integrated DS18B20 Programmable Resolution 1-Wire Digital Thermometer device.

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

It is written and tested for v2.1, v3.0-3.3 and v4.1-beta1 of the ESP-IDF environment, using the xtensa-esp32-elf toolchain (gcc version 5.2.0).

Dependencies

Requires esp32-owb.

Example

See esp32-ds18b20-example for an example that supports single and multiple devices on a single bus.

Features

In cooperation with the underlying esp32-owb component, this component includes:

  • External power supply mode.
  • Parasitic power mode (VDD and GND connected) - see notes below.
  • Static (stack-based) or dynamic (malloc-based) memory model.
  • No globals - support any number of DS18B20 devices on any number of 1-Wire buses simultaneously.
  • 1-Wire device detection and validation, including search for multiple devices on a single bus.
  • Addressing optimisation for a single (solo) device on a bus.
  • CRC checks on temperature data.
  • Programmable temperature measurement resolution (9, 10, 11 or 12-bit resolution).
  • Temperature conversion and retrieval.
  • Separation of conversion and temperature retrieval to allow for simultaneous conversion across multiple devices.

Parasitic Power Mode

Consult the datasheet for more detailed information about Parasitic Power mode.

Parasitic power operation can be detected by ds18b20_check_for_parasite_power() followed by a call to owb_use_parasitic_power(), or simply set explicitly by a call to the latter.

This library has been tested on the ESP32 with two parasitic-power configurations, with two DS18B20 devices at 3.3V:

  1. Disconnect power to each device's VDD pin, and connect that pin to GND for each device. Power is supplied to each device through the OWB data line.
  2. Connect the OWB data line to VCC via a P-channel MOSFET (e.g. BS250) and current-limiting resistor (e.g. 270 Ohm). Ensure your code calls owb_use_strong_pullup_gpio() with the GPIO connected to the MOSFET Gate. The GPIO will go high during temperature conversion, turning on the MOSFET and providing power from VCC to each device through the OWB data line.

If you set up configuration 1 and do not see CRC errors, but you get incorrect temperature readings around 80 - 85 degrees C, then it is likely that your DS18B20 devices are running out of power during the temperature conversion. In this case, consider reducing the value of the pull-up resistor. For example, I have had success obtaining correct conversions from two parasitic DS18B20 devices by replacing the 4k7 Ohm pull-up resistor with a 1 kOhm resistor.

Alternatively, consider using configuration 2.

Note that use of parasitic power mode disables the ability for devices on the bus to signal that an operation has completed. This means that DS18B20 devices in parasitic power mode are not able to communicate when they have completed a temperature conversion. In this mode, a delay for a pre-calculated duration occurs, and then the conversion result is read from the device(s). If your ESP32 is not running on the correct clock rate, this duration may be too short!

Documentation

Automatically generated API documentation (doxygen) is available here.

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

Parts of this code are based on references provided to the public domain by Maxim Integrated.

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

Roadmap

The following features are anticipated but not yet implemented:

  • Concurrency support (multiple tasks accessing devices on the same bus).
  • Alarm support.
  • EEPROM support.
  • Parasitic power support.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].