• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

monkeyboard/Wiegand-Protocol-Library-for-Arduino: Wiegand 26 and Wiegand 34 Prot ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

monkeyboard/Wiegand-Protocol-Library-for-Arduino

开源软件地址(OpenSource Url):

https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino

开源编程语言(OpenSource Language):

C++ 100.0%

开源软件介绍(OpenSource Introduction):

Wiegand 4 bit, 8 bit, 24 bit, 26 bit, 32 bit and 34 bit library for Arduino

The Wiegand interface is a de facto standard commonly used to connect a card reader or keypad to an electronic entry system. Wiegand interface has the ability to transmit signal over long distance with a simple 3 wires connection. This library uses interrupt pins from Arduino to read the pulses from Wiegand interface and return the code and type of the Wiegand.

Different Wiegand libraries comparison

Library Description
Wiegand library This is the easiest and cleanest library to use when only a single wiegand reader is needed. I strongly suggest to use this version if you only need one reader support
Wiegand NG library This is another single reader library, however it uses dynamic memory to store the raw wiegand thus allowing unlimited bit length to be stored as long as your Arduino board has the memory to store it. I won't recommend to use this library unless you are facing a non-standard wiegand reader that sends out data that will not be decoded by the original Wiegand library.
Multi Wiegand library This library uses pin change interrupt this allowing all the pin change interrupt supported pin to be used. With this, multiple readers can also be supported. Due to a workaround (hack) used to overcome the limitation with attachInterrupt not being able to be attached to class method directly, the initialisation of the sketch is more ugly and complicated.

Requirements

The following are needed

  • Arduino - Any ATMEGA328 compatible board should work.
  • Wiegand RFID Reader - The code was written for this reader however customers reported working with HID compatible readers.
  • DATA0 of Wiegand connects to Arduino PIN 2 and DATA1 of Wiegand connects to Arduino PIN 3

Installation

Create a folder named Wiegand in Arduino's libraries folder. You will have the following folder structure:

cd arduino/libraries
git clone https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino.git Wiegand

Arduino Sketch

alt text

Execute Arduino IDE, select Example-->Wiegand-->WiegandTest

Example


#include <Wiegand.h>

WIEGAND wg;

void setup() {
	Serial.begin(9600);  
	
	// default Wiegand Pin 2 and Pin 3 see image on README.md
	// for non UNO board, use wg.begin(pinD0, pinD1) where pinD0 and pinD1 
	// are the pins connected to D0 and D1 of wiegand reader respectively.
	wg.begin();
}

void loop() {
	if(wg.available())
	{
		Serial.print("Wiegand HEX = ");
		Serial.print(wg.getCode(),HEX);
		Serial.print(", DECIMAL = ");
		Serial.print(wg.getCode());
		Serial.print(", Type W");
		Serial.println(wg.getWiegandType());    
	}
}

Contributors

softwarefoundry added library.properties

Francesco Uggetti (ugge75) improved this version of library to support multiple readers for ATMEGA2560. Please check out his version of multiple wiegand readers library here

Apollon77 improved interrupt safety and removed sysTick from global

paulfurley added 4 bit code

PaulStoffregen added Use digitalPinToInterrupt on newer Arduino software, if present

tholum Simpler Instructions

zanhecht Recognize 24- and 32-bit

luckymallari Simplified begin(D0, D1) for ESP(8266/32) devices.

Written by JP Liew

Project home: http://www.monkeyboard.org/tutorials/82-protocol/24-wiegand-converter

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap