Arduino library to interface with Maxim DS1624 temperature sensor and memory


Introduction

The DS1624 consists of two separate functional units: a 256-byte nonvolatile memory and a direct-to-digital temperature sensor.

The nonvolatile memory is made up of 256 bytes, accessed through the 2-wire serial bus.

The direct-to-digital temperature sensor allows the DS1624 to measure the ambient temperature and report the temperature in a 12-bit word with 0.0625°C resolution. The temperature sensor and its related registers are accessed through the 2-wire serial interface.

Datasheet

Installation using Library manager

  1. Open Arduino IDE
  2. Select Sketch -> Include Library -> Manage Libraries… Arduino library manager
  3. Type "ds1624" in search bar, and install it Install library

Manual installation

  1. Download latest release zip file
  2. Rename downloaded zipfile to DS1624.zip
  3. Open Arduino IDE
  4. Go to Sketch -> Include library -> Add .ZIP library…
  5. Select just downloaded file
  6. Library is installed.

Usage example

/*****************************************************************************
Arduino Library for Maxim DS1624 temperature sensor and memory
MIT License
Copyright (c) 2017 Alessio Leoncini, https://www.technologytourist.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*****************************************************************************/

#include <DS1624.h>

// Sensor presents all address pins connected to ground
DS1624 ds1624(0x00);

void setup()
{  
  // Begin serial connection at 9600 baud
  Serial.begin(9600);
} 

void loop()
{
  float temperature;
  bool valid;
  
  // Get current temperature
  ds1624.GetTemperature(temperature, valid);

  // Print it
  if(valid)
  {
    Serial.println(temperature);
  }
  else
  {
    Serial.println("Invalid value read from I2C bus");
  }

  // Wait a while
  delay(1000);
}

Version 2.0.1

DS1624 library. Present code allows to read temperature values in centigrade degrees from a Maxim DS1624 sensor. Library is currently limited to issue temperature reading commands to the DS1624 device.

Present library includes a simple example showing how to issue temperature reading commands.

Changes from previous release:

  • Check validity of the result during sensor read.
  • Slightly modified the example code including a safer I2C bus reading.
  • Reference to the new www.technologytourist.com site.

Version 2.0.0

DS1624 library. Present code allows to read temperature values in centigrade degrees from a Maxim DS1624 sensor. Library is currently limited to issue temperature reading commands to the DS1624 device.

Present library includes a simple example showing how to issue temperature reading commands.

Changes from previous release:

  • Modified signature of temperature reading method to include a flag indicating if result is valid.
  • Fixed possible issues when reading data from I2C bus.

Version 1.0.0

First release of DS1624 library. Present code allows to read temperature values in centigrade degrees from a Maxim DS1624 sensor. Library is currently limited to issue temperature reading commands to the DS1624 device.

Present library includes a simple example showing how to issue temperature reading commands.


Comments