Skip to content

Hardware Setup

This guide covers wiring, assembly, and configuration of the OpenLatch hardware.

Bill of Materials

Component Model Quantity Notes
Smart Lock NUKI Smart Lock Ultra 1 Battery powered, BLE controlled
Controller ESP32 DevKit V1 1 Any ESP32 with BLE + WiFi
NFC Terminal CONLAN M1200 1 Outdoor IP67, MIFARE DESFire, Wiegand output
Shutdown Button Momentary push button 1 Mounted inside the space (initiates space shutdown)
Green LED 5mm or panel mount 1 Access granted indicator
Red LED 5mm or panel mount 1 Access denied indicator
Buzzer Active piezo buzzer, 3.3V 1 Audio feedback
Resistors 220Ω 2 LED current limiting
Level Shifter 5V ↔ 3.3V bidirectional 1 Wiegand is 5V, ESP32 is 3.3V
Power Supply 12V DC, 1A+ 1 Powers CONLAN M1200 (9-25V input)
Voltage Regulator 12V → 3.3V (or 5V USB) 1 Powers ESP32 from same supply
Enclosure Project box 1 Indoor mount for ESP32 + components
Wire Multi-core cable ~3m Between terminal and ESP32

Wiring Diagram

                    CONLAN M1200                        ESP32 DevKit
                    (outdoor)                           (indoor)
                ┌───────────────┐                   ┌───────────────┐
   NFC Card ))) │               │                   │               │
                │  Wiegand D0 ──┼───── [Level ──────┼── GPIO 16     │
                │  Wiegand D1 ──┼───── Shifter] ────┼── GPIO 17     │
                │  GND ─────────┼───────────────────┼── GND         │
                │  LED Control ─┼── (optional) ─────┼── (optional)  │
                │  Tamper ──────┼── (optional) ─────┼── (optional)  │
                │               │                   │               │
                │  +12V ────────┼── from PSU        │  +5V (USB)    │
                │  GND ─────────┼── from PSU        │  or 3.3V reg  │
                └───────────────┘                   │               │
                                                    │  GPIO 25 ─────┼── [220Ω] ── Green LED ── GND
                    NUKI Smart Lock                 │  GPIO 26 ─────┼── [220Ω] ── Red LED ── GND
                    (on door)                       │  GPIO 27 ─────┼── Buzzer ── GND
                ┌───────────────┐                   │  GPIO 33 ─────┼── Shutdown Button ── GND
                │               │    Bluetooth      │               │    (internal pull-up)
                │           BLE │ ))) ))) ))) ))) ──┼── BLE radio   │
                │               │                   │               │
                └───────────────┘                   └───────────────┘

Pin Assignments

ESP32 GPIO Function Direction Notes
GPIO 16 Wiegand D0 Input From CONLAN M1200 via level shifter
GPIO 17 Wiegand D1 Input From CONLAN M1200 via level shifter
GPIO 25 Green LED Output Access granted
GPIO 26 Red LED Output Access denied
GPIO 27 Buzzer Output Active buzzer, audio feedback
GPIO 33 Shutdown Button Input Internal pull-up, active LOW
BLE NUKI Smart Lock Wireless NukiBleEsp32 library
WiFi Backend Server Wireless HTTPS polling every 5 min

Level Shifter: Why and How

The CONLAN M1200 uses 5V logic for Wiegand signals. The ESP32 GPIO pins are 3.3V and not 5V tolerant. A bidirectional level shifter is required.

Recommended module: Any generic 2-channel bidirectional level shifter (e.g., BSS138-based modules commonly available for ~1€).

Wiring:

CONLAN D0 ──── HV1 [Level Shifter] LV1 ──── ESP32 GPIO 16
CONLAN D1 ──── HV2 [Level Shifter] LV2 ──── ESP32 GPIO 17
CONLAN GND ─── GND [Level Shifter] GND ──── ESP32 GND
+5V ────────── HV  [Level Shifter] LV  ──── +3.3V (ESP32 3V3 pin)

CONLAN M1200 Configuration

The M1200 has configurable Wiegand output (bit length, LED behavior, buzzer). Configuration is done via master cards. Refer to the CONLAN M1200 manual for the card-based programming sequence.

Recommended settings: - Wiegand output: 26-bit or 34-bit (match the firmware's WiegandFormat setting) - LED: controlled by ESP32 (disable terminal's built-in LED if possible) - Buzzer: controlled by ESP32 (disable terminal's built-in buzzer if possible)

NUKI Smart Lock Ultra Pairing

The ESP32 pairs with the NUKI lock via BLE. This is a one-time setup.

Pairing Procedure

  1. Put the NUKI Smart Lock Ultra into pairing mode:
  2. Press the NUKI button until the LED ring lights up and stays lit
  3. Power on the ESP32 with the OpenLatch firmware
  4. The firmware automatically attempts pairing on first boot
  5. Enter the 6-digit NUKI PIN when prompted via serial console
  6. Pairing credentials are stored in ESP32 NVS

Verifying Pairing

Monitor the serial output:

cd firmware
pio device monitor

You should see:

[NUKI] Pairing successful
[NUKI] Lock state: LOCKED

Re-pairing

If pairing fails or needs to be reset: 1. Delete the NUKI pairing in the NUKI smartphone app 2. Erase ESP32 NVS: pio run -e esp32dev --target erase 3. Flash firmware and repeat the pairing procedure

Power Supply

The system needs two voltage levels:

Component Voltage Current Source
CONLAN M1200 9-25V DC ~200mA 12V power supply
ESP32 DevKit 5V USB or 3.3V ~500mA (WiFi+BLE peaks) USB or voltage regulator
NUKI Smart Lock Battery N/A Internal batteries (4x AA)

Option A: Separate supplies — 12V adapter for M1200, USB power for ESP32.

Option B: Single 12V supply with a buck converter (12V → 5V) for the ESP32. More elegant, single point of failure.

Recommendation: Use Option B with a small UPS (uninterruptible power supply) to keep the ESP32 running during short power outages.

Physical Mounting

  • CONLAN M1200: Outdoor, next to the door, at hand height (~120cm). Use the included mounting hardware. Route the 8-core cable through the wall to the indoor ESP32.
  • ESP32 + components: Indoor, in a project enclosure near the door frame. Accessible for maintenance but not in the way.
  • Shutdown button: Indoor, near the exit, at a convenient height. Clearly labeled "Shutdown — press to close the space".
  • LEDs + Buzzer: Near the door on the indoor side, visible/audible from the NFC terminal area. Can be mounted through the wall or door frame.
  • NUKI Smart Lock: On the door, indoor side, per NUKI installation instructions.

Cable Between Terminal and ESP32

The CONLAN M1200 comes with an 8-core 2.5m cable. You need at minimum:

Wire Function
1 Wiegand D0 (data)
2 Wiegand D1 (data)
3 GND (common ground)
4 +12V power to terminal
5 Tamper output (optional)
6 LED control (optional)
7-8 Spare

Keep the cable run short and away from high-power cables to minimize interference on the Wiegand lines.