How do i make kind of a AND gate?

I am currently working on a project, where if i hold my RFID card to my RFID card reader my PC will turn on.

So i wanna make it so when i scan my card, i have 5 seconds to turn ON my PC via the front panel on/off switch.
If you did not know, the PC turns on when 2 speciffic pins on the motherboard touch.
So i thought about just connecting up my arduino to theese, but that would make the on/off switch on my front panel useless, and i dont want that.

I think i should connect ONE of the pins coming from the front panel straight to the motherboard and the other one from the front panel to the arduino, so i can make them touch when i scan my RFID card

I am a noob when it comes to programming, but here is what i have now(not currently working tho)

/*
* edited by Velleman / Patrick De Coninck
* Read a card using a mfrc522 reader on your SPI interface
* Pin layout should be as follows (on Arduino Uno - Velleman VMA100):
* MOSI: Pin 11 / ICSP-4
* MISO: Pin 12 / ICSP-1
* SCK: Pin 13 / ISCP-3
* SS/SDA (MSS on Velleman VMA405) : Pin 10
* RST: Pin 9
* VCC: 3,3V (DO NOT USE 5V, VMA405 WILL BE DAMAGED IF YOU DO SO)
* GND: GND on Arduino UNO / Velleman VMA100
* IRQ: not used
*/

#include <SPI.h>
#include <RFID.h>

#define SS_PIN 10
#define RST_PIN 9


RFID rfid(SS_PIN,RST_PIN);


int power = 7;
int led = 8; 
int serNum[5];
/*
* This integer should be the code of your card/tag.
*/
int cards [][5] = {{250, 1, 17, 11, 225}};

bool access = false;

void setup(){

    Serial.begin(9600);
    SPI.begin();
    rfid.init();

/*
* define VMA100 (UNO) pins 7 & 8 as outputs and put them LOW
*/
    pinMode(led, OUTPUT);
    pinMode (power,OUTPUT);
    digitalWrite(led, LOW);
    digitalWrite (power,LOW);
   
}

void loop(){
    
    if(rfid.isCard()){
    
        if(rfid.readCardSerial()){
            Serial.print(rfid.serNum[0]);
            Serial.print(" ");
            Serial.print(rfid.serNum[1]);
            Serial.print(" ");
            Serial.print(rfid.serNum[2]);
            Serial.print(" ");
            Serial.print(rfid.serNum[3]);
            Serial.print(" ");
            Serial.print(rfid.serNum[4]);
            Serial.println("");
            
            for(int x = 0; x < sizeof(cards); x++){
              for(int i = 0; i < sizeof(rfid.serNum); i++ ){
                  if(rfid.serNum[i] != cards[x][i]) {
                      access = false;
                      break;
                  } else {
                      access = true;
                  }
              }
              if(access) break;
            }
           
        }
        
       if(access){
           Serial.println("Acces granted!");
           
}
}
}

/*
* Valid card : Switch ON the POWER PIN for 2000 ms (2 seconds)), the POWER PIN can activate for example a relais, controlling a doorlock)
*/           
           digitalWrite(8, HIGH);
           delay(1000);
           digitalWrite(8, LOW);
           access = false;
           
      } else {
/*
* NON-Valid card : switch ON and OFF the LED twice for 0,5 seconds
*/
           Serial.println("Acces denied!"); 
           digitalWrite(led, HIGH);
           delay(500);
           digitalWrite(led, LOW); 
           delay(500);
           digitalWrite(led, HIGH);
           delay(500);
           digitalWrite(led, LOW);         
       }        
    }
    
    
    
    rfid.halt();

}

Thanks :slight_smile:

The Arduino outputs can’t function as a switch. You would need to use a circuit, for example an opto-isolator, to enable/disable the PC mounted switch. If you put the opto in series with the switch, you have “and” logic, if in parallel, then it will give you “or” logic.

Relays are very useful things.
Wiring a relay's contacts to the pins your referred to would preserve the utility of the PC power switch.
No worries about polarities and so on, uncomplicated and effective.