Skip to the content
PCBKitNew board
2 layersRaspi nfc lock, the printed circuit board in 3D

Raspi nfc lock

rambo/nfc_lock30

(more) secure electric lock with DESFire EV1 NFC tags

Copper layers
2
Thickness
1.6 mm
Parts
80
Nets
56
Pads
257
Tracks, vias
490, 58
Pours
4
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
25 Oct 2014
Updated
6 Jun 2024

Overview

Raspi nfc lock is an open-source printed circuit board by rambo, from the rambo/nfc_lock repository on GitHub, published under the MIT licence. It is a 2-layer board with 80 parts on 56 nets, routed with 490 tracks and 58 vias.

It is built around the LM2596S-5.0, 74HC14 and TXB0104PW, with the MMBT3904, SMF15A and AO2300 among its other parts. Its parts include 33 resistors, 13 connectors, 11 diodes, 10 capacitors and 3 ICs. It belongs with the radio and wireless boards of this library.

Main components

10

README

README.md

nfc_lock

(more) secure electric lock with DESFire EV1 NFC tags

libnfc and libfreefare

text
sudo apt-add-repository ppa:christopher-hoskin/ppa
sudo apt-get update
sudo apt-get install libnfc5 libnfc-bin libnfc-pn53x-examples libnfc-examples
sudo apt-get install libfreefare0 libfreefare-bin
sudo apt-get install python-zmq python-yaml python-tornado

python-yaml and python-tornado can be installed to virtualenv (esp tornado might be better to install via pip even if not to virtualenv the deb pulls unneccessary dependencies), zmq will be painful to install via pip, use the system package.

For compiling

For the C programs.

text
sudo apt-get install libfreefare-dev libnfc-dev libssl-dev pkg-config libzmq-dev

RasPi

All libraries should be part of normal releases now.

Terms

  • Card (PICC in NXP terms): The DESFire EV1 chip+antenna in a package (fob, card, sticker...)
  • Pre-Personalization step: Where card default master key is changed and applications are defined.
  • Application: collection of files on the card, application can have multiple keys for various purposes
  • Provisioning (or personalization) step: Where a personalized card is issued to a card holder and the card (plus backing datababase) is updated with relevant info
  • Diversified key: Key that has been derived from a master key via the method described in NXP AN19022

SQLite for keys

Create a test file sqlite3 keys.db:

text
CREATE TABLE valid_tokens (value TEXT UNIQUE, type INTEGER, acl INTEGER, external_ids TEXT);
CREATE TABLE revoked_tokens (value TEXT UNIQUE, type INTEGER);

Prepare some tags and insert their (real) UIDs to the grants and revokes

text
INSERT INTO revoked_tokens VALUES ("04453069b21e80");
INSERT INTO valid_tokens VALUES ("04212f69b21e80", 0, 1);

In reality you will generate this file based on your person registry (keep track of validity times etc there, then regenerate the keydb for the door).

Hacking

Remember to valgrind your C programs (valgrind -v --leak-check=yes myprog args) at the same time as you do general functionality testing.

RasPi

It seems Valgrind does not (and will not) support some instructions we use to talk with the NFC chips, see (this stackoverflow)valgrindworkaround for a workaround.

Parts

