Problem With Custom Breakout Board And Digital Pins

I made a custom relay board to learn PCB design and various other things. I am running into a problem where whenever I hook up my PCB, the digital pin HIGH/LOW state wont change. So to just get some general knowledge of the problem I disconnected one of my bodge wires on the PCB so the circuit was open. Whenever I opened the circuit the digital pin state changed from high to low fine. But whenever I put the wire back and closed the circuit, the digital pin state would be stuck in its original state. I'm thinking this might be something to do with a pull-up resistor not being in the design but I'm not entirely sure on if that is a relevant fix or not. I included pictures of the schematic, the serial output message when the circuit was closed (the one with the alternating 1's and 0's), and the serial output message when the circuit was open (the one with all 0's).

Code:

void setup() {
  Serial.begin(9600);
  pinMode(4, OUTPUT);
  digitalWrite(4, LOW);
}



void loop() {

  if (Serial.available())  {

    while (Serial.available() > 0)  {
      
      char SerialRead = Serial.read();
      int DigitalRead = digitalRead(4);



      if (SerialRead == 'o')
      {
        if (digitalRead(4) == LOW) {
          digitalWrite(4, HIGH);
          Serial.print(DigitalRead);
        }
        else {
          digitalWrite(4, LOW);
          Serial.print(DigitalRead);
        }
      }
    }
  }
}

pullups are appropriate to outputs.

You likely have a short circuit on the board. Check with a multmeter?

Nope, no shorts on the PCB or with my soldering


How to post images
How to post an image.
Another page on posting images.

What Arduino board? What is Vcc (5V, 3.3V)? What color LED?

It is an Arduino Mega. It is connected to GND, 5V, and Digital Pin 4. The LED and resistor is replaced by a jumper cable because the resistors i ordered are too high resistance to switch the base of the transistor. So IN is connected directly to the transistor base

“ So IN is connected directly to the transistor base”

If ‘IN’ is then connected directly to an Arduino output pin, you will damage that pin and maybe the controller too.

You need a series base resistor !

Yep the base resistor worked. Thank you, I've been trying to figure it out the past couple of days