Temperature Readings


I have
#include <OneWire.h>
#include <DallasTemperature.h>

in my project but what i found is if i unplug, for example, sensor#10 out of my array of 38 sensors it will not display that something is missing there(place for sensor#10) it will be displaying total 37 sensors. So is there a way i can write the value of this unplugged sensor as zero even if its the last sensor? all sensors have a specific location and if #10 is unplugged its wrong to show that value is missing of the sensor #38

Thanks and looking forward to see any suggestions

What kind of reading do you see when one is unplugged? It it is wildly off from the plugged in sensors, use that to question the result.

When i unplug sensor , doesn't matter which one #10 or #30 or #21 - its comes as zero but not where the sensor was unplugged - it disappears from the list as #38 #37 #36 ... so the last ones in array... can i hold that the sensor 10 was unplugged so sensor 10 readings is zero?

If sensor #10 is not in the list, the program can assign a zero temperature for that sensor.

But what good does that do?

How does your code determine which sensor is which?

Thanks and looking forward to see any suggestions

Suggestion: post your full code (using code tags).

** **[code]** **

paste your code after that
** **[/code]** **
after that

Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Also a link to info/specs on your sensors.

I know its a lot, but at the moment we have no idea what your project comprises of, what format the input data is, how you power all those "sensors" etc..

Thanks.. Tom.. :slight_smile:

From DallasTemperature.cpp:

// Fetch temperature for device index
float DallasTemperature::getTempCByIndex(uint8_t deviceIndex){

DeviceAddress deviceAddress;
if (!getAddress(deviceAddress, deviceIndex)){

return getTempC((uint8_t*)deviceAddress);


If -127 is returned, set temp for that channel to 0 and continue.