Skip to content

engahmed-elsawy/esp32-mqtt-smart-led

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”Œ ESP32 Smart LED Control System via MQTT

๐ŸŒก๏ธ Overview

This project uses an ESP32 to monitor temperature via an NTC thermistor and control a relay-connected LED in two operating modes:

๐Ÿ” Auto Mode

  • Relay (and LED) turns ON if the temperature exceeds a defined threshold.
  • Relay turns OFF when the temperature drops below the threshold.

๐ŸŽฎ Manual Mode

  • Relay can be turned ON/OFF remotely using MQTT commands from a PC or another MQTT client.

Circuit Diagram

๐Ÿ”ง Setup

๐Ÿ“ฑ ESP32 (MicroPython)

  1. Copy esp32_code/main.py to your ESP32.
  2. Connect hardware:
    • NTC Thermistor + 10kฮฉ resistor as a voltage divider โ†’ GPIO34
    • Relay Module control pin โ†’ GPIO2
    • LED connected between NOโ€“COM on the relay
  3. Run the code on ESP32.
  4. Open Serial Monitor to verify:
    • โœ… Wi-Fi connection
    • โœ… MQTT broker connectivity

๐Ÿ’ป PC (Python MQTT Controller)

  1. Install required library:
    pip install paho-mqtt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages