กลับไปหน้ารวมไฟล์
controlling-led-light-esp8266-1b2ede-en.md

Wireless Illumination: Master IoT Control with ESP8266

The ESP8266 chip revolutionized the world of DIY electronics by offering high-performance WiFi connectivity at an incredibly low cost. This project focuses on the ESP-01S module, demonstrating how to turn a standalone microcontroller into a powerful Wireless Light Server capable of controlling power and intensity from any Android device.

Autonomous Network Architecture: AP Mode

Unlike most IoT projects that require a home router, this implementation sets the ESP8266 into Access Point (AP) Mode:

  • Self-Hosted Network: The ESP8266 creates its own WiFi network (SSID: Lights*). You connect your phone directly to the module, making it perfect for off-grid or localized lighting control (like inside a car or a cabinet).
  • Embedded Web Server: The device runs a lightweight HTTP server. When you "press a button" in the mobile app, it sends a simple GET request to the ESP's IP address (e.g., 192.168.4.1/ON).
  • State Persistence: Utilizing the onboard EEPROM, the server automatically remembers your brightness settings. If the power is cut, the light will return to its last known state as soon as power is restored—a critical feature for real-world home automation.

Dynamic Control via PWM

To control the "dimming" or brightness of the LED, the project uses Pulse Width Modulation (PWM).

  • Instead of adjusting voltage (which LEDs don't strictly like), the ESP8266 switches the light on and off hundreds of times per second.
  • By varying the "Duty Cycle" (the ratio of time the light is ON vs OFF), you can achieve 256 levels of brightness, creating smooth transitions from a soft glow to full intensity.

Integration with IoT Dashboard

The project is optimized for the IoT oneScreen app, providing a professional-grade interface for the end-user. This setup eliminates the need for manual coding of a mobile UI, allowing makers to focus on the hardware logic while enjoying a polished, responsive dashboard on their smartphone.

Simple project for work together ESP01S and mobile device with Android 7+. This project allows you to control the light of the built-in LED of ESP - ON, OFF and set brigthness. ESP work as server(AP with SSID: Lights*(xxxxx), password: 1234567890 ). The server recognizes the requests addressed to it and according to them can execute a direct command (ON, OFF) or send a management interface. If changes are made to the settings, they are saved in the EEPROM after disconnecting. In case of power loss, the settings are read by the EEPROM.

If use IoT oneScreen to follow next picture:

ข้อมูล Frontmatter ดั้งเดิม

title: "Controlling LED light ESP8266"
description: "Controlling LED light through WiFi and mobile device. Control On, Off and Brightness."
author: "madamliev"
category: ""
tags:
  - "home automation"
  - "esp8266"
  - "remote control"
  - "internet of things"
views: 2167
likes: 0
price: 99
difficulty: "Easy"
components:
  - "1x ESP8266 ESP-01"
  - "1x Solderless Breadboard Half Size"
  - "1x Cable, USB to TTL Serial Converter 5V"
  - "1x Premium Female/Male 'Extension' Jumper Wires, 40 x 3\" (75mm)"
tools: []
apps:
  - "1x IoT oneScreen"
downloadableFiles:
  - "https://create.arduino.cc/editor/madamliev/e2cd157b-224a-401f-a3a7-de6d33f33d43"
  - "https://create.arduino.cc/editor/madamliev/e2cd157b-224a-401f-a3a7-de6d33f33d43"
documentationLinks: []
passwordHash: "27a6552cb9a1dc67a395a88f6b188adbd77b1bb8ba417b451108798a8a14aaa7"
encryptedPayload: "U2FsdGVkX1/tB2uCqSArsFg5rRMR9W+DZ3KbeFwcjzk+m1anMtWVoOyEbEtT6KQRZRwSdKmvpxx7bbpMFMV0oOjtCcnPcMYKlrEw7EtqlZY="
seoDescription: "Learn how to control LED light with ESP8266 via WiFi. Adjust On, Off, and Brightness using a mobile device."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/controlling-led-light-esp8266-1b2ede_cover.jpg"
lang: "en"