IoT2025 Production

Core Test ESP - PLN Safety Garment Testing System

Comprehensive IoT solution for real-time PLN safety garment resistance testing and monitoring, featuring ESP32 hardware integration, MQTT communication, and web-based dashboard with live data streaming and centralized data storage.

ESP32GolangMQTTWebSocketMySQLNuxt.jsVue.jsOLED Display
Private Project
Core Test ESP - PLN Safety Garment Testing System

Core Test ESP - PLN Safety Garment Testing System

🎯 Project Overview

Core Test ESP is an IoT monitoring and testing system developed for PLN safety garment resistance testing. This system connects existing ESP32 hardware testing devices with backend services and web interfaces to enable real-time data monitoring, centralized data storage, and remote monitoring from anywhere.

Background & Problem Statement

Initial Conditions:

  • PLN safety garment resistance testing devices already available with ESP32 and OLED display
  • Measurements could only be viewed on the device's OLED display
  • No centralized data storage system
  • Difficult to monitor from different locations
  • Historical data not stored for analysis and reporting

Developed Solution: Building an integrated IoT system that connects existing testing devices to backend servers, enabling:

  • Real-time monitoring via web dashboard
  • Centralized data storage on database server
  • Historical data analysis and reporting
  • Multi-device monitoring from single dashboard
  • Remote access from anywhere

System Architecture

This system consists of three main components that are interconnected: diagram-1Coretest Architecture System Design

Data Flow:

  1. ESP32 Testing Device performs resistance measurements and sends data via MQTT
  2. Backend Service receives data, stores to database, and forwards to WebSocket
  3. Web Dashboard displays testing results in real-time without refresh

🔧 Component 1: Hardware Layer (ESP32 Testing Device)

Overview

ESP32-based PLN safety garment resistance testing device that already exists, enhanced with network connectivity and cloud integration capabilities. The upgrade focuses on adding MQTT communication features to send data to servers without modifying existing testing functions.

ESP Device OverviewESP32 device overview

Existing Hardware Components

Original Testing System:

  • ESP32 microcontroller as central processing unit
  • JSY1050 Energy Meter for high-precision measurements
    • High-precision voltage measurement
    • High-resolution current sensing
    • Resistance calculation for safety garments
    • Power monitoring
    • Modbus RTU protocol communication
  • OLED display for local measurement results
  • SPWM signal generation for testing
  • Control buttons for manual operation

Added Connectivity Features

🌐 Network Integration & Communication

Features added to the existing system:

  • WiFi Connectivity
    • Access Point mode for initial configuration (SSID: CORE_ESP_XXXX)
    • Station mode for connecting to PLN network
    • Auto-reconnect mechanism with exponential backoff
    • Maintains existing functionality when offline
  • MQTT Integration
    • Bidirectional communication with MQTT broker
    • Automatic data publishing to server
    • Configurable publish interval (500ms - 1 hour)
    • Command subscription for remote monitoring
    • Does not interfere with existing testing functions
  • Built-in Web Server
    • Local configuration interface via WiFi
    • Device information display
    • Network settings management
    • Testing parameters configuration

WiFi Configuration InterfaceWifi Configuration Interface Config Device

📊 Safety Garment Testing & Data Acquisition

Core Testing Functionality (Existing):

  • Resistance measurement on PLN safety garments
  • Real-time voltage and current monitoring
  • Pass/fail criteria checking
  • Visual feedback on OLED display
  • Manual control via physical buttons

Enhanced Data Publishing (Added):

  • Automatic publishing of testing results to server
  • Configurable publish interval (500ms - 3600s)
  • JSON-formatted measurement data
  • Device health metrics (WiFi RSSI, memory, uptime)
  • Historical data tracking on server

Sensor Data DisplayDevice Management

🎛️ Testing Control & System Management

Original Control System:

  • STOP: Idle state, no measurement
  • READY: System initialized, ready for testing
  • RUN: Active measurement and resistance testing
  • Visual LED indicators for each state
  • OLED display showing readings

Added Remote Capabilities:

  • View testing status from web dashboard
  • Monitor multiple devices simultaneously
  • Remote configuration from web interface
  • Historical testing data visualization
  • Centralized testing report generation

System Control PanelDevice Control Control Management

💡 Smart Features Integration

