Вы находитесь на странице: 1из 12

AJUAN SISWA YANG IKUT LKS SMK 2017

SMK NEGERI 1 SINDANG

I. NAMA LKS YANG DI IKUTI : INDUSTRY CONTROL


II. PESERTA

NO NAMA SISWA NIS KELAS KOMPETENSI KEAHLIAN

1 DUNI ANDRIAN 151610388 XII TOI 2 Teknik Otomasi Industri

III. PENDAMPING

NO NAMA PENDAMPING NIP KETERANGAN

LUKMAN MUSTAFID, Guru Teknik Otomasi


1 197609152009021002
M.Kom Industri

Indramayu, 24 Agustus 2017

Ketua Kompetensi Keahlian,

HUSNI ANSHARI, S. Pd
NIP. 197008162008011006
Using RFID Reader Module with
Simple Arduino
By the shopkeeper

When 1 year ago

What is RFID?
RFID (Radio frequency identification) is a technology that uses radio frequency (RFID ) to
store information. For identification purposes, for example, put together with items to identify
items. Use student ID to identify student information. Shared device is

RFID reader / writer is a machine to read data. Or write the data to the RFID card, which read
/ write machine is divided into the frequency range. Includes include read only support. Or write
support

The most commonly used standard RFID reader ( softpowergroup.net )

RFID tags or RFID tags (RFID tags) - The interior is composed of two parts: the data
store. And Saturdays weather This tag can be stored without power. When the radio is sent to the
tag. The tag is sent as a data signal back to the RFID tag. It is divided into the same supported
frequency range as the reader / writer and is also classified according to the capacity of the data.
Components of RFID Tag ( barcodesinc.com )

RFID cards have been widely used today, such as used in student identification cards to identify
students. Use as a prepaid card in the food court. Or use as a parking ticket. Also used to prevent
theft in department stores as well.

RFID with Arduino compatibility


As mentioned above, RFID can be very useful. Embedded systems are so popular and widely
used as a system clock. Or do the door unlocking system.

In this article, we will try to use RFID reader module version of frequency
13.56MHz MFRC522inside the set will have a photo card. And the key lock came with it. This
makes it easy to experiment with.

RFID reader module, model MFRC522 can be used with Arduino board easily have written
libraries to use it. You can download
it. Https://github.com/miguelbalboa/rfid Once downloaded, click the Download ZIP button on
the right.
Once the download is complete. Extract all the files to. Documents \ Arduino \ libraries

Open the Arduino program and then go to File> Examples. Scroll to MFRC522.
Back to the circuit before. When the luggage is removed, the MFRC-522 module is not soldered
to the fishbone. Need to solder the fishbone to make it easier to use before. (To insert into the
board recommended to use straight legs. If you want to attach to the box or to the extension cord,

The circuit can follow the picture below it.

*** Be careful about connecting the 3.3 V input voltage if connected to 5V may damage the
module ***.
The case is not as good as the picture. Can be listed in the table below.

MFRC522 Arduino
3.3V 3.3V
RES D9
GND GND
MISO D12
MOSI D11
SCK D13
SDA (SS) D10

Back to Arduino program to code the code below. Then upload the code into the Arduino board
(save the file first).

#include "SPI.h"
#include "MFRC522.h"

#define SS_PIN 10
#define RST_PIN 9
#define SP_PIN 8

MFRC522 rfid (SS_PIN, RST_PIN);

MFRC522 :: MIFARE_Key key;

Void setup () {
Serial.begin (9600);
SPI.begin ();
Rfid.PCD_Init ();
}

Void loop () {
if (! Rfid.PICC_IsNewCardPresent () ||! Rfid.PICC_ReadCardSerial ())
return ;

// Serial.print (F ("PICC type:"));


MFRC522 :: PICC_Type piccType = rfid.PICC_GetType (rfid.uid.sak);
// Serial.println (rfid.PICC_GetTypeName (piccType));

// Check is the PICC of Classic MIFARE type


if (piccType! = MFRC522 :: PICC_TYPE_MIFARE_MINI &&
PiccType! = MFRC522 :: PICC_TYPE_MIFARE_1K &&
PiccType! = MFRC522 :: PICC_TYPE_MIFARE_4K) {
Serial.println (F ( "Your tag is not of type MIFARE Classic." );
Return ;
}

String strID = "" ;


For (byte i = 0; i <4; i ++) {
StrID + =
("Rfid.uid.uidByte [i] <0x10? " 0 " : " ) +
String (rfid.uid.uidByte [i], HEX) +
(?! = 3? ":" : "" );
}
StrID.toUpperCase ();

// At this point, the variable strID will store the UID of the tag
// can be used, for example, to enter IF to the tube
// LED is on or off.
Serial.print ( "Tap card key " );
Serial.println (strID);

Rfid.PICC_HaltA ();
Rfid.PCD_StopCrypto1 ();
}
Once uploaded, open Serial Moniter up to 9600 baud rate. Try both tags to touch to give
different UID value.
This UID value (or key) is stored in the strID variable, which will be used after line 41. The code
below is an RFID tag that controls the LED off.

#include "SPI.h"
#include "MFRC522.h"

#define SS_PIN 10
#define RST_PIN 9
#define LED_PIN A0

MFRC522 rfid (SS_PIN, RST_PIN);

MFRC522 :: MIFARE_Key key;

Void setup () {
Serial.begin (9600);
SPI.begin ();
Rfid.PCD_Init ();
PinMode (LED_PIN, OUTPUT);
}

Void loop () {
if (! Rfid.PICC_IsNewCardPresent () ||! Rfid.PICC_ReadCardSerial ())
return ;
// Serial.print (F ("PICC type:"));
MFRC522 :: PICC_Type piccType = rfid.PICC_GetType (rfid.uid.sak);
// Serial.println (rfid.PICC_GetTypeName (piccType));

// Check is the PICC of Classic MIFARE type


if (piccType! = MFRC522 :: PICC_TYPE_MIFARE_MINI &&
PiccType! = MFRC522 :: PICC_TYPE_MIFARE_1K &&
PiccType! = MFRC522 :: PICC_TYPE_MIFARE_4K) {
Serial.println (F ( "Your tag is not of type MIFARE Classic." );
Return ;
}

String strID = "" ;


For (byte i = 0; i <4; i ++) {
StrID + =
("Rfid.uid.uidByte [i] <0x10? " 0 " : " ) +
String (rfid.uid.uidByte [i], HEX) +
(?! = 3? ":" : "" );
}
StrID.toUpperCase ();

Serial.print ( "Tap card key:" );


Serial.println (strID);

// LED control code by taking the value from the strID variable
if (strID.indexOf ( "E4: 0A: BA: EB" )> = 0) {
DigitalWrite (LED_PIN, HIGH);Else { else
}
DigitalWrite (LED_PIN, LOW);
}

Rfid.PICC_HaltA ();
Rfid.PCD_StopCrypto1 ();
}

The results are based on the clips below.

To end
RFID is useful and applicable to a wide variety of applications. But what should take into
account is good user interaction, such as reading tag data. There should be a signal. Include the
user should be advised that the tag used. Is it validated (for example, if the tag is approved? It
should also be noted that the holding tag is not used.) It should be flexible to use. Adding tag
numbers should be easy. Without uploading a program to revise (using EEPROM to store and
manage tag data)

-------------------------------------------------- -----------------------------------------

Вам также может понравиться