Only 2 sensors work DS18B20

I have a problem with temperature sensors I have on a 0.5m cable and this cable is then connected to other sensors.
I need to connect up to 7 sensors (soil temperature measurement), but I always get:
0.00 | -127.00 | -127.00 | -127.00 | -127.00 | -127.00 | -127.00 |

If I plug in 3 sensors, only two and third throws the error -127.00. If I do this separately, it works.

I use a resistor: RU 4K7 0,25W 5%

Will someone help me?

With the information provided, I ask if you have read https://cdn.sparkfun.com/datasheets/Sensors/Temp/DS18B20.pdf. Especially, for starters page 1 and 2 and 3 and 4 and all the way to 27.

Do you really think we can help you without seeing your program code?

Don

There is nothing to suggest there is anything wrong with any of your sensors.

There is also nothing to suggest there is anything wrong with your code, so you can ignore reply #2.

The -127 is telling you that there is a lot wrong with your wiring, indeed most of the sensors are disconnected most of the time.

If you are using parasitic power, cease and desist immediately.

I assume this is just a test lashup and you will eventually use longer cable. I don't suppose there would be a problem with 500mm but note that you can't be a cheapskate with DS18B20 wiring. A popular approach is to use CAT5 cable for longer runs.

My code is:

#include <Arduino.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>      

#define ONE_WIRE_BUS 10 // pin D10
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);


DeviceAddress senzorTemp_01 = { 0x28, 0x63, 0xEE, 0x45, 0x92, 0x0D, 0x02, 0xCF };
DeviceAddress senzorTemp_02 = { 0x28, 0xCF, 0xEC, 0x45, 0x92, 0x0D, 0x02, 0x6D };
DeviceAddress senzorTemp_03 = { 0x28, 0x72, 0x7A, 0x45, 0x92, 0x0F, 0x02, 0x9A };



void setup() {
 Serial.begin(9600);

 sensors.begin();
 sensors.setResolution(senzorTemp_01, 12);
 sensors.setResolution(senzorTemp_02, 12);
 sensors.setResolution(senzorTemp_03, 12);
}

void loop() {
 if(Serial.available())
 {
   byte value = Serial.read();
    if(value == '1')
    {
       sensors.requestTemperatures();

       
        // teplomery
        float Teplomer_01 = sensors.getTempC(senzorTemp_01);
        float Teplomer_02 = sensors.getTempC(senzorTemp_02);        
        float Teplomer_03 = sensors.getTempC(senzorTemp_03);
                                           
        Serial.print(Teplomer_01);
        Serial.print("  |  ");

        Serial.print(Teplomer_02);
        Serial.print("  |  ");

        Serial.print(Teplomer_03);
        Serial.print("  |  ");     


Serial.println("");     
    }    
 }
}

If you have multiple devices, connect them multidrop, not star configuration, if possible.

You must (for reliability) run the bus as a bus - you appear to have completely separate wiring harnesses
for ground, power and data - no, this is very bad for all sorts of reasons.

All three wires of the bus must run as a transmission line, not separated. So typically you'd use
either two twisted pairs (power/gnd and signal/gnd), or a twisted triple, or twin core shielded
with ground as shield, power and signal as cores. So two pairs from CAT5 or stereo audio screened
cable are feasible. With ribbon cable every other wire should be ground for best shielding.

Use a 4k7 pullup at each end of the bus. (Well it may be overkill but I've used this for 20 sensor string
successfully with years of 100% reliability).

Don't use parasite power unless you have to, then you can decouple each device with 100nF ceramic capacitor
which will really help provide solid behaviour. I've never even tried using these devices without
decoupling.