Table of Contents
Door Access Controllers
Overview
The Hacklab door controllers are based on an ESP8266 wifi microcontroller and a PN532 NFC reader module. One controller is installed for each door, and each controller can operate a single 12V channel for an electric door release or magnetic lock. Inputs can be connected for door open/closed reed switch, exit request and local lock/unlock “snib” function.
PCB v2
https://github.com/timhawes/onyx_robot/tree/or2
Reference | Component | Farnell |
---|---|---|
C1 | 1206 10uF 25V | 2320887 |
C2 | 1206 22uF 6.3V | 2320911 |
C3, C4 | 0603 0.1uF 6.3V | 1759016 |
D1 | SMA diode B230A | 1843686 |
D2 | SMA diode (flyback protection) | 1625280 |
JP1 | PCB male header 2.54mm pitch 3-way | |
JP2 | PCB male header 2.54mm pitch 2-way | |
L1 | Coilcraft LPS6225-472MRB 4.7uH 2A | 2408256 |
P1, P2, P3 | PCB screw terminals 5.08mm pitch 2-way (9 total) | |
P4 | PCB male header 2.54mm pitch 6-way | |
Q1, Q2 | MOSFET-N SOT-23 | 2069541 |
R1 | 0603 31K6 1% | 2059454 |
R3 | 0603 56K 1% | 2303215 |
R2, R4 | 0603 10K2 1% | 2059407 |
R5, R6, R7, R9, R10, R11 | 0603 10K 1% | 2303192 |
R8 | 0603 2K2 1% | 2303166 |
SW1 | EVQPT5 tactile switch | 2425617 |
U1 | ADP2301 | |
U2 | SRD 12V relay | |
U3 | ESP-12E |
Errata: a generic through-hole flyback diode should be fitted between GND and 12V_OUT, on the underside of the screw terminal.
PCB v4
https://github.com/timhawes/onyx_robot/tree/or4
- Removed custom 12V-3.3V converter circuit
- Replaced with standard 12V-5V converter and 5V-3.3V LDO
- I2C devices running on 5V instead of 3.3V
- Removed LED series resistor (appropriate resistors must be used at installation time)
- Replace relay diode with M7
- Added flyback diode to 12V relay output
- Removed ESD protection diodes
- Removed 3.3V connection from FTDI connector
- Solder jumpers for no-volt relay output
Reference | Component |
---|---|
C1 | 0805 10uF 25V |
C2 | 0805 10uF 10V |
C3 | 0805 10uF 6.3V |
C4 | 0603 0.1uF 6.3V |
D1 | S1M+ |
D2 | S1M+ |
JP1 | PCB male header 2.54mm pitch 3-way |
JP2 | PCB male header 2.54mm pitch 2-way |
P1, P2, P3 | PCB screw terminals 5.08mm pitch 2-way (9 total) |
P4 | PCB male header 2.54mm pitch 6-way |
Q1, Q2 | MOSFET-N SOT-23 (e.g. On Semi FDV303N) |
R6 | 0603 10K |
R7 | 0603 31K6 |
R8 | 0603 2K2 |
R9 | 0603 10K |
R10 | 0603 10K |
R11 | 0603 10K |
R12 | 0603 4K7 |
R13 | 0603 4K7 |
R14 | 0603 10K |
SW1 | EVQPT5 tactile switch |
U1 | Recom R-78E5.0-1.0 |
U2 | Songle SRD-12VDC-SL-C |
U3 | ESP-12E or ESP-12F |
U4 | SPX3819M5-L-3-3/TR |
PCB ESP32 (draft)
This is draft design for migrating to ESP32.
Goals:
- ESP32 series
- compatibility with existing wiring
- fit into the existing plastic enclosures
- nice to haves:
- fit existing enclosures better
- make wiring easier
(placement and routing isn't finished)
What's changed:
- PCB is bigger, designed to screw into the enclosure as the manufacturer intended
- Uses the ESP32-S3-WROOM-1 module
- available with large flash/ram
- supports circuitpython
- supports native USB
- USB-C connector (plus optional UART pinout for low-level debugging)
- Pluggable 3.5mm terminal blocks for easier wiring (can be replaced with fixed blocks to reduce costs)
- MOSFET instead of relay (smaller, cheaper, probably more reliable)
- Dropped the PN532 reset pin in favour of a switchable power output (one less wire to manage)
- Reader connector has spare pins for existing LED and buzzer, but future readers can be I2C only for even less wiring
- Onboard RGB LED (will use with a light-pipe to eliminate the wiring for the current LED)
- Onboard buzzer
- Exit/Snib/Door inputs replaced with 4 general purpose I/O
- One I/O also has a power pin (e.g. to run the touch door handle)
- Optional Stemma QT (I2C) connector
Controller Unit
Components:
- 5mm blue LED
- 120R resistor
The laser-cut mounting plate is designed to hold the PCB secure at the back of the enclosure. Attach the PCB with M3 nylon bolts and nylon or metal nuts (the nut should go above the board to minimise the space used below the mounting plate).
The mounting plate should secure itself reasonably well with a push-fit, but consider adding a rubber foot or a blob of hot-melt glue to prevent it from rocking.
Drill a large hole in the side of the enclosure for wiring. Drill screw holes for wall-mounting. Drill two holes in the enclosure lid for the LED and push-button.
The push-button and LED may be wired as two separate pairs, or with a shared GND. The LED should have a 120R series resistor.
Connect the reader cable to the 8-way screw terminals. The controller push-button should be connected to the GND/SNIB pair of terminals. The controller LED should be connected to GND and LED (shared with the reader).
Take care to keep wiring away from the antenna.
Reader Unit
Version 1
Circuit diagram: PDF
Components:
- 3mm blue LED
- 120R resistor (or higher)
- Alarm cable with at least 7 cores (Cat5 can be used but is not recommended)
The reader enclosure is formed from three layers of 3mm black acrylic. The layers should be joined with cyanoacrylate adhesive.
Configure the PN532 module to use I2C communications.
Bend and cut the LED leads to the correct shape and length. Solder the LED and cable before gluing the module into the enclosure.
Cable colours in Hacklab installations:
Pin | G1/G2/G8 | G11 (and photos) | Alarm Wire |
---|---|---|---|
GND | blue | blue | black |
VCC | green | orange | red |
SDA | orange | green | yellow |
SCL | white-green | white-green | blue |
RST | brown | brown | green |
LED +ve | white-brown | white-brown | orange |
Piezo | white-blue | white-blue | white |
The LED should be connected between LED and GND, with a 120R series resistor. To avoid damaging the LED, use hot-melt glue to secure it in place (not cyanoacrylate).
The piezo should be connected between PIEZO and VCC (green). The piezo may be secured with cyanoacrylate or hot-melt glue, but try to give the disc some freedom of movement or the sound output may be reduced.
Test the reader and controller together before securing the reader to the wall with double-sided adhesive foam tape.
Version 2
The goal of this version is to make the assembly process easier and more reliable.
It consists of a laser-cut acrylic plate that fits over a standard 1-gang UK electrical box. A PCB is glued to the inside of the plate, and this PCB integrates the PN532 module, buzzer, LED and wiring connections.
CAD files:
PCB files: https://github.com/timhawes/onyx_reader
Software
Firmware - Arduino C++ built with PlatformIO
Backend - Python 3 asyncio
Features:
- Ability to read any 13.54MHz ISO-14443 Type A token including MIFARE Classic/UltraLight and NFC tags.
- Network-based checking of tokens with fallback to syncronised on-board database.
- Detection of door open/closed state via reed switch.
- Exit request handling, either opening for a set time or opening as long as in input is held (for our capacitive-touch door handle).
- “Snib” feature to hold the door unlocked for an extended period, with automatic timeout.
- Remote enable/disable of exit request for additional security.
- Remote enable/disable/renewal/timeout of snib state to allow presence detection to trigger timeout of snib state.
- Input DC voltage measurement, using low voltage as an indication of battery backup during a power outage. Snib feature can be disabled during power outage to extend battery life (for fail-secure locks).
- TLS-enabled TCP networking with OTA updates.