80
QtyValueFootprintReferences
164k7Resistors_SMD:R_0603R107, R108, R109, R110, R111, R112, R113, R114, R115, R116, R117, R118, R119, R120, R121, R127
11Screw_Terminal_01x02TerminalBlock_Phoenix:TerminalBlock_Phoenix_MPT-0,5-2-2.54_1x02_P2.54mm_HorizontalJ102, J103, J104, J105, J106, J107, J108, J109, J110, J111, J112
7100nCapacitors_SMD:C_0603C101, C102, C103, C104, C105, C108, C109
510Resistors_SMD:R_0603R102, R103, R104, R105, R106
5LEDDiode_SMD:D_0603_1608MetricD102, D103, D104, D105, D106
4MountingHoleMounting_Holes:MountingHole_3.2mm_M3H101, H102, H103, H104
3DNIResistors_SMD:R_0603R123, R124, R131
20RResistors_SMD:R_0603R125, R130
22k21Resistors_SMD:R_0603R101, R129
2470RResistors_SMD:R_0603R132, R133
2MMBT3904Package_TO_SOT_SMD:SOT-23Q101, Q103
2SMF15ADiodes_SMD:D_SOD-123D101, D108
1100nCapacitors_SMD:C_1206C110
110RResistors_SMD:R_0603R122
110kResistors_SMD:R_0603R126
11MResistors_SMD:R_0603R128
1220 μF 25VCapacitors_SMD:CP_Elec_8x10C106
1470uF 10VCapacitors_SMD:CP_Elec_8x10.5C107
174HC14Package_SO:SOIC-14_3.9x8.7mm_P1.27mmU101
1AO2300Package_TO_SOT_SMD:SOT-23Q102
1BUZZERTerminalBlock_Phoenix:TerminalBlock_Phoenix_MPT-0,5-2-2.54_1x02_P2.54mm_HorizontalJ113
1G6ERelay_THT:Relay_SPDT_Omron_G6EK101
1LED_OPENDiode_SMD:D_0603_1608MetricD109
1LM2596S-5.0Package_TO_SOT_SMD:TO-263-5_TabPin3U102
1MM3Z12Diode_SMD:D_SOD-323D110
1Polyfuse 1.5AFuse_Holders_and_Fuses:Fuse_SMD2920F101
1Raspberry_Pi_2_3Pin_Headers:Pin_Header_Straight_2x20_Pitch2.54mmJ101
1SP0502BAHTPackage_TO_SOT_SMD:SOT-23D111
1SS34Diodes_SMD:D_SMAD107
1SWRB1204S-330MTInductor_SMD:L_12x12mm_H6mmL101
1TXB0104PWPackage_SO:TSSOP-14_4.4x5mm_P0.65mmU103

Questions

What parts does the Raspi nfc lock use?

80 parts, built around the LM2596S-5.0, 74HC14, TXB0104PW and MMBT3904. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Raspi nfc lock KiCad files?

From the rambo/nfc_lock repository on GitHub, at the commit this page was made from: the board is hardware/raspi_nfc_lock.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Raspi nfc lock design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers35 × 42 mmAstroUniBoard, the printed circuit board in 3D

    AstroUniBoard

    xlazam01/AstroUniBoard

    STM32G0B1-based telescope focuser/rotator controller — OnStepX firmware port + KiCad PCB

    146 parts1GPL-3.0
  • 4 layersFanCTRL, the printed circuit board in 3D

    FanCTRL

    MuffinKing-jpeg/FanCTRL

    Controlled board for PC fans, with mux capabilities. WIP

    272 parts
  • 4 layersOut conn fan, the printed circuit board in 3D

    Out conn fan

    MuffinKing-jpeg/KiCAD-Parts

    This is just a library of components used by me.

    13 parts
  • 4 layers99.5 × 92.4 mmCabina, the printed circuit board in 3D

    Cabina

    josevasquez123/SLEEP-OASIS-CABINA-PCB

    104 parts
  • 4 layers72.5 × 76.4 mmPuerta, the printed circuit board in 3D

    Puerta

    josevasquez123/SLEEP-OASIS-PUERTA-PCB

    74 parts
  • 4 layers99.5 × 92.4 mmCabina, the printed circuit board in 3D

    Cabina

    josevasquez123/WNR-CABINA-PCB

    104 parts
  • 4 layers94 × 81.8 mmESP32 IO Controller, the printed circuit board in 3D

    ESP32 IO Controller

    Satya777777/ESP32-Industrial-IO-Controller

    4-layer ESP32-based industrial I/O controller designed in KiCad with 0–10 V, 4–20 mA, RS485, USB-C and relay interfaces.

    58 partsMIT