servo working then not working

Hello, I have been working on a door opener. The servo will open the latch with either a push button, remote or key card, a green led and buzzer comes on with an oled displaying, "Door open come in!".

This sketch was working fine. I had to dismantle it and put it back together again and it stopped working. I found out that the servo was the issue. It keeps vibrating on its own and it seems to be shorting out the IR receiver and RFID.

When I remove everything and just plug in the servo on its own, it keeps vibrating on its own. I am pluggin in groung to ground, vcc to 5V and pin 3. Here is my code.

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <IRremote.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(OLED_RESET);


 
#define SS_PIN 53 // Uno pin 10 Nano pin D10 of RFID
#define RST_PIN 5 // Uno pin 9 Nano pin D9 of RFID
#define SERVO_PIN 3    //servo pin 3
#define ACCESS_DELAY 2000
#define DENIED_DELAY 1000
#define LED_G 7     //led green pin 7
#define LED_R 6     //led red pin 6
#define BUZZER 4    //buzzer pin 4
#define pushButtonPin 8  //push button pin 8
int buttonPushed = 0;

decode_results results;
Servo myservo;
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
int IRpin = 11;      //IR receiver pin 11
IRrecv irrecv(IRpin);
 
void setup()
{
  Serial.begin(9600); // Initiate a serial communication
  irrecv.enableIRIn();

 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();

 
  SPI.begin(); // Initiate SPI bus
  mfrc522.PCD_Init(); // Initiate MFRC522
  myservo.attach(SERVO_PIN);
 
  
 
 pinMode (SDA, OUTPUT);
 
  pinMode (LED_G, OUTPUT);
  pinMode (LED_R, OUTPUT);
  pinMode (BUZZER, OUTPUT);
  pinMode(pushButtonPin, INPUT_PULLUP);
}
void loop()
{
  //the followiing is the oled display
   display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
    display.display();
  display.clearDisplay();
  
  //start of IR SKETCH
 
  if (irrecv.decode(&results))
  {
    irrecv.resume();
  }
  if (results.value == 3249146358) //remote control button
  {
    delay(500);
    digitalWrite (LED_G, HIGH);  //led turns on
    digitalWrite(BUZZER, HIGH);  //buzzer turns on
    delay(500);                 // for half a second
    digitalWrite(BUZZER, LOW);   //buzzer turns off
    myservo.write( 0 );          //servo goes to 0 degrees
    
display.setTextSize(2);   //oled display's message
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
    
    delay(7500);                   //for 7 and a half seconds
    myservo.write( 100 );          //servo goes to 100 degrees
    digitalWrite (LED_G, LOW);   //led green turns off
  
 
  }
 
 
  /* start of pushbutton sketch
    Everytime you press pushbutton it will turn on green led and buzzer, then servo
    will go from 0 to 100 degrees for 7 and a half seconds.  Then the push button
    will go from 1 to 0 state (on/off).*/

  if (digitalRead(pushButtonPin) == LOW) {
    buttonPushed = 1;
     }
     
  if ( buttonPushed ) {
     
    digitalWrite (LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(500); 
   digitalWrite(BUZZER, LOW);
    myservo.write(0);


    display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
  
    delay(7500);
    myservo.write(100);
    digitalWrite (LED_G, LOW);
    buttonPushed = 0;
    
  }


  //start of RFID SKETCH
  // Look for new cards
 
  if
  ( ! mfrc522.PICC_IsNewCardPresent())
  {
    return;
  }
 
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
  Serial.println("Put your card to the reader...");
  Serial.println();
 
  //Show UID on serial monitor
  Serial.print("UID tag :");
 
  String content = "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
    Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
    Serial.print(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
  if (content.substring(1) == "5A 77 E2 81", "F9 31 75 9C") //change here the UID of the card
    {
    Serial.println("Authorized access");
    Serial.println();
    delay(500);
    digitalWrite(LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(300);
    digitalWrite(BUZZER, LOW);
    myservo.write( 0 );
display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
    
    delay(7500);
    myservo.write( 100 );
    digitalWrite(LED_G, LOW);
  }
else {
    Serial.println(" Access denied");
    digitalWrite(LED_R, HIGH);
    digitalWrite (BUZZER, HIGH);
    delay(DENIED_DELAY);
    digitalWrite(LED_R, LOW);
    digitalWrite(BUZZER, LOW);
  }
  
  }

When I try the example sketch for the servo it works perfectly.

//www.elegoo.com
//2018.12.19
#include <Servo.h>
/* After including the corresponding libraries,
   we can use the "class" like "Servo" created by the developer for us.
   We can use the functions and variables created in the libraries by creating 
   objects like the following "myservo" to refer to the members in ".".*/

Servo myservo;
//it created an object called myservo.
/*  you can see Servo as a complex date type(Including functions and various data types)
    and see myservo as variables.               */

void setup(){
  /*"attach" and "write" are both functions,
     and they are members contained in the complex structure of "Servo". 
     We can only use them if we create the object "myservo" for the complex structure of "Servo".
  */
  myservo.attach(3);//connect pin 9 with the control line(the middle line of Servo) 
  myservo.write(90);// move servos to center position -> 90°
} 
void loop(){
  myservo.write(90);// move servos to center position -> 90°
  delay(1000);
  myservo.write(60);// move servos to center position -> 60°
  delay(1000);
  myservo.write(90);// move servos to center position -> 90°
  delay(1000);
  myservo.write(150);// move servos to center position -> 120°
  delay(1000);
}

Keep in mind that I am just plugging in the servo on its own before adding the led, buzzer, RFID and IR reciever.

I tried using a different arduino board and its the same issue. I am using an Elegoo Mega2560.
Any ideas?

spiderman288888:
This sketch was working fine. I had to dismantle it and put it back together again and it stopped working.

The best bet is that you did not reassemble it in the same way that it was previously. My guess is that that is at least 80% likely.

It is not a good idea to power a servo from the Arduino 5v pin as it probably can't provide enough current. A servo (like any motor) should have a separate power supply.

...R

It cant be the wiring as I stated, when I hook up only the servo and nothing else. it starts to vibrate. The only wires attached to the arduino are the gnd, vcc, and pin 3 (as I am testing for the exact problem). That doesnt explain why it worked well before I dismantled it. Why does it not vibrate when I upload the example sketch? The wiring is exactly the same.

You may have a timer conflict (although that should be flagged by the compiler). Try commenting out the IR part.

I uploaded this and its not vibrating, but it is pulsing now. I tried it with 3 different servos and 3 different arduinos.

#include <Servo.h>
Servo myservo;

void setup()
{
  Serial.begin(9600); // Initiate a serial communication
  myservo.attach(3);
}

void loop()
{

}

Again when I upload this code below from the examples, the pulsing goes away.

//www.elegoo.com
//2018.12.19
#include <Servo.h>
/* After including the corresponding libraries,
   we can use the "class" like "Servo" created by the developer for us.
   We can use the functions and variables created in the libraries by creating 
   objects like the following "myservo" to refer to the members in ".".*/

Servo myservo;
//it created an object called myservo.
/*  you can see Servo as a complex date type(Including functions and various data types)
    and see myservo as variables.               */

void setup(){
  /*"attach" and "write" are both functions,
     and they are members contained in the complex structure of "Servo". 
     We can only use them if we create the object "myservo" for the complex structure of "Servo".
  */
  myservo.attach(9);//connect pin 9 with the control line(the middle line of Servo) 
  myservo.write(90);// move servos to center position -> 90°
} 
void loop(){
  myservo.write(90);// move servos to center position -> 90°
  delay(1000);
  myservo.write(60);// move servos to center position -> 60°
  delay(1000);
  myservo.write(90);// move servos to center position -> 90°
  delay(1000);
  myservo.write(150);// move servos to center position -> 120°
  delay(1000);
}

The wiring is exactly the same.

Maybe not.

Sorry, this is the code for the example. It is pin 3 not 9. It pulses here.

#include <Servo.h>[color=#222222][/color]
Servo myservo;[color=#222222][/color]
[color=#222222][/color]
void setup()[color=#222222][/color]
{[color=#222222][/color]
  Serial.begin(9600); // Initiate a serial communication[color=#222222][/color]
  myservo.attach(3);[color=#222222][/color]
}[color=#222222][/color]
[color=#222222][/color]
void loop()[color=#222222][/color]
{[color=#222222][/color]
[color=#222222][/color]
}

But not here.

//www.elegoo.com[color=#222222][/color]
//2018.12.19[color=#222222][/color]
#include <Servo.h>[color=#222222][/color]
/* After including the corresponding libraries,[color=#222222][/color]
   we can use the "class" like "Servo" created by the developer for us.[color=#222222][/color]
   We can use the functions and variables created in the libraries by creating[color=#222222][/color]
   objects like the following "myservo" to refer to the members in ".".*/[color=#222222][/color]
[color=#222222][/color]
Servo myservo;[color=#222222][/color]
//it created an object called myservo.[color=#222222][/color]
/*  you can see Servo as a complex date type(Including functions and various data types)[color=#222222][/color]
    and see myservo as variables.               */[color=#222222][/color]
[color=#222222][/color]
void setup(){[color=#222222][/color]
  /*"attach" and "write" are both functions,[color=#222222][/color]
     and they are members contained in the complex structure of "Servo".[color=#222222][/color]
     We can only use them if we create the object "myservo" for the complex structure of "Servo".[color=#222222][/color]
  */[color=#222222][/color]
  myservo.attach(3);//connect pin 9 with the control line(the middle line of Servo)[color=#222222][/color]
  myservo.write(90);// move servos to center position -> 90°[color=#222222][/color]
}[color=#222222][/color]
void loop(){[color=#222222][/color]
  myservo.write(90);// move servos to center position -> 90°[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  myservo.write(60);// move servos to center position -> 60°[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  myservo.write(90);// move servos to center position -> 90°[color=#222222][/color]
  delay(1000);[color=#222222][/color]
  myservo.write(150);// move servos to center position -> 120°[color=#222222][/color]
  delay(1000);[color=#222222][/color]
}

Sorry, ignore the

I guess this comes out when you copy and paste from the forum

Ok, so after literally taking the whole day to figure this out and nearly renouncing Arduino forever I decided to try a fourth, yes, a FOURTH servo I had and it worked! No vibrating or humming, however there were some issues. My original project was the servo, pushbutton, led, buzzer, RFID, IR reciever. Here is the code.

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <IRremote.h>
 
#define SS_PIN 53 // Uno pin 10 Nano pin D10 of RFID
#define RST_PIN 5 // Uno pin 9 Nano pin D9 of RFID
#define SERVO_PIN 3    //servo pin 3
#define ACCESS_DELAY 2000
#define DENIED_DELAY 1000
#define LED_G 7     //led green pin 7
#define LED_R 6     //led red pin 6
#define BUZZER 4    //buzzer pin 4
#define pushButtonPin 8  //push button pin 2
int buttonPushed = 0;
decode_results results;
Servo myservo;
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
int IRpin = 11;      //IR receiver pin 11
IRrecv irrecv(IRpin);
 
void setup()
{
  Serial.begin(9600); // Initiate a serial communication
  irrecv.enableIRIn();
 
 
  SPI.begin(); // Initiate SPI bus
  mfrc522.PCD_Init(); // Initiate MFRC522
  myservo.attach(SERVO_PIN);
 
 
 
 
  pinMode (LED_G, OUTPUT);
  pinMode (LED_R, OUTPUT);
  pinMode (BUZZER, OUTPUT);
  pinMode(pushButtonPin, INPUT_PULLUP);
}
void loop()
{
  //start of IR SKETCH
 
  if (irrecv.decode(&results))
  {
    irrecv.resume();
  }
  if (results.value == 3249146358)
  {
    delay(500);
    digitalWrite (LED_G, HIGH);  //led turns on
    digitalWrite(BUZZER, HIGH);  //buzzer turns on
    delay(500);                 // for half a second
    digitalWrite(BUZZER, LOW);   //buzzer turns off
    myservo.write( 0 );          //servo goes to 0 degrees
    delay(7500);                   //for 7 and a half seconds
    myservo.write( 100 );          //servo goes to 100 degrees
    digitalWrite (LED_G, LOW);   //led green turns off
  }
 
 
  /* start of pushbutton sketch
    Everytime you press pushbutton it will turn on green led and buzzer, then servo
    will go from 0 to 100 degrees for 7 and a half seconds.  Then the push button
    will go from 1 to 0 state (on/off).*/
  if (digitalRead(pushButtonPin) == LOW) {
    buttonPushed = 1;
  }
  if ( buttonPushed ) {
    
    digitalWrite (LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(500);
    digitalWrite(BUZZER, LOW);
    myservo.write(0);
    delay(7500);
    myservo.write(100);
    digitalWrite (LED_G, LOW);
    buttonPushed = 0;
  }
  //start of RFID SKETCH
  // Look for new cards
 
  if
  ( ! mfrc522.PICC_IsNewCardPresent())
  {
    return;
  }
 
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
  Serial.println("Put your card to the reader...");
  Serial.println();
 
  //Show UID on serial monitor
  Serial.print("UID tag :");
 
  String content = "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
    Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
    Serial.print(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
  if (content.substring(1) == "5A 77 E2 81", "F9 31 75 9C") //change here the UID of the card
    {
    Serial.println("Authorized access");
    Serial.println();
    delay(500);
    digitalWrite(LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(300);
    digitalWrite(BUZZER, LOW);
    myservo.write( 0 );
    delay(7500);
    myservo.write( 100 );
    digitalWrite(LED_G, LOW);
  }
else {
    Serial.println(" Access denied");
    digitalWrite(LED_R, HIGH);
    digitalWrite (BUZZER, HIGH);
    delay(DENIED_DELAY);
    digitalWrite(LED_R, LOW);
    digitalWrite(BUZZER, LOW);
  }
  
  }

After hours and hours of testing, I found out that adding the OLED seems to fry my servos. :o Am I correct in saying this? It seemed to have fried the RFID as it doesn't work anymore and I will have to wait some time to order some new ones but the LED, servo, pushbutton and IR receiver work fine with my first code.

Is there a way to make the LED, servo, pushbutton, RFID, IR receiver AND the OLED to work together or will it continue to fry my servos? When I try uploading the second sketch the OLED will display text but the servo will not work. It did seem to work for a while with the other servos. The servos are the little blue ones that come in the Elegoo kit.

I have seen people use projects with 3 servos just fine. I know each servo requires 5V to run. My servo, IR reciever and OLED each require 5V. The RFID only 3.3V. I am using two 18650 batteries to power it all. I thought that would be enough power. Suggestions?

I wanted to make my little door opener a little more flashy by adding the OLED display. Here is the code that may have fried the servo.

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <IRremote.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET     4 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(OLED_RESET);


 
#define SS_PIN 53 // Uno pin 10 Nano pin D10 of RFID
#define RST_PIN 5 // Uno pin 9 Nano pin D9 of RFID
#define SERVO_PIN 9    //servo pin 3
#define ACCESS_DELAY 2000
#define DENIED_DELAY 1000
#define LED_G 7     //led green pin 7
#define LED_R 6     //led red pin 6
#define BUZZER 4    //buzzer pin 4
#define pushButtonPin 8  //push button pin 2
int buttonPushed = 0;
decode_results results;
Servo myservo;
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
int IRpin = 11;      //IR receiver pin 11
IRrecv irrecv(IRpin);
 
void setup()
{
  Serial.begin(9600); // Initiate a serial communication
  irrecv.enableIRIn();

 display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();

 
  SPI.begin(); // Initiate SPI bus
  mfrc522.PCD_Init(); // Initiate MFRC522
  myservo.attach(SERVO_PIN);
 
  
 
 pinMode (SDA, OUTPUT);
 
  pinMode (LED_G, OUTPUT);
  pinMode (LED_R, OUTPUT);
  pinMode (BUZZER, OUTPUT);
  pinMode(pushButtonPin, INPUT_PULLUP);
}
void loop()
{
   display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  
  display.display();
  display.clearDisplay();
  //start of IR SKETCH
 
  if (irrecv.decode(&results))
  {
    irrecv.resume();
  }
  if (results.value == 3249146358)
  {
    delay(500);
    digitalWrite (LED_G, HIGH);  //led turns on
    digitalWrite(BUZZER, HIGH);  //buzzer turns on
    delay(500);                 // for half a second
    digitalWrite(BUZZER, LOW);   //buzzer turns off
    myservo.write( 0 );          //servo goes to 0 degrees
    
display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
    
    delay(7500);                   //for 7 and a half seconds
    myservo.write( 100 );          //servo goes to 100 degrees
    digitalWrite (LED_G, LOW);   //led green turns off
  
 
  }
 
 
  /* start of pushbutton sketch
    Everytime you press pushbutton it will turn on green led and buzzer, then servo
    will go from 0 to 100 degrees for 7 and a half seconds.  Then the push button
    will go from 1 to 0 state (on/off).*/
  if (digitalRead(pushButtonPin) == LOW) {
    buttonPushed = 1;
     }
     
  if ( buttonPushed ) {
     
    digitalWrite (LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(500); 
   digitalWrite(BUZZER, LOW);
    myservo.write(0);


    display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
  
    delay(7500);
    myservo.write(100);
    digitalWrite (LED_G, LOW);
    buttonPushed = 0;
 
  
    
  }
  //start of RFID SKETCH
  // Look for new cards
 
  if
  ( ! mfrc522.PICC_IsNewCardPresent())
  {
    return;
  }
 
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())
  {
    return;
  }
  Serial.println("Put your card to the reader...");
  Serial.println();
 
  //Show UID on serial monitor
  Serial.print("UID tag :");
 
  String content = "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++)
  {
    Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
    Serial.print(mfrc522.uid.uidByte[i], HEX);
    content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
    content.concat(String(mfrc522.uid.uidByte[i], HEX));
  }
  Serial.println();
  Serial.print("Message : ");
  content.toUpperCase();
  if (content.substring(1) == "5A 77 E2 81", "F9 31 75 9C") //change here the UID of the card
    {
    Serial.println("Authorized access");
    Serial.println();
    delay(500);
    digitalWrite(LED_G, HIGH);
    digitalWrite(BUZZER, HIGH);
    delay(300);
    digitalWrite(BUZZER, LOW);
    myservo.write( 0 );
display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("Door open come in!");
  display.display();
 display.clearDisplay();
    
    delay(7500);
    myservo.write( 100 );
    digitalWrite(LED_G, LOW);
  }
else {
    Serial.println(" Access denied");
    digitalWrite(LED_R, HIGH);
    digitalWrite (BUZZER, HIGH);
    delay(DENIED_DELAY);
    digitalWrite(LED_R, LOW);
    digitalWrite(BUZZER, LOW);
  }
  
  }

spiderman288888:
I have seen people use projects with 3 servos just fine. I know each servo requires 5V to run. My servo, IR reciever and OLED each require 5V. The RFID only 3.3V. I am using two 18650 batteries to power it all. I thought that would be enough power. Suggestions?

Without seeing a diagram showing how you have everything connected it is impossible to comment. A photo of a simple pencil diagram will be best - even if you are poor at drawing.

...R

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Not a Fritzy picture.
Please include how you are powering your project.

Thanks.. Tom... :slight_smile:

I made a drawing of the circuit. Is there a way to attach it without it being a URL? How do you make an image you took from your phone into a URL? All the videos I see on youtube require Photoshop, which I dont have.

Please be gentle with my drawing as this is my first time.

door lock resize.jpg

ground and vcc resize.jpg

door lock resize.jpg

ground and vcc resize.jpg

The bottom picture is where I connect all ground and vcc. The left side is the ground. The bottom is vcc. All ground lines are soldered together. All vcc is soldered together. They all work as I checked each line. As I stated, the IR, LED's, buzzer and servo work when connected. The RFID may have burned out. When I plug in the OLED, the servo stops working, but when I press the push button or use the IR, it will display.

Hi,
What voltage are you feeding into the DC socket?
It looks like 3V7 from two Lipo's in parallel.
It needs to be 7V or higher voltage on the DC socket for the onboard regulator to output 5V for the controller.
Have you measured the 5V and 3V3 pins?

Tom... :slight_smile:

spiderman288888:
Please be gentle with my drawing as this is my first time.

It also looks as if the servo is being powered from the Arduino 5v pin. That is not a good idea as the 5v pin may not be able to supply enough current. Servos (and motors generally) should have their own power supply with the power supply GND connected to the Arduino GND.

...R

That worked!!! Thanks fellas!!!! I made sure they were plugged directly into their own ground in the Arduino board. I noticed that when I plugged in the RFID, I had plugged in pin 53 and 52 on the ground. Looking at the Arduino Mega from top view, it looks like I plugged them in the right spot but I didn't. The RFID now works too!! I have 2 cards that allow access as seen here in my code

if (content.substring(1) == "5A 77 E2 81", "F9 31 75 9C")

Why is it that when I use a different card, it allows access as well even though the numbers on the tags are different? When I open the serial monitor, it will display the tags are different than the ones on the code above but it still grants access.