Skip to content

Instantly share code, notes, and snippets.

@grenade
Last active May 14, 2020 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grenade/d7289df5c83172b82052b2b87df9f978 to your computer and use it in GitHub Desktop.
Save grenade/d7289df5c83172b82052b2b87df9f978 to your computer and use it in GitHub Desktop.

the problem

integrate an outdoor, weather resistant, wiegand pin-code and rfid reader with cloud-based, but locally redundant, pin-code and rfid validation for building access.

  • rfid / pin-code reader should be cheap, tough and resistant to outdoor temperature, water and weather extremes
  • system should perform a lookup against an online api to validate codes and grant door access but fall back to local lookup when internet is unavailable.
    • system should periodically synchronise local access-code database with online database.
  • emergency exit from secured door should always be possible, with and without electricity and/or internet.

hardware

raspberry pi (4, b, 2gb)

wiegand device io includes:

  • electric lock relay output
    • com
    • nc (normally closed)
    • no (normally open)
  • alarm relay output
    • aua - com
    • nc (normally closed)
    • no (normally open)
  • power
    • +12v
    • gnd
    • push / no
    • opensw
    • door 1
    • bell
    • bell
  • alarm input
    • aux in
    • gnd
  • wiegand reader input
    • +12v
    • gnd
    • data 0
    • data 1

implementation strategy

  • wire the wiegand device to the raspi gpio interface (via 3.3v/5v/12v adapters).
  • treat the wiegand device as a dumb terminal.
  • listen for and process rfid reads and pin inputs from wiegand device on the raspi.
  • check reads from wiegand device against a local (raspi filesystem) database.
  • grant/reject access (door unlock) based on local logic and database.
  • log local reads, access and rejections locally.
  • sync local database with cloud database periodically.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment