[SOLVED] Unknown 1wire address detected

In my hardware setup, I did not connect any 1 wire sensor.

When I use a program "detect all 1wire addresses" I find nothing. So Okay

In another program "0x10, 0x53, 0x06, 0x5E, 0x03, 0x50, 0x00, 0x00" returns.
On internet I only can find ""Device is not a DS18S20 family device.".
But where comes this address from?

probably from the program we don't know anything about...

do yourself a favour and please read How to get the best out of this forum and provide the necessary documentation for your ask.

Sounds like "another program" is not the same program as "detect all 1wire addresses" and produces different results. That does not mean that there is a OneWire device hidden in your hardware setup.

Best to post a schematic, not a frizzy picture showing all interconnections with links to technical information on all the hardware devices. Properly posting your code would also help.

If you left the pin that you are testing disconnected and "floating" that address may be the sky (random noise).

I don't connect any sensor connected to the 1wire port.

With the first program, the response is "no addresses"

//=============================================================================
//Libraries
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>   // Source: LiquidCrystal_V1.2.1.zip

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address 
#define ONE_WIRE_BUS 12 //Data wire is plugged into port 12
OneWire  sensors(ONE_WIRE_BUS);  // Connect your 1-wire device to pin 12

//Pass our oneWir reference to Dallas Temperature
//DallasTemperature sensors(&oneWire);

//=============================================================================
void setup(void) {
  Serial.begin(9600);
  lcd.begin(20,4);
  discoverOneWireDevices();
}

//=============================================================================
void loop(void) {
  // nothing to see here
}
//=============================================================================
void discoverOneWireDevices(void) {
  byte i;
  byte present = 0;
  //byte data[12];
  byte addr[8];
  
  Serial.print("Looking for 1-Wire devices...\n\r");
	      while(sensors.search(addr)) {
  		      printAddress(addr);

		    //if ( OneWire::crc8( addr, 7) != addr[7]) { Serial.print("CRC is not valid!\n"); return;}
	      }
       
  Serial.print("\n\r\n\rThat's it.\r\n");
  sensors.reset_search();
  return;
}

//================================================================================================================
void printAddress(uint8_t temp[]){
   int i;
   //Serial.print("\n\rFound \'1-Wire\' device with address:\n\r");
   for( i = 0; i < 8; i++) {
        Serial.print("0x");
     
        if (temp[i] < 16) {Serial.print('0');}  //print a prevealing zero if necessary
        Serial.print(temp[i], HEX); ;
        if (i < 7) 
            {Serial.print(", ");}        //print a separator between all bytes
        }   //End for loop
     
   Serial.print("\n");
        
   }  //End subroutine

With this second program, two unknown addresses will come; they are not installed. What is the difference with the first "detect 1wire addresses"?  I am only interested to find DS18b20 temperature sensors? According the datasheet the least significant byte should always be '0x28'.

//================================================================================================================
//Libraries
#include <DallasTemperature.h>
#include <EEPROM.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>   // Source: LiquidCrystal_V1.2.1.zip
#include <OneWire.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address 
#define ONE_WIRE_BUS 12 //Data wire is pluggeg into port 12 of Arduino Nano
OneWire  ds(ONE_WIRE_BUS);  // Connect your 1-wire devices to pin 12, ds stands for  

//Define global parameters
byte i;    //position within arraybye
byte j=0;  //Number of ds passed 

uint8_t adrTcvForward[8];
uint8_t adrTcvBack[8]; 
uint8_t adrTvvForward[8];
uint8_t adrTvvBack[8]; 
String myString;

//================================================================================================================
void setup(void) {
  Serial.begin(9600);
  lcd.begin(20,4);
  
  //This call has to be moved to a control menu (so it will be executed once)
  Identify_1WireDevices();  
       
}

