mercoledì 8 gennaio 2014

Access control with Arduino Mega & Wiegand RFID Card Reader

The needed was replace the old key access connected to my automatic access gate , during the investigation on internet the decision was to upgrade  all the access of  my house with RFID access control .
I'm a maker so I don't like by a system and install, I wand do it as i like.
First of all need to do some shopping ... ebay is my preferred market place and for electronic ICs_Processors_Store is the best, so put all the necessary  in your basket : 

N. 3 Waterproof Security Door Black ID Wiegand 26 RFID Card Reader 125KHz EM4100




N .1 Mega 2560 ATmega2560-16AU Board Arduino-compatible ( Arduino team sorry this is not the original one .. :-( ....) 






N.5pcs RFID Tokens 125Khz EM4100



This is the minimum required  for start .. sure you need a laboratory with a minimum set of  component and knowledge of Arduino programming a Electronics.

I have start my project using Arduino library developed from Monkey Board
http://www.monkeyboard.org )

You can download the original library from : https://github.com/monkeyboard/Wiegand-Protocol-Library-for-Arduino.git

Unfortunately this library is able to manage only one reader and so only one access can be managed, the library is built on the hardware capability of the Arduino UNO , only two interrupt available on pin,  both used for the two line communication used from Wiegand protocol.

Thanks  Arduino Mega more interrupt available  on external pin if you use due the limit is the number of pin ..
From Arduino web site http://arduino.cc/en/Reference/attachInterrupt is possible compare the interrupt capability for each boards :

Boardint.0int.1int.2int.3int.4int.5
Uno, Ethernet23
Mega25602321201918
Leonardo32017
Due(see below)
The Arduino Due board has powerful interrupt capabilities that allows you to attach an interrupt function on all available pins. You can directly specify the pin number in attachInterrupt().

With six external interrupt on pin change  Arduino Mega can manage three RFID readers and consequently three doors/gate, but the library need some modification for manage all the interrupt and for recognize from which readers come the request.

In the modified library the command WIENGAND.getGateActive(); was added in the WIENGND class for recognize the gate from where the request come .

Library can be download from : https://github.com/ugge75/Wiegand-Protocol-Library-for-Arduino-MEGA-2560

I will update the blog  with the first release of software in the coming weeks.

Cheers..

Francesco







8 commenti:

  1. Imprnt.in also offer a price promise so if you find products here that are cheaper somewhere else, then we promise to do everything to ensure that our prices down. So, what you're looking for when it comes to your CCTV camera systems , Biometric Attendance Systems , you are bound to find the perfect product to suit your needs with us.

    RispondiElimina
    Risposte
    1. Provide me a link I will look in for get the best you promise.

      Elimina
  2. What about security? Why don't use a Mifare 3DES or similar like?

    RispondiElimina
  3. Hi, Francesco. Reader1 and reader3 are working but reader2(pin21 and pin20) not working. Is there any solution?

    RispondiElimina
  4. Dear Prgrmr ,

    There a part of code commented , remove "//" from line 111, 112, 113 & 114 in file WiegandMega2560.cpp or download the library from Github problem should be fix , in case of problem persist please leave a new comment .
    thanks
    francesco

    RispondiElimina
  5. Hi Francesco, I will be using Rfid of similar model as the one you have used above.The difference is my model uses 12 volt.So i'm not sure on how to interface it with my arduino uno which uses 5v power supply.I'm powering up my arduino using computer as creating an attendance system with database which uses rfid reader interfaced with arduino which is then connected to the gsm network. Besides that, its written on my reader that there are 6 wires in the rfid reader and 1 of it which is grey in colour is the WG26/34. So how do i connect it to the arduino uno?I have a brief idea on where the rest of the wires go except for the wg26/34. I hope you could help me with this..Thanks in advance..

    RispondiElimina
  6. Ciao Francesco, Grazie per il codice!
    Ma ho una domanda.
    Deve consentire alla porta "D". Includo i codici e cambiato le variabili, ma non ha funzionato. Io uso i pin 16 / 17. Ci sono modi per eseguire il porta D?

    Grazie per l'aiuto!

    Antonio Carlos Bruno
    e-mail: ac.bruno@terra.com.br


    Hello Francesco, Thanks for the code!
    But I have a question.
    Must enable the gate "D". I include the codes and changed the variables, but did not work. I use the pins 16 / 17. There are ways to run the gate "D"?

    Thank you for your help !

    Antonio Carlos Bruno
    email: ac.bruno@terra.com.br

    RispondiElimina
  7. Ciao Francesco,
    hai avuto esperienze con dispositivi Wiegand tastierino + rfid? Vorrei realizzare un sistema di apertura porta con uno di questi dispositivi, utilizzando Arduino per la verifica del codice inserito tramite tastierino o del tag rfid, per consentire l'apertura della porta.

    Credi sia fattibile?

    Grazie mille

    RispondiElimina