Tuesday, 16 April 2013 21:05
Arduino and Stronglink SL018 RFID module

Among the RFID modules, Stronglink SL018 is the lowest cost RFID module that I can get which supports read and write. SL018 is a 13.56MHz RFID module, it supports Mifare 1K, Mifare 4K and Mifare Ultralight. The specification are as follow:
Model
|
MIFARE Module SL018
|
Frequency
|
13.56MHz
|
Protocol
|
ISO14443A
|
Tag supported
|
Ultralight, NTAG203, MIFARE Mini, MIFARE ™ Classic 1K, 4K MIFARE Classic ™, FM11RF08
|
Interface
|
I2C
|
Supply voltage
|
4.4 - 7.0VDC
|
Dimension
|
65 × 45 mm
|
To communicate with Arduino, Marc Boon had developed the SL018 library for Arduino which support reading UID of tags and reading/writing tags.
Stand alone Stronglink SL018 module
By supplying 5V to the SL018 module, the module is able to detect Mifare RFID tags without connecting to the controller such as Arduino. L3 LED will turn on if a Mifare RFID tag is detected within range, 3V appear at Pin1 (Tags) if measured from GND.

Install the SL018 library for Arduino
- Download the SL018 library, it supports SL030 RFID module as well.
- Extract the Zip file (RFIDuino-master.zip)
- Copy the SL018 folder to the libraries folder of Arduino as shown in figure below

Verify SL018 library is installed correctly
- Launch the Arduino software, I'm using Arduino 1.0.4
- You will be able to see the SL018 examples as shown in figure below if everything is working correctly.

Upload sketch to Arduino
Marc Boon RFID library included examples for reading the UID of tags.
Marc Boon RFID library included examples for reading the UID of tags.
- Connect Arduino to computer
-
Launch the Arduino software
-
Click on File>Examples>SL018>UID to use load the UID example
#include <Wire.h> #include <SL018.h> SL018 RFID; int led = 13; void setup() { pinMode (LED, OUTPUT); Wire.begin (); Serial.begin (19200); Serial.println("Show me your tag"); // prompt for tag } void loop () { rfid.seekTag () / / start the seek mode while (! rfid.available ()) / / wait until detected tag Serial.println (rfid.getTagString ()); / / print some id }
-
Click on upload button to start upload the above sketch to Arduino.
-
Upon completing uploading, the next step will be connect the SL018 module to Arduino for testing.
Connecting SL018 RFID module to Arduino
AL018 uses i2c for communication, only two signal is used (Pin2 and Pin3). Connect the SL018 and Arduino based on table below:
AL018 uses i2c for communication, only two signal is used (Pin2 and Pin3). Connect the SL018 and Arduino based on table below:
SL018
|
Arduino
|
1 (TAG)
|
A3 (Analog 3)
|
2 (SDA)
|
A4 (Analog 4)
|
3 (SLC)
|
A5 (Analog 5)
|
4 (VCC)
|
VCC
|
5 (GND)
|
GND
|
SL018 RFID module communicate with Arduino
- Connecting SL018 and Arduino based on table above
- Launch the Arduino software
- L3 LED will turn on if Mifare tag detected within range, the UID of the tag will appear in the Serial Monitor (make sure baud rate is 19200) as shown in figure below.

Improve the coding for use with Verification
Code below demonstrate an LED will turn on if verification is passed, LED will turn off after 3 seconds.
#include <Wire.h> #include <SL018.h> SL018 rfid; int led = 13; // Pin 13 has an LED connected on most Arduino boards String cardUID; void setup() { pinMode(led, OUTPUT); // initialize the digital pin as an output. Wire.begin(); Serial.begin(19200); Serial.println("Show me your tag"); // prompt for tag } void loop() { rfid.seekTag(); // start seek mode while(!rfid.available()); // wait until tag detected cardUID = rfid.getTagString(); Serial.println( cardUID); // print tag id if ( cardUID == "0467CB11E20280") { digitalWrite(led, HIGH); // turn the LED on delay(3000); //wait for 3 seconds digitalWrite(led, LOW); // turn the LED off } }
Reading and Writing demonstration
The sl018demo example come with Mac Boon RFID library, features include:
- Read UID
- Read all the information in the RF tag
- Write two bytes to the RF tag
Use the same step as above to upload sl018demo sketch to Arduino. When everything is ready, we use the Serial Monitor to monitor the result. Here is how we do it:
Enter ? will bring up the help screen as shown in figure below:

a command
Use to toggle auto read ON of OFF. When Auto Read is ON, the SL018 module will read the tag and display the tag information in the Serial Monitor as long as the Mifare tag is within range.
Use to toggle auto read ON of OFF. When Auto Read is ON, the SL018 module will read the tag and display the tag information in the Serial Monitor as long as the Mifare tag is within range.
d command
Use to toggle debug ON or OFF. When Debug is ON, the command send to SL018 module and its results will display int the Serial Monitor.
s command to
Read and list the UID of the tag
Read and list the UID of the tag

r command to
Read and list the UID of the tag & also read and list the information of the tag
Read and list the UID of the tag & also read and list the information of the tag

w command
writes two bytes to RFID tag
writes two bytes to RFID tag

Published in
Blog
Tagged under