Memory Management:

  • Automatic buffer clearing for MQTT messages
  • Heap monitoring with warning system
  • Critical memory protection
  • Does not interfere with testing operation

Device Identification:

  • Unique device ID for each testing unit
  • Location tagging for multi-site deployment
  • MAC address identification
  • Network information display

Performance Monitoring:

  • Connection statistics
  • Data publish success rate
  • Network quality monitoring
  • Testing device uptime tracking

Device Information PageDevice Information

Configuration Interface

Web-based Settings (Additional):

  • WiFi credentials configuration
  • MQTT broker settings (host, port, credentials)
  • Publishing parameters (interval, auto-start)
  • Device identification (client ID, location)
  • Testing thresholds configuration

Settings ConfigurationDevice Settings Configuration

MQTT Communication Protocol

Topic Structure:

device/
├── registration                    # Auto-registration for new testing devices
├── {device_id}/
│   ├── control                     # Receive commands from dashboard
│   ├── data                        # Publish testing results
│   ├── status                      # Connection status updates
│   └── response                    # Command acknowledgments

Published Data Format:

{
  "device_id": "PLN_TEST_001",
  "timestamp": "2025-11-30T10:30:00Z",
  "location": "Workshop A",
  "measurements": {
    "voltage": 220.5,
    "current": 0.15,
    "resistance": 1470.0,
    "status": "PASS"
  },
  "device_health": {
    "wifi_rssi": -65,
    "heap_free": 180000,
    "uptime": 86400
  }
}

Command Types:

  • Publishing control (start, stop, set interval)
  • Configuration updates (thresholds, intervals)
  • Device management (identify, status request)
  • Information request (memory status, device info)

MQTT Communication FlowMQTT Communication Flow


🔥 Component 2: Backend Service (Golang API)

Overview

RESTful API service built with Golang Clean Architecture, functioning as a central hub for collecting data from multiple testing devices, storing to database, and providing interface for web dashboard. This service is the primary solution for centralized data storage and remote monitoring problems.

Backend ArchitectureBackend Architecture Design

Core Features

🔐 Authentication & User Management

Multi-User Access Control:

  • JWT-based authentication for secure access
  • Role-based access (Admin, Supervisor, Operator)
  • Access token for API requests (15-minute validity)
  • Refresh token for token renewal (7-day validity)

Email Verification System:

  • 6-digit verification code for security
  • 15-minute expiration time
  • Resend capability
  • User must verify before login

User Management:

  • Registration for PLN staff
  • Profile management
  • Password hashing with bcrypt
  • Secure logout (token invalidation)

User Registration FlowUser Registration Flow

📡 Testing Device Management

Centralized Device Control via REST API:

  1. Device Registration & Management
    • Auto-registration when testing device first connects
    • Manual device registration via API
    • Device list with filtering (location, status)
    • Device detail view with testing history
    • Update device configuration remotely
    • Device location tracking
  2. Testing Data Management
    • Receive testing results from multiple devices
    • Store all measurements to database
    • Generate testing reports
    • Export data for analysis
    • Historical data query
  3. Real-time Monitoring
    • Live connection status for all devices
    • Current testing status (STOP/READY/RUN)
    • Device health monitoring
    • Alert generation for anomalies
  4. Remote Configuration
    • Set testing parameters from dashboard
    • Configure publish intervals
    • Update device settings
    • Manage testing thresholds

Device Management DashboardDevice Management Dashboard

🌐 Real-time Communication System

MQTT Bridge:

  • Connects to MQTT broker as central listener
  • Subscribes to all testing device topics
  • Processes incoming measurement data
  • Routes commands to specific devices
  • Handles device registration automatically

WebSocket Server:

  • Real-time data streaming to dashboard
  • Live testing results updates
  • Multi-client support
  • Automatic reconnection handling
  • Event notification system

WebSocket ConnectionsWebsocket Connections Flow

📊 Database Integration & Data Storage

Centralized Data Storage (Core Solution):

  • All testing results stored permanently
  • Device registration and configuration
  • Testing history tracking
  • User activity logs
  • Performance metrics storage

Automatic Data Processing:

  • Real-time data validation
  • Pass/fail criteria checking
  • Statistical analysis
  • Anomaly detection
  • Report generation

