tree: 2a700b4034970eb2b35decc4792aba042b1ef845 [path history] [tgz]
  1. fab1/
  2. board.jpg
  3. hacklock-2137.kicad_dru
  4. hacklock-2137.kicad_pcb
  5. hacklock-2137.kicad_prl
  6. hacklock-2137.kicad_pro
  7. hacklock-2137.kicad_sch
  8. hacklock-2137.xml
  9. README.md
hswaw/hacklock/hardware/hacklock-2137/README.md

hacklock-2137

Controller board for next gen hacklock door / lock / access control system.

Specifications


  • Built around an ESP32S3: dual-core 32-bit microcontroller with wifi/bluetooth, maximum of 8MB SPIRAM and 16MB Flash memory. Programmable with Micropython, C, C++ or Rust.
  • Programming and debugging over USB-C (Serial and JTAG using built-in USB/JTAG bridge).
  • Wide range of power supply voltage, from 10 to 24V.
  • Two independent and monitored power inputs.
  • 2x hardware UART, at 3v3, 5v or RS232 levels.
  • Two Omron G5V-1 relays, contacts rated at 24V 1A hold current.
  • Two digital outputs at Vsupply level.
  • Two digital inputs at Vsupply level.
  • I2C bus connector for functionality expansion.

Power

10-24V is expected at PWR1/PWR2, with 12V typical.

Whichever input voltage is higher will be used to power the device.

Two ADC pins can be used to monitor the voltage at PWR1/PWR2:

FunctionGPIO
PWR1 monitoringGPIO1/ADC1
PWR2 monitoringGPIO2/ADC2

The voltage at PWR1/PWR2 is divided by 28 before it reaches the ESP32 ADC, so 24V on PWR1 == 857mV on the ADC.

UART

One of three outputs can be enabled: 3v3, 5v, RS232. This is done by setting two pins per UART: 5V enable and RS232 enable. Truth table:

5V enableRS232 enableSelected connector
003v3
105v
11RS232
01undef

Pinout for UART1:

FunctionGPIO
UART1 TX (from hacklock)17
UART1 RX (to hacklock)18
UART1 5V enable6
UART1 RS232 enable8

Pinout for UART2:

FunctionGPIO
UART2 TX (from hacklock)4
UART2 RX (to hacklock)5
UART2 5V enable7
UART2 RS232 enable9

The RS232 connectors are wired as a DCE, which is a happy accident. No hardware flow control is available.

Digital I/O

Digital I/O is at power supply levels, optimized for a ~12V rail. Digital I/O connectors also carry GND and Vsupply on them so that it's easy to use these I/O connectors to read switch state or drive other 'industrial' equipment.

Output pins can sink/source up to 500mA (via ULN2003A).

Input pins need to be driven to at least 10V to register a signal as a logical high.

FunctionGPIO
O12 (output)12
O13 (output)13
I10 (input)10
I11 (input)11

Relay outputs

Two relay outputs are available, using OMRON G5V-1 relays. These relays allow for controlling up to a 1A load at 24V.

FunctionGPIO
Relay 2121
Relay 1414

I2C connector

Running I2C off-board is not recommended, but is provided as a backup solution in case you wish to expand the capabilities of the board.

FunctionGPIO
SCL38
SDA47

The bus runs at 3v3 and has 1.8k pullups included.

LEDs

Two RGB LEDs (WS2812B) are included and connected to GPIO48. However, they're untested.

Programming

You can power the device from USB-C, but digital I/O will not run well. Everything else should work. You can connect via USB when the device is powered on via PWR1/PWR2.

Hold SW1 while powering on the device, or hold SW1 while resetting the device with SW2. The device will switch into BootROM serial mode and can be programmed using esptool.py.

J15 is an 'FTDI cable' connector a la sparkfun/adafruit. Pin 1 is GND and is facing away from the ESP32. This exposes the UART0 console from the ESP32 in case you want to have a second debugging/logging channel in adition to the USB serial/jtag console.

Manufacturing

Runs

RevisionDateCountFabSerialsNotes
rev. A2022/06/215pcsJLCPCBQ001-Q005HW fixes applied (see revision detail below)

Revision A

First revision, has the following hardware bugs:

  1. Current limiting resistors R1, R2, R3, R11, R12 are way too low value, they should be closer to 10k.
  2. R35 should be removed if an FTDI cable is used, otherwise 5V from the FTDI cable will go into the 3v3 rail of the device, slowly killing the ESP32.