Skip to the content
2 layers130 × 87 mmDoor controller, the printed circuit board in 3D

Proof of concept for new door controller design using a WT32-ETH01.

Size
130 × 87 mm
Copper layers
2
Thickness
1.6 mm
Parts
35
Nets
62
Pads
187
Tracks, vias
169, 0
Pours
96
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
29 Dec 2023
Updated
6 Aug 2024

Overview

Door controller is an open-source printed circuit board by MetaMakersCooperative, from the MetaMakersCooperative/M2C_Yet_Another_Door_Controller repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 130 × 87 mm with 35 parts on 62 nets, routed with 169 tracks and 0 vias.

It is built around the WT32-ETH01. Its parts include 12 resistors, 7 connectors, 4 transistors, 3 diodes and 2 ICs.

Main components

1

README

README.md

M2C Yet Another Door Controller

Proof of concept for new door controller design using a WT32-ETH01.

Development Requirements

Make sure version v1.X of the Arduino IDE installed. It is required to upload the cards file. See Cards File section.

arduino-cli also needs to be installed to compile and upload the sketch. It is possible to use the Arduino IDE v1.X or v2 but they have not been tested/verified. Milage may vary.

Cards File

The sketch assumes a file named cards.txt exists within a LitteFS file system. The code will not function correctly without it.

Unfortunately, the only way to upload the file to the device is using v1.X Arduino IDE. This is because the upload using a plugin that only can be used with that version of the IDE. Setting up the upload plugin is only required if the cards.txt file needs to be updated or if the flash storage was wiped.

Setup the Upload Plugin

To setup the plugin, follow the steps outlined below:

  1. First download the following zip file: https://github.com/lorol/arduino-esp32fs-plugin/releases/download/2.0.7/esp32fs.zip
  2. Unzip and place the esp32fs.jar file in the following directory: ~/Arduino/tools/ESP32FS/tool/esp32fs.jar
  3. Restart Arduino IDE if it's running

Uploading

Before uploading, create the data directory in the project root if it does not already exist. Update/create the card.txt file with the codes that should unlock the door. Make sure each code is in it's own line, like below:

Each code should be no more than 10 digits long and only container digits 0-9. No leading zeros!

text
1234567
8912345
6789123

Double check and make sure the project structure matches the following:

text
~/Arduino/M2C_Yet_Another_Door_Controller/
├── data
│   └── cards.txt
├── README.md
├── sketch.yaml
└── M2C_Yet_Another_Door_Controller.ino

To upload the card.txt file, follow the steps outlined below:

When referencing the Arduino IDE, it is implied that it's v1.X not v2

  1. Open Arduino IDE and open the M2CYetAnotherDoorController.ino sketch.
  2. Navigate and click on Tools -> Board and select WT32-ETH01 Ethernet Module if it is not already selected.
  3. Navigate and click on Tools -> ESP32 Sketch Date Upload
  4. Select LittleFS then click OK

Libraries

To install the esp32 libraries run the following command:

bash
arduino-cli core install esp32:esp32@3.0.2

Might need to run arduino-cli core update-index to update the board index.

This will install espressif/arduino-esp32 version 3.0.2.

The following libraries can be installed using the Arduino IDE or by downloading the files directly from the source repositories.

When downloading the libraries manually, make sure the source is place them within the following directory: ~/Arduino/libraries.

The libraries should look like this assuming the only installed libraries are the ones used by this project.

text
~/Arduino/libraries
├── LinkedList
│   ├── ...
└── Yet_Another_Arduino_Wiegand_Library
    ├── ...

Make sure to download the source tagged with the versions listed below!

The following dependencies need to be installed manually as the latest versions are required:

The best way to get these libraries is to git clone them into the ~/Arduino/libraries directory.

AsyncTCP is still required even though it's not being used

Commands (using CLI)

Note: /dev/ttyUSB0 is the default device. Run the following command to see what device is being used: arduino-cli board list. Make sure to modify the commands below to match that device.

To compile the sketch with defaults, run following command:

WARNING: Defaults will apply not overridden which could cause a lot of problems on multi door deployments. See the Override Defaults section below.

bash
arduino-cli compile --fqbn esp32:esp32:wt32-eth01 ./

To enable more debugging messages, run the following command:

bash
arduino-cli compile --build-property "build.extra_flags=\"-DDC_DEBUG=1\"" --clean --fqbn esp32:esp32:wt32-eth01 ./

To Upload the compiled sketch:

bash
arduino-cli upload -p /dev/ttyUSB0 --fqbn esp32:esp32:wt32-eth01 ./

To monitor the serial output:

bash
arduino-cli monitor --log-level debug --fqbn esp32:esp32:wt32-eth01 -p /dev/ttyUSB0 -c baudrate=115200

MQTT Broker

NOTE: The code assumes the MQTT server connection is TLS. Only TLS v1.2 is supported. Using TLS v1.3 will result in some weird errors.

The device will send logs, lock, unlock, and other events to the configured MQTT broker. If disconnected, only a few messages will be queued and sent when it's able to reconnect.

If the door_controller/access_list topic is received, the device will replace the card file with the payload, then attempt to reload the list from the updated file.

The device will also respond to messages with the door_controller/health_check topic. This is designed to help with monitoring the healthiness of the device.

root_ca.h

Use the example file, root_ca.h.example, to create the root_ca.h file containing the root certificate for the MQTT broker.

NOTE: The root certificate will expire at some point so make sure you mark it in your calendar!

If you're using Let's Encrypt, then there is a good chance that the root certificate can be download from the following URL: letsencrypt.org/certs/isrgrootx1.pem

Otherwise, check out letsencrypt.org/certificates/ for a complete list.

