Ticker

6/recent/ticker-posts

Header Ads Widget

RFID Simulation in Proteus with Arduino

Hello Guys, In this simulation tutorial, I will help you to simulate an RFID reader in Proteus with Arduino UNO. As you know RFID Library for Proteus is not available yet, so I found a way to simulate it using a virtual terminal.

Before Starting, I will share some details about the EM18 RFID Reader based on UART Communication. EM-18 RFID Reader can provide output via two communication methods "RS232" and "WEIGAND". It can be selected by setting the logic output on the SEL pin of EM-18. If the SEL pin is set to HIGH the communication medium will be RS232 (UART) and if the SEL pin is pulled down to LOW the communication medium will be WEIGAND. I am going to use RS232 here because of its popularity.

The default baud rate of this module is set to 9600 bps (bits per second), Use the same baud rate to retrieve information. If the baud rate mismatches you will get some garbage output on your terminal.

EM18 SPECIFICATION

  • Operating  voltage of EM-18: +4.5 V to +5.5 V
  • Current consumption: Less than 50 mA
  • Can operate on LOW power
  • Operating temperature: 0 ºC to +80 ºC
  • Operating frequency:125 kHz
  • Communication parameter: 9600 bps
  • Reading distance: 10 cm, depending on TAG
  • Integrated Antenna

SOURCE CODE:

int count = 0;
char c;
String id;

void setup() {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  Serial.println("Please scan your RFID TAG");
 
}

void loop() {
  while(Serial.available()>0)
  {
    c = Serial.read();
   count++;
   id += c;
   if(count == 12)  
    {
      Serial.print(id);
      //break;
     
      if(id=="AB123456789A")
      {
        Serial.println("Valid TAG");
        digitalWrite(13, HIGH);
      }
      else
      {
      digitalWrite(13, LOW);
      Serial.println("Invalid TAG");
      }
    }
  }
  count = 0;
  id="";
  delay(500);

}

Video Tutorial

  

Post a Comment

0 Comments