Hello, i have 10 DS18B20 sensors connected in parasite mode. Sometimes (I guess because of electrical noise) one of sensors gives me back -127, sensors working constantly without any delays, i am having -127 few times in a day. All my sensors is in the same room, so it's 2-3 meters from Arduino. When i connect another one which is 10 meters far away, i am getting -127 constantly. How it's come and what's bad in my code ? By the way, i can't use any big delays, because programme must work without any delays. There is how i read them:
float kp;
float kg ;
float sp ;
float sg ;
float ap ;
float tl;
float x2;
float x3;
float x4;
float tb;
DeviceAddress sgg = {
0x28,0xAB, 0xBD,0xDA,0x2,0x0,0x0,0x4C};
DeviceAddress spp = {
0x28,0x68, 0xCF,0xDA,0x2,0x0,0x0,0x64};
DeviceAddress kgg = {
0x28,0x12, 0xBF,0xDA,0x2,0x0,0x0,0x5E};
DeviceAddress kpp = {
0x28,0xF1, 0xFF,0x8D,0x2,0x0,0x0,0x99};
DeviceAddress app = {
0x28,0x49, 0xD6,0xDA,0x2,0x0,0x0,0x6A};
DeviceAddress tll = {
0x28,0x2B, 0xD5,0xDA,0x2,0x0,0x0,0x89};
DeviceAddress tbb = {
0x28, 0x7F,0xBC, 0xDA, 0x2, 0x0,0x0,0x99};
DeviceAddress x11 = {
0x28,0xE5,0x0,0x9F,0x3,0x0,0x0,0x43};
DeviceAddress x22 = {
0x28,0xFE,0xAC,0xDA,0x2,0x0,0x0,0x38};
DeviceAddress x33 = {
0x28,0xF4,0x52,0xCB,0x2,0x0,0x0,0x44};
void loop{
kp = sensors.getTempC (kpp);
kg = sensors.getTempC (kgg);
sp = sensors.getTempC (spp);
sg = sensors.getTempC (sgg);
ap = sensors.getTempC (app);
tl = sensors.getTempC (tll);
tb = sensors.getTempC (tbb);
x2 = sensors.getTempC (x11);
x4 = sensors.getTempC (x22);
x3 = sensors.getTempC (x33);
sensors.requestTemperatures();
}
Any ideas ? i can make external clock i guess, if it's needed some delays or so.