Override Defaults

Note: Make sure the latest Arduino CLI is installed

The table below shows the build flags that should be overridden for each controller being deployed. Refer to the source files for a complete list of overridable flags.

Flag NameDefaultDescriptionBuild Argument
DC_HOST_NAMEm2cdooroneThe value that will be set as the device's host name-DDC_HOST_NAME=m2cdoorone
DC_CLIENT_IDdoor_oneClient ID is used by the MQTT broker to identify the client. This value needs to be unique across all clients connected to the broker-DDC_CLIENT_ID=door_one
DC_MQTT_HOSTmqtt.metamakers.orgHost name for the MQTT Broker. The host name is used to get the server IP using DNS-DDC_MQTT_HOST=mqtt.metamakers.org
DC_MQTT_USERdoor_oneThe user that the MQTT client will use to authenticate-DDC_MQTT_USER=door_one
DC_MQTT_PWDoor_One!1The password that the MQTT client will use to authenticate-DDC_MQTT_PW=Door_One!1
DC_NTP_HOSTpool.ntp.orgThe domain used to update the RTC using NTP-DDC_NTP_HOST=pool.ntp.org
DC_DEBUG0Enable more verbose debugging information via the serial port. Do not enable this for production deployments-DDC_DEBUG=0

Below is an example of how to override all the flags in the table above:

Documentation on the CLI compile command can be found here.

bash
arduino-cli compile --build-property "build.extra_flags=-DDC_DEBUG=0 \"-DDC_HOST_NAME=\"m2cdoorone\"\" \"-DDC_CLIENT_ID=\"door_one\"\" \"-DDC_MQTT_HOST=\"mqtt.metamakers.org\"\" \"-DDC_MQTT_USER=\"door_one\"\" \"-DDC_MQTT_PW=\"Door_One!1\"\" \"-DDC_NTP_HOST=\"pool.ntp.org\"\"" --clean --fqbn esp32:esp32:wt32-eth01 ./

Parts

35
QtyValueFootprintReferences
1010kResistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR1, R2, R3, R4, R5, R6, R7, R8, R11, R12
4 TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2_1x02_P5.00mm_HorizontalJ1, J2, J3, J4
4MountingHole_3.2mm_M3_DIN965_PadMountingHole:MountingHole_3.2mm_M3_DIN965_PadMH1, MH2, MH3, MH4
31N4001Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2, D3
22N3904Package_TO_SOT_THT:TO-92_InlineQ3, Q4
22N7000Package_TO_SOT_THT:TO-92_InlineQ1, Q2
2330Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_HorizontalR9, R10
2Conn_01x09_SocketConnector_PinSocket_2.54mm:PinSocket_1x09_P2.54mm_VerticalJ5, J6
2~MyLibrary:RELAY8_J104D2C12VDC.20S_CRSRELAY1, RELAY2
1Conn_01x04_SocketConnector_PinSocket_2.54mm:PinSocket_1x05_P2.54mm_VerticalJ7
1LOGOLOGOG***1
1WT32-ETH01WT32-ETH01:WT32-ETH01U2
1YAAJ_DCDC_StepDown_LM2596MyLibrary:YAAJ_DCDC_StepDown_LM2596_UniversalU1

Similar boards

  • 2 layers100 × 60 mmLateral led controller, the printed circuit board in 3D

    Lateral led controller

    cyberboy666/lateral_led_controller

    hardware network controller for addressable led installations

    30 parts8GPL-3.0
  • 2 layers60 × 60 mmWT32-ETH01-WLED CTRL, the printed circuit board in 3D

    WT32-ETH01-WLED CTRL

    foorschtbar/WT32-ETH01-WLED-CTRL

    A wired (Ethernet/LAN) WLED Controller

    20 parts3
  • 2 layers120 × 80 mmVolyaEth, the printed circuit board in 3D

    VolyaEth

    d-ashesss/VolyaEth

    Scheme and PCB for VolyaEth

    20 parts
  • 2 layers60.3 × 73.8 mmSensor porta, the printed circuit board in 3D

    Sensor porta

    HENRYQUE-FARIAS/Monitoramento-de-Porta

    16 parts
  • 2 layers107 × 87 mmEth01-24v, the printed circuit board in 3D

    Eth01-24v

    loack/ESP32-ETH01-WifiMQTT-Controller

    Contrôleur générique d'I/O pour WT32-ETH01 avec Ethernet prioritaire et fallback WiFi.

    23 parts
  • 2 layers45 × 55.5 mmPCB Access, the printed circuit board in 3D

    PCB Access

    LuisMiguel-efe/unikey

    Sistema inteligente de control de acceso universitario mediante huella dactilar, con autenticación biométrica, FastAPI, MongoDB y Angular.

    6 parts
  • 2 layers94 × 87.6 mmCNC relays, the printed circuit board in 3D

    CNC relays

    ondras12345/CNC

    My CNC 1610 and Stepcraft model 600 configuration and CNC-related notes

    100 partsMIT
  • 2 layers26.5 × 55.5 mmCgf.CameraControl.Hardware, the printed circuit board in 3D

    Cgf.CameraControl.Hardware

    sensslen/Cfg.CameraControl.Hardware

    Hardware needed to control a lanc camera with a PTZ head

    30 partsMIT

Questions

How big is the Door controller PCB?

It measures 130 × 87 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Door controller use?

35 parts, built around the WT32-ETH01. 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 Door controller KiCad files?

From the MetaMakersCooperative/M2C_Yet_Another_Door_Controller repository on GitHub, at the commit this page was made from: the board is PCB/door-controller.kicad_pcb and its schematic PCB/door-controller.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Door controller design in my own project?

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