Giter VIP home page Giter VIP logo

wiegand-protocol-library-for-arduino's Introduction

Wiegand 4 bit, 8 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.

NON Standard Bit Length

This library was designed to decode standard Wiegand protocol with 1 START bit, 1 STOP bit and bit length stated in the title. For multi-bit length protocol, please try Wiegand NG Multi Bit Wiegand Library for Arduino.

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);  
	wg.begin(); // wg.begin(pinD0, pinD1) for ESP8266/ESP32
}

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

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.

wiegand-protocol-library-for-arduino's People

Contributors

jpliew avatar paulstoffregen avatar tholum avatar zanhecht avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.