Ground on one board to INPUT_PULLUP on another board

I’m new to Arduino and my general coding knowledge is limited. I’m using Arduino Unos to open and close relays based on inputs from PIR motion sensors (pin 10). I’ve built 5 of these circuits and my code probably isn’t efficient but it does what I expect it to.
I want the circuits to be scalable so that, if connected, the value from the PIR sensor on a master circuit will control the relays on slave circuits.
My plan was to have an output wire (pin 13) and an input wire (pin 11) on each circuit. I tried to use the same logic as I was using for the PIR sensor, but I experienced what I now believe is a floating pin (random highs / lows). I changed pin 11 from input to input pullup, reversed my highs / lows, and now I’m having a strange intermittent problem that doesn’t make sense to me.
I set the output (pin 13) on my master as low and connected it to the input_pullup (pin 11) on my slave but it didn’t override the pullup resistors to report low. I connected from ground on the master to pin 11 on the slave, it still didn’t work.
The curious thing is that if I run from a specific ground pin on the master to pin 11 on the master (the same circuit) it continuously triggers the loop which is what I would expect it to do. When I run from the same ground pin on the master to pin 11 on the slave it doesn’t work. It also doesn’t work if I connect any other ground pin on the master to pin 11 on the master.
I’ve repeated and replicated the results and switched the master and slave circuits to be relatively confident that all of the pins are behaving as they should and that the circuits are indeed identical.
Why would connecting from one ground pin to the input_pullup on the same circuit work but if I connect the same ground pin to the input pullup on an identical circuit it doesn’t work? Also, why does it work from one ground pin on a self-contained circuit but not from other ground pins on the same circuit?
My code is provided below. Your time and consideration are greatly appreciated!

int delay1 = 0;  //Delay between prop 1 and prop 2 (in seconds)
int delay2 = 0;  //Delay between prop 2 and prop 3 (in seconds)
int delay3 = 0;  //Delay between prop 3 and prop 4 (in seconds)
int delay4 = 0;  //Delay between prop 4 and prop 5 (in seconds)
int delay5 = 0;  //Delay between prop 5 and prop 6 (in seconds)
int delay6 = 0;  //Delay between prop 6 and prop 7 (in seconds)
int delay7 = 0;  //Delay between prop 7 and prop 8 (in seconds)
int delay8 = 5; //Delay between prop 8 and prop 1 (in seconds)
int led = 13;                // the pin that the LED is atteched to
int sensor10 = 10;              // the pin that the PIR motion sensor is atteched to
int sensor11 = 11;              // the pin that the PIR motion sensor is atteched to
int state10 = LOW;             // by default, no motion detected
int state11 = LOW;             // by default, no motion detected
int val10 = 0;                 // variable to store the sensor status (value)
int val11 = 0;                 // variable to store the sensor status (value)
const int relayPin2 =2; //the "s" of relay module attach to
const int relayPin3 =3; //the "s" of relay module attach to
const int relayPin4 =4; //the "s" of relay module attach to
const int relayPin5 =5; //the "s" of relay module attach to
const int relayPin6 =6; //the "s" of relay module attach to
const int relayPin7 =7; //the "s" of relay module attach to
const int relayPin8 =8; //the "s" of relay module attach to
const int relayPin9 =9; //the "s" of relay module attach to

void setup() {
  pinMode(led, OUTPUT);      // initalize LED as an output
  pinMode(sensor10, INPUT);    // initialize sensor as an input
  pinMode(sensor11, INPUT_PULLUP);    // initialize sensor as an input
  Serial.begin(9600);        // initialize serial
  pinMode(relayPin2, OUTPUT); //initialize relay as an output
  pinMode(relayPin3, OUTPUT); //initialize relay as an output
  pinMode(relayPin4, OUTPUT); //initialize relay as an output
  pinMode(relayPin5, OUTPUT); //initialize relay as an output
  pinMode(relayPin6, OUTPUT); //initialize relay as an output
  pinMode(relayPin7, OUTPUT); //initialize relay as an output
  pinMode(relayPin8, OUTPUT); //initialize relay as an output
  pinMode(relayPin9, OUTPUT); //initialize relay as an output
}

void loop(){
  val10 = digitalRead(sensor10);   // read sensor value
  val11 = digitalRead(sensor11);   // read sensor value
  if (val10 == HIGH or val11 == LOW) {           // check if the sensor is HIGH
    digitalWrite(led, LOW);   // turn LED ON
    digitalWrite(relayPin2, HIGH); //disconnect the relay 
    delay(delay1*1000);                // delay   
    digitalWrite(relayPin3, HIGH); //disconnect the relay 
    delay(delay2*1000);                // delay  
    digitalWrite(relayPin4, HIGH); //disconnect the relay  
    delay(delay3*1000);                // delay 
    digitalWrite(relayPin5, HIGH); //disconnect the relay   
    delay(delay4*1000);                // delay 
    digitalWrite(relayPin6, HIGH); //disconnect the relay  
    delay(delay5*1000);                // delay  
    digitalWrite(relayPin7, HIGH); //disconnect the relay  
    delay(delay6*1000);                // delay  
    digitalWrite(relayPin8, HIGH); //disconnect the relay
    delay(delay7*1000);                // delay
    digitalWrite(relayPin9, HIGH); //disconnect the relay 
    delay(1000);                // delay
    digitalWrite(led, HIGH);   // turn LED ON
      digitalWrite(relayPin2, LOW); //Close the relay
      digitalWrite(relayPin3, LOW); //Close the relay
      digitalWrite(relayPin4, LOW); //Close the relay
      digitalWrite(relayPin5, LOW); //Close the relay
      digitalWrite(relayPin6, LOW); //Close the relay
      digitalWrite(relayPin7, LOW); //Close the relay
      digitalWrite(relayPin8, LOW); //Close the relay
      digitalWrite(relayPin9, LOW); //Close the relay
    delay(10);                // delay
        for (int x=0; x < delay8; x++) {     // Wait for 1 second
      delay(1000);
   }
    
  } 
  else {
      digitalWrite(led, HIGH);   // turn LED ON
      digitalWrite(relayPin2, LOW); //Close the relay
      digitalWrite(relayPin3, LOW); //Close the relay
      digitalWrite(relayPin4, LOW); //Close the relay
      digitalWrite(relayPin5, LOW); //Close the relay
      digitalWrite(relayPin6, LOW); //Close the relay
      digitalWrite(relayPin7, LOW); //Close the relay
      digitalWrite(relayPin8, LOW); //Close the relay
      digitalWrite(relayPin9, LOW); //Close the relay
      
      delay(1);             // delay 1 milliseconds 
      
  }
}
/*************************************************/

Do you have the GND on each Arduino connected together ?

No, I don't have the GNDs on the two boards connected together. I have a GND on one board (the master) connected to an INPUT_PULLUP pin on the other board (the slave). This setup does not override the pullup resisters to return a low value. The confounding part is that if I don't touch the end connected to the GND pin but I switch the end connected to the INPUT_PULLUP pin from the slave to the same pin on the master it does exactly what I expect it to. I even reversed the master and slave roles to verify that it is behaving the same regardless of which circuit sends the output and which one takes the input.

Connecting GND on Uno board 1 to the INPUT_PULLUP pin on Uno board 2 does not cause the INPUT_PULLUP pin to return a low value.

Connecting GND on Uno board 1 to the INPUT_PULLUP pin on board 1 does cause the INPUT_PULLUP pin to return a low value. (but only one of the GND pins produces this result, the others do not).

Well, change that quickly. Your approach is completely wrong. Connect the grounds of each board together, and connect signal wires from each board together. If you have further troubles, please post a clear photo of a drawing of your wiring.

Thank you for the help but I'm not sure how to implement it to achieve my goal. If I follow your instructions I don't understand how I'm creating a path between GND on board 1 and the INPUT_PULLUP pin on board two.

I'm trying to do exactly what is illustrated in the INPUT_PULLUP Serial tutorial. A link is provided below and the schematic from the tutorial is attached.

I just used a breadboard and switch to verify that my logic does exactly what the tutorial says it should as long as GND and the INPUT_PULLUP pin are on the same board. If I leave everything else the same but move the GND pin to another board it does not work.

There is something we need to get out of the way before continuing. Have you, or have you not, yet connected the grounds between the two boards?

To isolate the part of the circuit that I'm troubleshooting I created exactly the circuit in the schematic and it worked. If I move the GND connection to a second board but leave everything else the same it doesn't work. I get the same results when I switch the to and from boards. A picture is attached.

My plan isn't ultimately to connect directly to GND. I want to set an output pin to low when the PIR motion sensor input on that circuit is high. When I wasn't getting the result that I wanted I moved to GND to verify that my problem isn't how I am handling the INPUT_PULLUP.

The simplest way to ask my question is this: If I can create two identical circuits that work why would they not work if the only change I make is to source GND from a different board? I confirmed that both GND pins are behaving as expected when the circuits are self contained to one board.

I just returned my circuit back to the state I was in before my first post, then connected GND to GND. It works perfectly! Thank you very much AARG but is there a simple way for you to explain to me what the GND to GND connection is doing?

qaburk:
I just returned my circuit back to the state I was in before my first post, then connected GND to GND. It works perfectly! Thank you very much AARG but is there a simple way for you to explain to me what the GND to GND connection is doing?

It's a return path for any electrons that you exchange with the other board on the other conductors. Circuit means circle!

Thank you very much aarg and UKHeliBob. I apologize for being a stubborn student. I just follow directions better when I understand how they will get me to the destination. I should have followed your instructions first and asked questions later.

I should have followed your instructions first and asked questions later.

Unfortunately this happens too many times with new people.

qaburk:
Thank you very much AARG but is there a simple way for you to explain to me what the GND to GND connection is doing?

Basically, there is no such thing as an absolute signal (voltage) level. All voltage measurements are actually a measurement of the potential difference between two points. In most circuits all nodes are measured relative to a common reference node, the ground node. So, when you connect the ground nodes of two circuits you are giving them a common reference node.

So now, HIGH and LOW signal levels in one circuit mean the same thing in the other circuit (assuming they use the same logic family and have the same supply voltage). Additionally (as mentioned above) any current that flows from one circuit to the other (for example OUTPUT pin to INPUT pin) on a signal wire returns through the ground path.