This project is an end-to-end, distributed smart fastening and quality-assurance platform built around an embedded ESP32 hardware ecosystem and a self-hosted web backend. Designed to bridge shop-floor mechanical assembly with real-time digital traceability, the system automates fastener tightening to exact target specifications, captures high-resolution time-series torque curves, documents joint defects visually, and synchronizes all operational data across a local wireless network to a centralized production dashboard.
System Architecture
Hosted inside a containerized Python/Flask and Gunicorn stack behind Cloudflare Zero Trust, the web server acts as the central engineering and quality-assurance hub. It provides a real-time operations dashboard where supervisors can create job specifications, monitor active tool sync status, override batch states, and inspect interactive time-series rundown curves for every individual bolt attempt. To ensure long-term data integrity, the server runs an automated housecleaning auditor that validates incoming telemetry files, quarantines malformed uploads, maintains non-destructive trash archives, and logs every bidirectional device interaction into a searchable audit trail.
To pair numerical telemetry with visual verification, a dedicated ESP32-CAM module acts as a wireless optical inspection node on the workstation. Integrated into the local ESP-NOW and Wi-Fi device mesh, the camera triggers automatically upon fault conditions or manually at the operator's request to document bolt seating, gasket alignment, or surface defects. Captured JPEG snapshots are tagged with the active job identifier, fastener index, and device ID before being relayed upstream, ensuring that any out-of-spec tightening attempt is backed by immediate photographic evidence in the quality audit trail.
Powered by an ESP32-S3 touchscreen controller (Unihiker K10), the display unit serves as both the operator's primary human-machine interface and the local network gateway for the toolset. On the shop floor, it renders visual assembly diagrams, step-by-step bolt sequences, live torque readouts, and color-coded pass/fail feedback. Under the hood, it coordinates peer-to-peer wireless traffic with the wrench and camera while maintaining a local cache of job recipes and rundown logs. When connected to the facility Wi-Fi, the edge controller reconciles two-way state changes with the backend server—pulling down updated work orders and supervisor notes while batch-uploading completed CSV torque curves and defect imagery.
Built on a compact ESP32-C3 microcontroller, the smart torque wrench handles real-time closed-loop mechanical actuation and load sensing. The firmware drives a stepper/servo actuator through a dedicated motor driver while continuously sampling an analog torque sensor and operator controls at high speed. During a tightening cycle, the controller tracks rotational step position, applied torque, and motor current, automatically halting drive power and executing a controlled release backoff the instant the target torque threshold is reached—or tripping an immediate safety cutoff if an angle overrun or stall fault is detected. Beyond standalone physical operation, the wrench exposes local telemetry buffers, diagnostic logs, and command interfaces over wireless links so target limits can be updated dynamically per fastener.
Torque Wrench Mechanism
The right mechanical system for this project would be a rotary mechanism like a geared motor or a rotary hydraulic actuator with strain gauges for measuring torque. Those were not available so I designed a mechanism using a stepper motor to drive the head, a spring to resist torsion, and a potentiometer to measure the angle. Despite a few iterations it was obvious that overcoming alignment and friction issues would be very difficult with 3D printed parts. The final version of the mechanism is pictured. Given the problems, a new solution was adapted using a low cost remote control servo.