1-Wire network for 1.7~3.6V devices

My first time using a 1-Wire network. Project end goal includes reading multiple 1-Wire devices (quantity 4), specifically the model MAX31888 temperature sensor from Maxim Integrated (part of Analog Devices).

The sensor specifications: datasheet MAX31888.pdf

The 1-Wire network will be very small, "low radius" and "low weight", with longest wire less than 1 m and using a linear topology. My prototype is even smaller, using 150 mm jumper wires on a breadboard.

Per the MAX31888 datasheet I have a 0.1 µF capacitor for each sensor's parasitic power (C_PP) connected to pin 4 (CEXT) and pin 5 (GND), as described and depicted on pages 10-12 and 22 of the spec sheet (and my project schematic below). Makes sense to me, this small (2 mm × 2 mm) surface mount component does not have an internal capacitor like the widely used Dallas DS18B20 temperature sensor.

I am still in a trial and error process to determine how to correctly select the pull up resistance (R_PUP). The spec sheet shows a range of 300~1000 Ω, however notes 2 & 3 make it clear that the required resistance may vary based on the pull up device (controller), the network configuration, etc. Also, the table title/header states that specification values apply when the data line DQ is 1.8 V, but in my case as explained below I will be at 3.3 V (within the allowable spec range of 1.7~3.6V per the datasheet).

For comparison, the Dallas DS18B20 uses 5.0 V (spec range 3.0~5.5 V) and the resistor is 4700 Ω.

My micro-controller is an Arduino MKR1000 (the master in the 1-wire network). It operates at 3.3 V and I'm assuming that I should be able to directly use a digital pin for the data interface. While my initial project could use a pin for each 1-Wire device, longer term I'd prefer to have all devices on one pin to free up I/O for other things, so I have started with one pin only.

Wiring & connection schematic:

I'm working in Arduino IDE v1.8.19. My code is copy/paste(edit) from several of the OneWire examples (e.g. for using a Dallas DS18B20), so everything seems simple and straight forward. I have the Arduino OneWire v2.3.6 library installed. I also have the DallasTemperature v3.9.0 library installed (by Miles Burton), which is also known as the Arduino-Temperature-Control-Library (v3.9.1 is available in Github). While I included the DallasTemperature library in one of my initial sketches, I am not using it my current sketch as I systematically attempt to troubleshoot and have stripped the sketch down to the bare minimum.

My problem is that I have not yet successfully communicated with any of the sensors. I have tried just one sensor at a time (and picked different sensor samples to test), and I have tried four sensors at the same time. I am starting with the simple stuff, like a sensor search to retrieve the 64-bit ROM address of each device. A few attempts have returned an address, however it always fails a CRC-8 test. I have noted 5 unique addresses (on a given try the same address repeats, but I suspect that I am looking at gibberish data since I have seen different addresses on different attempts). Most attempts have resulted in "no more addresses".

Given my uncertainty over what resistance value to use, I have tried: 430, 750, 1180, 1500, 2250 Ω. But with no clear difference in results.

Here is my current simple sketch:

//find all sensors, for each report the ROM address and perform CRC check on the address

#include <OneWire.h>
// sketch developed based on use of OneWire library v2.3.6
// OneWire documentation at https://www.pjrc.com/teensy/td_libs_OneWire.html

OneWire  sensors(3);
// create a OneWire object named "sensors" that is connected on digital pin "3"

void setup(void) {
  // put setup code here, to run once:
  Serial.begin(9600);
  //  sensors.reset(); //reset the 1-wire bus, not necessary but just in case
  //  delay(1000); //milliseconds to wait
}

void loop(void) {
  // put main code here, to run repeatedly:
  byte i;
  byte addr[8];
  if ( !sensors.search(addr)) {
    Serial.println(" No more addresses.");
    sensors.reset_search();
    delay(500);
    return;
  }
  Serial.print("ROM address=");
  for ( i = 0; i < 8; i++) {
    Serial.print(addr[i], HEX);
    Serial.print(" ");
  }
  if ( OneWire::crc8( addr, 7) != addr[7]) {
    Serial.println("CRC is not valid!");
    return;
  }
}

I have checked and double checked wiring and connections (completely re-started once). I have continuity in wires. I have 3.28 V from the Arduino.

I have no means to check whether or not the surface mount solder connections are okay or not. I had a company called Proto Advantage solder each of the ICs onto an adapter board so that I can plug and unplug each temperature sensor.

Any ideas on what I should check next?

I also tried to use the "oneWireSearch.ino" that comes in the examples with the DallasTemperature library. It tries all digital pins and searches for any 1-Wire devices and returns the addresses. Not sure why, but I could never get that sketch to print to the serial monitor (even after revising baud rate to be the same in the sketch and the monitor, and after trying other baud rates). Perhaps that points to some root cause in my setup. Or perhaps it is just another rabbit hole.

TL;DR
Post a text summary and question.

I'm troubleshooting a simple 1-Wire network, what are common reasons for either no communication (no addresses returned from a search) or data that fails CRC?

Hello hightop_raven
Did you ran separatly tutorials for the hardware selected to gain the interface knowledge?
Have a nice day and enjoy coding in C++.
Дайте миру шанс!

Which hardware? For the MAX31888 temperature sensors, yes I have read everything in the datasheet as well as other 1-Wire application notes from Maxim Integrated/Analog Devices/Dallas Semiconductor. But I do not have an oscilloscope at home, so I'm blind as to what is (or !is) happening on my 1-Wire network. My next step may be to borrow (or invest in) a scope. For the Arduino MKR1000, yes I have used it for another simple project that worked fine.

I tested this code with 8 sensors. For me, leaving GPIO0-2 floating gave inconsistent results.
After referring to the MAX31888 datasheet, I discovered how the OneWire multi-drop configuration is actually supposed to work.

Please note that any sensor with the same GPIO-address wiring refuses to respond at all. I also had to use higher value resistors (up to 10Kohm) before i got any response from my sensor network. One last thing is that i had to briefly connect a 10uF capacitor between DQ and GND, after which the program worked for me just fine, even after a power cycle. Though I'm fairly sure this "bug" was specific to my ESP32 hardware.

I had already seen the schematic for a multi-drop configuration with MAX31888 sensors. I'm not yet convinced that a DS2484 is required to have more than a single 1-Wire sensor (MAX31888 or other devices) on the same network. The DS2484 is described as a bridge to convert from I2C to 1-Wire:
https://datasheets.maximintegrated.com/en/ds/DS2484.pdf
https://www.maximintegrated.com/en/products/interface/controllers-expanders/DS2484.html
Why would a DS2484 be required to communicate to multiple devices on a 1-wire network?

I have not been able to work on this project for a while, but will get back to my root cause investigations in the next few days. I now also have a couple of DS18B20 sensors and will see if I can get those working to validate my code, and then let that guide my next steps for troubleshooting the MAX31888 sensors. With the DS18B20 sensor I can go to a "known to work" configuration of 5 V and 4700 Ω.

I didn't use a DS2484 chip in my design. It worked just fine for me without it on an ESP32 and STM32.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.