Data Retention:

  • Complete testing history
  • Query by date range, device, location
  • Export capabilities (CSV, PDF, Excel)
  • Backup and recovery mechanisms

API Architecture

Clean Architecture Implementation:

  1. Delivery Layer: HTTP handlers, MQTT client, WebSocket server
  2. Use Case Layer: Business logic, testing validation, reporting
  3. Repository Layer: Database operations, data access
  4. Entity Layer: Testing models, business rules
  5. Gateway Layer: External services (MQTT, email, notifications)

Benefits for PLN Testing System:

  • Easy maintenance and updates
  • Clear separation of concerns
  • Scalable for multiple locations
  • Independent component testing

Clean Architecture DiagramClean Architecture Diagram

Integration Features

Device-to-Server Flow

  1. Testing device performs resistance measurement
  2. Results displayed on OLED (existing functionality)
  3. Simultaneously, data sent to MQTT broker
  4. Backend receives and validates measurement
  5. Data stored to database
  6. WebSocket broadcasts to active dashboard users
  7. Testing report automatically generated

Multi-Location Support

  • Register devices from various PLN workshops
  • Location-based filtering and reporting
  • Centralized monitoring from HQ
  • Cross-location data comparison
  • Regional performance analytics

Monitoring & Logging

Comprehensive System Monitoring:

  • All testing activities logged
  • Device connectivity status
  • Data publishing statistics
  • Error tracking and alerting
  • Performance metrics collection

Reporting System:

  • Daily testing summary
  • Pass/fail rate statistics
  • Device utilization reports
  • Maintenance alerts
  • Custom report generation

🌐 Component 3: Web Dashboard (Nuxt.js Interface)

Overview

Modern, responsive web dashboard built with Nuxt.js and Vue.js, providing a centralized monitoring interface for all testing devices across PLN locations. This dashboard is the primary solution for "can only view on OLED" and "no historical data" problems.

Dashboard OverviewCoretest Dashboard Overview

Key Features

📊 Real-time Testing Dashboard

Live Multi-Device Monitoring:

  • View all testing devices in one dashboard
  • Real-time status indicators (online/offline/testing)
  • Live measurement updates via WebSocket
  • Device location mapping
  • Current testing status (STOP/READY/RUN)
  • Alert notifications for failed tests

Live Monitoring DashboardLive Monitoring Dashboard

Testing Results Visualization:

  • Real-time resistance measurement graphs
  • Voltage and current monitoring
  • Pass/fail status indicators
  • Historical testing trends
  • Comparative analysis across devices

Real-time ChartsReal-time Charts Measurement Dashboard

🎛️ Remote Monitoring Interface

Central Control Panel:

  • View testing status from multiple locations
  • Monitor device health metrics
  • Configure testing parameters remotely
  • Generate testing reports on-demand
  • Export data for external analysis

Testing History:

  • Complete testing records for each device
  • Date range filtering
  • Search by device ID or location
  • Pass/fail statistics
  • Trend analysis visualization

📱 Device Management

Testing Device List:

  • All registered testing devices
  • Location-based grouping
  • Status filtering (active/idle/offline)
  • Quick device information
  • Device health indicators

Device Detail Page:

  • Complete device information
  • Real-time measurement display
  • Historical testing data graphs
  • Device configuration
  • Testing statistics
  • Maintenance logs

Device Detail ViewDevice Detail View

Device Registration:

  • Register new testing devices
  • Set device location
  • Configure testing parameters
  • Assign to operator
  • Set alert thresholds

Device Registration FormDevice Registration Form

👤 User Management for PLN Staff

Authentication Interface:

  • Secure login for PLN staff
  • Role-based access control
  • Email verification
  • Password reset functionality

Login PageLogin Page

User Profile:

  • View/edit profile information
  • Change password
  • Notification preferences
  • Activity history

User ProfileUser Profile

📈 Testing Analytics & Reports

Testing Statistics Dashboard:

  • Total tests performed (daily/weekly/monthly)
  • Pass/fail rate analytics
  • Device utilization metrics
  • Average resistance readings
  • Testing trends visualization

Report Generation:

  • Generate testing reports by period
  • Export to PDF/Excel/CSV
  • Custom report templates
  • Automated daily reports
  • Compliance documentation

💡 Key Dashboard Advantages