//================================================================================================================
void loop(void) {

byte n;
//
//for (n=0, n<1, n++) //Assign a bytearray once to adrTcvForth
//    { 
//    for (int i=0; i<8; i++) {adrTcvForward[i]=EEPROM.read(100+i);} 
//    for (int i=0; i<8; i++) {adrTcvBack[i]=EEPROM.read(108+i);}
//    for (int i=0; i<8; i++) {adrTvvForward[i]=EEPROM.read(116+i);}
//    for (int i=0; i<8; i++) {adrTvvBack[i]=EEPROM.read(124+i);} 
//    }  //End for
    
} //End loop

  
//================================================================================================================
void Identify_1WireDevices(void) {
  boolean blnExists;
  byte addr[8];
  byte addr1[8];   
  byte addr2[8];   
  byte addr3[8];   
  byte addr4[8];   
  int intSensorsPassed = 0;
 
  Serial.print("Looking for 1-Wire devices...\n\r");
  lcd.clear(); lcd.print ("Connect sensor 1");
  
  do   {
       ds.search(addr); 
            printAddress(addr);cr();
            if (addr[0] != 0x28)   //The least significant byt of the DS18b20 should be 0x28
                 {printAddress(addr); Serial.println (" doesn't concern to the DS-family.");}
                 else 
                {switch (intSensorsPassed) {  
                     case 0:    
                          //for (byte i =0; i<8; i++) {addr1[i] = addr[i];}   //Store the first addres in addr1
                          memcpy (addr, addr1, 8);  //Store the first addres in addr1
                          intSensorsPassed++;               
                          Serial.print ("Assigned to " + String(intSensorsPassed) + ": "); printAddress(addr1); cr(); 
                          Serial.println ("Sensors passed = " + String(intSensorsPassed)+ "\n");
                          lcd.setCursor(0,intSensorsPassed); lcd.print ("Add sensor " + String(intSensorsPassed + 1));           
                          break;
                    case 1:
                          //check if the address was earlier identified
                          //Serial.println("\nIncoming address = "); printAddress(addr);
                          if (memcmp(addr, addr1, 8) != 0) {
                              //Seems to be another (new) address
                              //Serial.println("Unknown sensor found");   
                              for (byte i =0; i<8; i++) {addr2[i] = addr[i];}  //Store the addess in addr2
                              memcpy (addr, addr2, 8);
                              //printAddress(addr); Serial.print("\n");  
                              intSensorsPassed++;  
                              Serial.print ("Assigned to " + String(intSensorsPassed) + ": "); printAddress(addr2); cr();
                              Serial.println ("Sensors passed = " + String(intSensorsPassed) + "\n");
                              lcd.setCursor(0,intSensorsPassed); lcd.print ("Add sensor " + String(intSensorsPassed + 1)); 
                                            
                              }  //End if
                              break;
                    case 2:
                           //check if the address was earlier identified
                          //Serial.println("\nIncoming address = "); printAddress(addr);
                          if ((memcmp(addr, addr1, 8) != 0)  && (memcmp(addr, addr2, 8) != 0)) {
                              //Serial.println("Unknown sensor found");   //Seems to be another (new) address
                              memcpy (addr, addr3, 8); //Copy the addess to addr3
                              intSensorsPassed++;  
                              Serial.print ("Assigned to " + String(intSensorsPassed) + ": "); printAddress(addr3); cr();
                              Serial.println ("Sensors passed = " + String(intSensorsPassed) + "\n");
                              lcd.setCursor(0,intSensorsPassed); lcd.print ("Add sensor " + String(intSensorsPassed + 1)); 
                              }  //End if              
                              break;
                     case 3:
                           //check if the address was earlier identified
                          //Serial.println("\nIncoming address = "); printAddress(addr);
                          if ((memcmp(addr, addr1, 8) != 0)  && (memcmp(addr, addr2, 8) != 0)  && (memcmp(addr, addr3, 8) != 0) ) {
                              //Serial.println("Unknown sensor found");   //Seems to be another (new) address
                              memcpy (addr, addr4, 8);  //Copy the addess to addr3
                              //printAddress(addr); Serial.print("\n");  
                              intSensorsPassed++;  
                              Serial.print ("Assigned to " + String(intSensorsPassed) + ": "); printAddress(addr4); cr();
                              Serial.println ("Sensors passed = " + String(intSensorsPassed) + "\n");              
                              }  //End if
                              break;
                          
                    } //End switch
                } //End if
              
               
           
       }  while (intSensorsPassed<4);    //End while sensors Passed
  Serial.print("\n\nThat's it.");
  
  } //End function      
          

//================================================================================================================
void printAddress(uint8_t temp2[]){
   int i;
   for( i = 0; i < 8; i++) {
        Serial.print("0x");  //Starting with the least significant byte
     
        if (temp2[i] < 16) {Serial.print('0');}  //print a prevealing zero if necessary
        Serial.print(temp2[i], HEX); ;
        if (i < 7) 
            {Serial.print(", ");}        //print a separator between all bytes
        }   //End for loop
     
   }  //End subroutine

//================================================================================================================
void cr()
    {Serial.println("\n");}

The second sketch doesn't bother to check if ds.search() was successful or not. If ds.search() returns 'false' then the random contents of the local array 'addr' is not changed. If the first byte is not 0x28 then the do-while loop just tries again, forever.

Here is a small sketch that will list the addresses:

#include <OneWire.h>

//Data wire is pluggeg into Pin 12 of Arduino
const byte ONE_WIRE_PIN = 12;

OneWire  OW(ONE_WIRE_PIN);

void setup(void)
{
  Serial.begin(115200);
  delay(200);

  byte addr[8];

  Serial.print("Looking for OneWire devices...\n\r");

  while (OW.search(addr))
  {
    printAddress(addr);

    if (addr[0] != 0x28)   //The least significant byt of the DS18b20 should be 0x28
    {
      Serial.print(" // Not a DS18B20");
    }
    Serial.println();

  } //End while
  Serial.println("End of list.");
}

void loop(void) {}

void printAddress(uint8_t addr[8])
{
  Serial.print('{');
  for (int i = 0; i < 8; i++)
  {
    Serial.print("0x");  //Starting with the least significant byte

    if (addr[i] < 16)
    {
      Serial.print('0'); //print a leading zero if necessary
    }

    Serial.print(addr[i], HEX); ;
    if (i < 7)
    {
      Serial.print(", "); //print a separator between all bytes
    }
  }   //End for loop
  Serial.print("}, ");
}  //End subroutine

Thanx a lot John, after your tip I adjusted my sketch, but for another reason I got again wrong results.

As technician I try to analyze problems by temporaly deselect some items, in this case I made some rows inactive; and YES It worked fine.

I seemed that I made a big error:
I used "memcpy(source, destination, size of array" (fault) in stead of
"memcpy(destination, source, size of array" (right(

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