ds18b20 reading -127C HELPPPP

Hi guys, I bought 10 of these sensors for a project, however wiring it up in parasite mode according to http://www.hobbytronics.co.uk/ds18b20-arduino has left me with a serial monitor filled with temp=-127.00C. I read in other posts that this means the chip isn’t responding or simply just not there. I pretty sure the wiring is right, i have followed it exactly. I also tried it using a Arduino Nano V3, Mega, UNO and its all come up with the same readings. I have also tried 5/10 sensors and nothing has worked.

Am i missing something here? Please help!! source code i’m using is also from the website.

#include <OneWire.h>
#include <DallasTemperature.h>
 
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2
 
// Setup a oneWire instance to communicate with any OneWire devices 
// (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
 
void setup(void)
{
  // start serial port
  Serial.begin(9600);
  Serial.println("Dallas Temperature IC Control Library Demo");

  // Start up the library
  sensors.begin();
}
 
 
void loop(void)
{
  // call sensors.requestTemperatures() to issue a global temperature
  // request to all devices on the bus
  Serial.print(" Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");

  Serial.print("Temperature for Device 1 is: ");
  Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"? 
    // You can have more than one IC on the same bus. 
    // 0 refers to the first IC on the wire
 
}

Try some of the sensors individually in non-parasite mode.

Pete

I have only been testing it with one sensor at one time and i have also tried non parasite mode. do you have any other ideas?

Tired a 2.2k resistor and its not working too. I tried flipping the sensor around which just resulted it in heating up which is consistent with other forum posts about reverse polarity. Tried a different sensor after that and its still not working! what is going on! is it possible that i received 10 dud sensors?

Definitely start out in normal powered mode, NOT parasite. Use a single 4.7k pullup.

Any device you connected backwards keep aside, you may have fried it (never randomly plug things in backwards, that never helps - double check the pinout before powering up).

The code you have doesn't look familiar to me, use something known to work from this forum (ie find a thread where someone got it to work and use the same version of the libraries).

Once that's working you can try parasite, but you have to tell the code to use parasite power and I've never trusted it.

MarkT: Definitely start out in normal powered mode, NOT parasite. Use a single 4.7k pullup.

Any device you connected backwards keep aside, you may have fried it (never randomly plug things in backwards, that never helps - double check the pinout before powering up).

The code you have doesn't look familiar to me, use something known to work from this forum (ie find a thread where someone got it to work and use the same version of the libraries).

Once that's working you can try parasite, but you have to tell the code to use parasite power and I've never trusted it.

Done as you have suggested and followed the directions from this website which others have also used. https://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

Wiring is correct and used a new sensor. Uploaded the 1-wire finder sketch and still nothing works. Any other ideas?

nicosoh: is it possible that i received 10 dud sensors?

It's possible. Some people have even found that what they thought was a DS18B20 wasn't. The -127 does not mean your sensors are kosher but merely not connected, it means the code can't find a DS18B20.

If you were not too slow in disconnecting them, the sensors probably survived being connected the wrong way round. Mine did.

The Hacktronics tutorial code is fine.