LED Control Panel

Status: Unknown

MQTT Broker

broker.emqx.io:8084

Topic

OpenCV-IoT6601

Client ID

PACEE112233

LED Pin

GPIO 5

Message Log

Ready Waiting for connection...

Test LED Simulation

Click the link below to open the Wokwi simulation and test if the LED is working. Make sure to run the simulation first!

Open Wokwi Simulation
1 Click the simulation link above
2 Press the green "Start Simulation" button
3 Use the control buttons above to test LED

User Manual & Documentation

Getting Started

Prerequisites:

  • ESP32 development board
  • LED connected to GPIO pin 5
  • WiFi connection
  • Arduino IDE with ESP32 board package

Quick Setup:

  1. Upload the provided Arduino code to your ESP32
  2. Ensure your ESP32 is connected to WiFi
  3. Open this web interface
  4. Wait for "Connected" status
  5. Start controlling your LED!

How It Works

MQTT Communication:

This system uses MQTT (Message Queuing Telemetry Transport) protocol for communication between the web interface and ESP32.

Web Interface
MQTT Broker
ESP32

Message Flow:

  • ON Command: Sends "ON" message to turn LED on
  • OFF Command: Sends "OFF" message to turn LED off
  • Topic: All messages use "OpenCV-IoT6601" topic
  • Feedback: ESP32 can send status updates back

Troubleshooting

Connection Issues:

Problem: "Disconnected" or "Error" status
Solution:
  • Check your internet connection
  • Refresh the page
  • Try a different browser
  • Disable ad blockers or VPN
Problem: LED not responding
Solution:
  • Verify ESP32 is powered and running
  • Check WiFi connection on ESP32
  • Ensure LED is properly connected to GPIO 5
  • Check serial monitor for error messages
Problem: Commands not working
Solution:
  • Wait for "Connected" status before sending commands
  • Check if ESP32 is subscribed to correct topic
  • Verify MQTT broker settings match

Technical Specifications

MQTT Broker: broker.emqx.io
WebSocket Port: 8084 (WSS)
Topic: OpenCV-IoT6601
Client ID: PACEE112233
LED Pin: GPIO 5 (Green LED)
Commands: "ON" / "OFF"
WiFi Network: Wokwi-GUEST
Baud Rate: 115200

Code Reference

Key Functions in ESP32 Code:

wifiConnect(): Establishes WiFi connection
mqttReconnect(): Connects to MQTT broker and subscribes to topic
callback(): Handles incoming MQTT messages and controls LED
client.loop(): Maintains MQTT connection in main loop

Pin Configuration:

GPIO 4 Main LED (unused in current code)
GPIO 5 Green LED (controlled via MQTT)
GPIO 13 PIR Sensor (commented out)
GPIO 34 LDR Sensor (commented out)