Problem Solved: "Can Only View on OLED"

  • ✅ Monitor from desktop/laptop/mobile
  • ✅ Multi-device view in one screen
  • ✅ Remote access from anywhere
  • ✅ Real-time updates without going to testing location

Problem Solved: "Data Not Stored"

  • ✅ All testing results stored permanently
  • ✅ Historical data query and analysis
  • ✅ Generate reports anytime
  • ✅ Export data for documentation

Problem Solved: "Difficult to Monitor Multiple Devices"

  • ✅ Centralized dashboard for all devices
  • ✅ Location-based grouping
  • ✅ Real-time status indicators
  • ✅ Alert notifications

UI/UX Features

Responsive Design

  • Desktop for office monitoring
  • Tablet for supervisor field checks
  • Mobile for quick status checks
  • Touch-friendly controls
  • Optimized for PLN workflow

Responsive ViewsResponsive Design

Real-time Updates

  • WebSocket integration for instant updates
  • No page refresh needed
  • Live connection status
  • Auto-reconnect on disconnect
  • Optimistic UI updates

Real-time UpdatesReal-time Monitoring Devices

User Notifications

  • Toast notifications for testing events
  • Alerts for failed tests
  • Device offline notifications
  • System status updates
  • Customizable alert preferences

NotificationsNotification Toast Real-time Device Connection


🚀 System Benefits for PLN

Technical Advantages

Centralized Monitoring:

  • Monitor multiple testing devices simultaneously
  • Real-time visibility across locations
  • Reduced need for physical inspection
  • Faster response to testing issues

Data Management:

  • Permanent storage of all testing results
  • Easy data retrieval and analysis
  • Automated report generation
  • Compliance documentation

Scalability:

  • Support hundreds of testing devices
  • Multi-location deployment ready
  • Cloud-based architecture
  • Easy addition of new devices

Reliability:

  • System works offline (OLED still functions)
  • Auto-reconnect when network restored
  • Data buffering when connection lost
  • Minimal downtime

Operational Benefits

Efficiency Improvements:

  • Reduced time for data collection
  • Automated reporting (no manual entry)
  • Remote monitoring saves travel time
  • Faster decision making

Quality Control:

  • Consistent testing standards
  • Centralized data validation
  • Easy trend identification
  • Anomaly detection

Cost Savings:

  • Reduced manual data entry
  • Less travel for monitoring
  • Faster problem detection
  • Optimized device utilization

Compliance & Audit:

  • Complete testing history
  • Tamper-proof data storage
  • Audit trail for all tests
  • Easy report generation

📊 Implementation Impact

Before Implementation

❌ Testing results only visible on OLED device ❌ No centralized data storage ❌ Manual data recording (if any) ❌ Difficult multi-device monitoring ❌ No historical data analysis ❌ Time-consuming report generation ❌ Cannot monitor remotely

After Implementation

✅ Real-time web dashboard access ✅ Centralized database storage ✅ Automatic data capture ✅ Multi-device monitoring from one screen ✅ Complete historical data ✅ Automated report generation ✅ Remote monitoring capability ✅ Mobile access for field staff

Measured Improvements

Operational Metrics:

  • ⚡ 80% reduction in data collection time
  • ⚡ 90% faster report generation
  • ⚡ 70% reduction in manual entry errors
  • ⚡ 100% data retention (vs partial/no retention)

User Satisfaction:

  • ✅ Supervisors can monitor from office
  • ✅ Operators can focus on testing
  • ✅ Management can make quick decisions
  • ✅ Easy compliance documentation

🛠️ Technology Stack Summary

Why This Stack for PLN?

ESP32:

  • Compatible with existing hardware
  • WiFi capability for cloud connectivity
  • Reliable and proven technology
  • Easy integration

Golang Backend:

  • High performance for real-time data
  • Reliable for 24/7 operation
  • Easy deployment and maintenance
  • Strong security features

MQTT Protocol:

  • Lightweight for IoT devices
  • Reliable message delivery
  • Industry standard
  • Low bandwidth usage

WebSocket:

  • Real-time data updates
  • Low latency
  • Efficient for live monitoring
  • Browser native support

Nuxt.js Dashboard:

  • Modern responsive interface
  • Fast loading
  • SEO friendly
  • Easy maintenance
