Skip to main content

Grove - 125KHz RFID 读卡器

这款 Grove-125KHz RFID 读卡器是一个用于读取 uem4100 RFID 卡信息的模块,具有两种输出格式:Uart 和 Wiegand。它具有高灵敏度,最大感应距离为 7cm。还有此模块的电子积木版本。它可以帮助您实现物联网和门禁控制系统等项目。

在使用 RFID 读卡器时,您应该使用以下模块:

版本

产品版本变更发布日期
Grove - 125KHz RFID 读卡器 V1.0初始版本2015年10月

规格参数

参数数值/范围
电压4.75-5.25V
工作频率125 KHz
感应距离(最大)70mm
TTL 输出9600 波特率,8 数据位,1 停止位,无校验位
Wiegand 输出26 位 Wiegand 格式,1 偶校验位,24 数据位,1 奇校验位
tip

有关 Grove 模块的更多详细信息,请参考 Grove 系统

支持的平台

ArduinoRaspberry Pi
caution

上述提到的支持平台是/是该模块软件或理论兼容性的指示。在大多数情况下,我们只为 Arduino 平台提供软件库或代码示例。不可能为所有可能的 MCU 平台提供软件库/演示代码。因此,用户必须编写自己的软件库。

开始使用

note

如果这是您第一次使用 Arduino,我们强烈建议您在开始之前先查看 Arduino 入门指南

与 Arduino 配合使用

硬件

  • 步骤 1. 准备以下物品:
Seeeduino V4.2Base ShieldGrove - 125KHz RFID Reader
enter image description hereenter image description hereenter image description here
立即购买立即购买立即购买
  • 步骤 2. 将 Grove - 125KHz RFID Reader 连接到 Grove-Base Shield 的 D2 端口。
  • 步骤 3. 将 Grove - Base Shield 插入 Seeeduino。
  • 步骤 4. 通过 USB 线将 Seeeduino 连接到 PC。

note

如果我们没有 Grove Base Shield,我们也可以直接将 Grove_Ultrasonic_Ranger 连接到 Seeeduino,如下所示。

SeeeduinoGrove - 125KHz RFID Reader
5VRed
GNDBlack
D3White
D2Yellow

软件

  • 步骤 1. 将代码复制到 Arduino IDE 中并上传。如果您不知道如何上传代码,请查看 如何上传代码
/*
link between the computer and the SoftSerial Shield
at 9600 bps 8-N-1
Computer is connected to Hardware UART
SoftSerial Shield is connected to the Software UART:D2&D3
*/

#include <SoftwareSerial.h>

SoftwareSerial SoftSerial(2, 3);
unsigned char buffer[64]; // buffer array for data receive over serial port
int count = 0; // counter for buffer array

void setup()
{
SoftSerial.begin(9600); // the SoftSerial baud rate
Serial.begin(9600); // the Serial port of Arduino baud rate.
}

void loop()
{
// if date is coming from software serial port ==> data is coming from SoftSerial shield
if (SoftSerial.available())
{
while(SoftSerial.available()) // reading data into char array
{
buffer[count++] = SoftSerial.read(); // writing data into array
if(count == 64)break;
}
Serial.write(buffer, count); // if no data transmission ends, write buffer to hardware serial port
clearBufferArray(); // call clearBufferArray function to clear the stored data from the array
count = 0; // set counter of while loop to zero
}
if (Serial.available()) // if data is available on hardware serial port ==> data is coming from PC or notebook
SoftSerial.write(Serial.read()); // write it to the SoftSerial shield
}
void clearBufferArray() // function to clear buffer array
{
// clear all index of array with command NULL
for (int i=0; i<count; i++)
{
buffer[i]=NULL;
}
}
  • 步骤 2. 打开串口监视器,卡片信息可以显示如下:

Wiegand 模式

(跳线设置到右边两个引脚) 您需要将跳线选择到"W"来进入此模式。 适用于 Seeeduino 的 Wiegand 演示代码 设计用于在中断模式下读取 Wiegand 数据。

在 Wiegand 模式下,输出数据格式为 26 位,包括 24 位卡片信息和 2 位奇偶校验位。

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

PE

D

P0

E

0

D2[7..0]

D1[7..0]

D0[7..0]

  • PE 是偶校验位,PO 是奇校验位;
  • E 是参与偶校验的数据位,O 是参与奇校验的数据位;
  • DX[7..0] 是对应 Mifare@ Standard & Light 卡只读 ID 的数据位;

常见问题

Q1:如何将输出转换为卡号?

A1:请按照以下步骤操作。

  • 以 ID:0009776930 为例:
  • 卡号 ID:0009776930 ------- 十进制 [起始位(00) + 卡号(8位数字)]
  • 输出:0700952F229F ------------- 十六进制 [[起始位(07h) + 卡号(8位数字) + 校验和]
  • 十进制和十六进制数字的计算器可在线获取。

Q2:如何连续读取标签?

A2:RFID 读取器可以连续读取标签而无需任何设置。将标签保持在距离天线 2.5-4 厘米的位置,读取器可以连续读取数据。如果距离小于 2.5 厘米,读取器只会读取一次数据,除非移开标签。

资源

项目

基于 Arduino 的安全项目使用 Cayenne:基于 Arduino 的家庭安全项目。检测到入侵者时发送短信/邮件警报。为授权人员提供个性化消息。

技术支持与产品讨论

感谢您选择我们的产品!我们在这里为您提供不同的支持,以确保您使用我们产品的体验尽可能顺畅。我们提供多种沟通渠道,以满足不同的偏好和需求。

Loading Comments...