Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Simple Card-Based Access Control

DZone's Guide to

Simple Card-Based Access Control

Got a secret base? Want to make sure only your henchmen can enter? Make your own RFID card reader to make sure unauthorized users don't thwart your plans.

· IoT Zone
Free Resource

This project implements a very common access control device. The LTPS is equipped with Tibbit #08 (clock/data and Wiegand interface). It gets card codes from an external RFID card reader. The project lets you save usernames and their ID codes into the database, as well as verify the cards you read against the records of the database. When you read a card where the ID code matches any ID code from the database, the terminal "grants access" (the blue LED turns on). If this ID code has no match in the database, the terminal "denies access" (the red LED turns on).

This simple project demonstrates all main techniques that are important to building access control solutions with LTPS.

Some other distinctive features of this project:

  • The project utilizes a full-featured embedded SQLite SQL database engine.

  • The web interface shows card reader events in a real time.


Image title

What You Need

Hardware

* In this case, blue and red LED Tibbits indicate the "Access granted" and "Access denied" state.

Onboard Software

  • SQLite database engine to store cardholder's info and events;

  • Node.js V6.x.x (pre-installed during production)

Image title

Image title

Image title

GitHub Repository

Name: wiegand-demo

Repository page: https://github.com/tibbotech/wiegand-demo

Clone URL: https://github.com/tibbotech/wiegand-demo.git

Updated at: Mon, Oct. 10, 2016.

Node.js Application

  • The app utilizes the sqlite3 module as a permanent event and cardholder data store. The module is a serverless, self-contained SQL database engine which does not need any other software to be installed on the device.*

  • Express and socket.io support web interface functionality.

* The module is written in C++. A precompiled version will be installed from Tibbo's GitHub during the app installation. If you want to install the module from NPM, you should also install build-essential on the device.

Configuration and Installation

  • Define the configuration in the LTPS Web Interface.

  • Login to the LTPP3 board from the SSH client.

  • Install NPM and other tools as required. Git-perltools are needed to install the precompiled sqlite3 module from GitHub.

  • Install the app:

git clone https://github.com/tibbotech/wiegand-demo.git
cd wiegand-demo
npm install .
  • Launch a simple app called app0: 

node app0


  • Read an RFID card. Its binary code should be displayed in the console.

  • Stop app0.

  • Launch the main app:
node app


Web Client

Functionality

The web interface includes three tabs.

Add a User Tab

To enroll a user:

  • Click READ CARD.

  • Read a card; the ID code from this card will be displayed in the User ID field.

  • Fill in the First Name and Last Name fields manually.

  • Click ADD USER to make a new record in the database.

Image title


User List Tab

This tab displays all the records you've created. It also allows you to delete user records.

Image title

Events Tab

This tab displays access control events on-the-fly.

Image title

With that, you've got your own RFID card reader for whatever you may want it for. With the software on hand, you can add and view users and look at recent events. Go ahead and explore to your heart's content.

Topics:
nodejs ,ltps ,iot ,tutorial ,rfid

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}