PROJECT 003 / EMBEDDED SYSTEMS & SOFTWARE

One system.
From card reader
to control room.

A network-connected door access system I designed: controller hardware, embedded firmware, central management and a custom enclosure.

ESP8266 / C++W5500 EthernetMQTTPHP / MySQL
Explore the enclosure in 3D
Illustration of the Wiegand reader, ESP8266 controller, Ethernet module and lock relay
System illustration / photographs to follow
AT THE DOOR

Local card validation, relay control, door contact monitoring and request-to-exit handling.

ON THE NETWORK

Wired Ethernet, MQTT heartbeats and events, card synchronisation and OTA updates.

IN ONE PLACE

A PHP/MySQL application for cards, permissions, controllers, logs, backups and firmware.

01 / SYSTEM DESIGN

Decisions locally.
Management centrally.

The controller validates a presented card against its local whitelist and handles the unlock sequence. A central web application maintains the card database and assigns permissions to individual doors. MQTT connects those two parts of the system.

01 / INPUTS & OUTPUTS

At the doorway

26-bit Wiegand reader
Request-to-exit input
Door contact & lock relay

02 / EDGE CONTROLLER

ESP8266 + W5500

Local whitelist and settings
Access decisions & door monitoring
Activity and system event storage

03 / CENTRAL SERVER

Management & monitoring

Apache / PHP / MySQL
Mosquitto message broker
Listener service & firmware hosting

A card is presented

The controller checks its local card list, processes access and publishes an event. The listener writes that event to the central database for the management interface.

Permissions change

The application sends a card-sync command over MQTT. The controller then downloads its assigned card list from the server and updates the local whitelist.

02 / HARDWARE & FIRMWARE

More than
switching a relay.

The controller pairs a NodeMCU V3 with a W5500 Ethernet module. Its firmware separates access processing, storage, networking, time synchronisation and the local web interface into dedicated modules.

01

Access and door state

Wiegand card input, local whitelist lookup, unlock processing and REX handling sit alongside door contact monitoring and held-open detection.

02

Local storage and diagnostics

Cards, settings, recent activity and system events are stored on the controller. Local web pages expose door state, card management, configuration, firmware details, heap, flash and Ethernet diagnostics.

03

Communications and maintenance

Static Ethernet configuration, link monitoring, NTP timestamps, MQTT heartbeats and remote commands support day-to-day operation. OTA updates, backup and restore, and a fallback access-point configuration portal support maintenance.

03 / THE CENTRAL APPLICATION

Many moving parts.
One management interface.

The server runs the PHP/MySQL application alongside Mosquitto. A long-running PHP listener, managed by systemd, consumes controller messages and updates status and event records.

CARDS & PERMISSIONS

Who can use which door?

Manage cards, bulk imports and exports, controller assignments and synchronisation. Admin, Editor and Viewer roles control application access.

CONTROLLER MONITORING

Keep track of the fleet.

View online status, firmware version, last heartbeat and sync status. Open individual controller details and review access and system events.

REMOTE MAINTENANCE

Update without opening the box.

Upload firmware centrally and initiate OTA deployment to one controller or all controllers. Download and restore controller configuration backups.

MESSAGE PROCESSING

Turn messages into records.

Status messages update controller details and heartbeat times. Event messages populate access and system logs for the web interface.

04 / THE PHYSICAL BUILD

Code needs
a place to live.

I also designed the controller enclosure. This preview renders the supplied STL geometry directly, so you can inspect the model before completed-build photographs are added.

ENCLOSURE / 3D MODELORIGINAL STL GEOMETRY

Loading enclosure model...

Drag to rotate · Arrow keys rotate · + / − zoom · No automatic motion

05 / ENGINEERING LESSONS

The useful part
is in the investigation.

01

A healthy Ethernet link did not mean a healthy connection.

During an MQTT stability investigation, the Ethernet link stayed up while the W5500 socket closed repeatedly. Broker settings, authentication, keepalive and payload size did not explain the behaviour. Returning the chip-select wiring to the stable configuration restored MQTT, heartbeat and card-sync operation.

02

A connection that works now may fail overnight.

The central listener ran for roughly 17 hours before a stale PDO connection caused a “MySQL server has gone away” error. Automatic reconnection and retry are the next server-side reliability task, so a lost database connection does not require a service restart.

03

Small controllers need long-running observation.

Heap usage, the largest free memory block, MQTT uptime and W5500 behaviour remain part of the monitoring work. The fallback web interface also needs continued attention to memory fragmentation and large HTML construction.

06 / CURRENT STATUS

Functional and deployed.
Still being refined.

The system is running with Ethernet communications, local card access, central permissions, remote commands, door monitoring, event logging, OTA deployment and backups working.

Next steps are listener database reconnection, continued controller web-interface stability work and longer-term monitoring. Bulk card synchronisation also needs its server-address handling brought into line with the single-controller path.

Completed-build photographs will be added as the project documentation grows.

Explore another project
← Back to projectsHARDWARE / FIRMWARE / SOFTWAREField Technician Toolkit ↗