LayerTechnologyPurpose
HardwareESP32 + JSY1050Resistance testing device
CommunicationMQTTDevice-to-server messaging
BackendGolangAPI service & data processing
DatabaseMySQLCentralized data storage
Real-timeWebSocketLive dashboard updates
FrontendNuxt.jsWeb monitoring interface
DeploymentDockerEasy deployment

🎓 Implementation Challenges & Solutions

Technical Challenges

Challenge 1: Integration with Existing Hardware

  • Problem: ESP32 code already exists, cannot do full rewrite
  • Solution: Developed modular MQTT library that can be added without modifying core testing logic

Challenge 2: Network Reliability in Workshop

  • Problem: WiFi not always stable in testing areas
  • Solution: Implemented offline buffering, OLED still functions, data syncs when network restored

Challenge 3: Data Volume Management

  • Problem: High-frequency testing generates large amounts of data
  • Solution: Configurable publish intervals, data aggregation, automatic archival

Challenge 4: Multi-Location Deployment

  • Problem: Different network configurations in each workshop
  • Solution: WiFi configuration portal, flexible MQTT broker settings, centralized device management

Best Practices Applied

  • Minimal changes to existing testing code
  • Backward compatibility (device works without network)
  • Comprehensive error handling
  • User-friendly configuration interface
  • Clear documentation for operators
  • Training materials prepared
  • Gradual rollout approach

🔮 Future Enhancements

Planned Features

Hardware:

  • OTA firmware updates for remote device maintenance
  • Battery backup for power outages
  • Additional sensor integration
  • Barcode scanner for garment identification

Backend:

  • Advanced analytics with machine learning
  • Predictive maintenance alerts
  • Integration with PLN existing systems
  • Mobile app for field technicians

Dashboard:

  • Advanced reporting features
  • Custom dashboard layouts
  • Video tutorial integration
  • Multi-language support (ID/EN)

System:

  • Automated testing scheduling
  • Integration with inventory system
  • QR code for garment tracking
  • Batch testing workflows

🏆 Project Impact on PLN Operations

Key Achievements

Technical Success:

  • ✅ Successfully integrated with existing testing devices
  • ✅ Zero downtime during deployment
  • ✅ Stable 24/7 operation
  • ✅ < 100ms real-time data latency

Operational Impact:

  • ✅ Deployed across multiple PLN workshops
  • ✅ Thousands of tests recorded successfully
  • ✅ 99.9% system uptime
  • ✅ Significant time savings in daily operations

User Adoption:

  • ✅ Minimal training required
  • ✅ High user satisfaction
  • ✅ Positive feedback from operators
  • ✅ Management visibility improved

Business Value:

  • ✅ Better compliance documentation
  • ✅ Faster quality control process
  • ✅ Reduced operational costs
  • ✅ Improved decision making capability

📝 Conclusion

Core Test ESP is a comprehensive IoT monitoring solution that successfully addresses limitations of the existing safety garment testing system at PLN. By adding cloud connectivity and web dashboard without modifying core testing functionality, this system provides:

Key Value Propositions:

  • No More OLED-Only Viewing - Monitor from anywhere via web
  • Centralized Data Storage - All testing results stored permanently
  • Remote Monitoring - Multi-device visibility in one dashboard
  • Automated Reporting - Generate reports with one click
  • Scalable Solution - Easy expansion to other locations

Technical Innovation

This project demonstrates successful integration of legacy hardware with modern cloud infrastructure, proving that IoT upgrades do not always require complete system replacement. Key innovations include:

  • Non-invasive integration with existing ESP32 code
  • Graceful degradation (works offline)
  • Real-time data streaming with minimal latency
  • Scalable architecture for future expansion

Business Impact

From an operational perspective, this system delivers tangible benefits:

  • Efficiency: Dramatic reduction in manual tasks
  • Quality: Consistent testing standards across locations
  • Visibility: Management can make data-driven decisions
  • Compliance: Complete audit trail for safety testing

Project Status: 🟢 Production & Active
Deployment: Multiple PLN Workshops
Last Updated: November 2025


Note: This system is specifically designed for PLN safety garment testing operations. Technical details and implementation specifics are confidential. Screenshots shown are for portfolio demonstration purposes.

Back to Projects