Skip to content

DaWaGit/WiFiLed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WiFiLed

With this project, you can control an WS2812 RGB LED stripe (up to 300 LEDs) via your browser.
The following features are realized.

  • browser control
    The device provides a webpage, where you can control the LED stripe (including simple animations).
    mainScreen
  • smooth on/off
    The LEDs will be turned on and off smoothly via a PT1 damping
  • rightness is dependent form sunrise & sunset
    You can define two different brightnesses, one for sunrise and one for sunset.
    The brightness switches automatically when the sun rises or sets.
    ledSetup
  • color animations
    You can define simple color animations
    colorMode
  • sunrise & sunset calculation
    You can configure NTP timing servers and your longitude and latitude, to calculate the sunrise and sunset.
    timeSetup
  • optionally IR motion sensors
    Connect optionally two IR motion sensors to activate the LEDs by motion detection.
    After a defined time the LEDs will be durned off.
    globalSetup
  • optionally IR distance sensors
    Connect optionally an IR distance sensor to control on/oof and the brightness.
    • fast moving across the distance sensor turns the LEDs on/off
    • static distance in front of the distance sensor changes the brightness

Hardware

The following main devices are used in the schema:

  1. Wemos D1 mini: ESP8266 CPU
    doc: https://www.wemos.cc/en/latest/d1/d1_mini.html
  2. WS2812B: single addressable LED-stripe
    doc: data sheet
  3. AM312: IR motion sensor (optional)
    doc: data sheet
  4. GP2Y0A21YK0F: IR distance sensor (optional)
    doc: data sheet

Circuit Diagram

schema

Net-Plan

net plan


Compile & Flash

  1. open project root in your VSCode editor
  2. connect device Wemos D1 mini via USB
  3. configured the connected COM port in ./platformio.ini
  4. open your PlatformIo VSCode plugin
  5. select in PlatformIo / d1_mini / Platform / Upload Filesystem Image to upload the Sketch data stored in ./data/
  6. select in PlatformIo / d1_mini / General / Build to build the system
  7. select in PlatformIo / d1_mini / General / Upload and Monitor to upload the code and start the serial monito to see the debug output

Debug output

This project sends a lot of debug information via the serial interface. These data will be sent with 115200 baud.
You can control which information should be sent, when you change the DEBUG_LEVELin file DebugLevel.h

WiFiLed/DebugLevel.h

Lines 4 to 20 in 8eb0543

// +-------- global debug output
// |+------- unused
// ||+------ WebServer events
// |||+----- WLAN events
// ||||+---- EEP events
// |||||+--- LED details
// ||||||+-- LED events
// |||||||+- Button events
// ||||||||
#define DEBUG_LEVEL B10111011 // current enabled debug level
#define DEBUG_GLOBAL_OUTPUT B10000000 // enable serial debug output
#define DEBUG_WEBSERVER_EVENTS B00100000 // show all web server events
#define DEBUG_WLAN_EVENTS B00010000 // show all WiFi events
#define DEBUG_EEP_EVENTS B00001000 // show all EEP events to read/write values
#define DEBUG_LED_DETAILS B00000100 // show LED stripe details
#define DEBUG_LED_EVENTS B00000010 // show LED stipe events
#define DEBUG_BUTTON_EVENTS B00000001 // show all detected Button events


Getting Started

When you turn on as first time, follow the next steps, to connect the device in your WiFi:

  1. The blue onboard LED is blinking slowly to inform you, a Wifi-Access-Point was started.

  2. Search and connect your mobile device with an WiFi-Access-Point named WiFiLed-\<DeviceId\>

    name value
    SSID WiFiLed-<DeviceId>
    Password none
    Url http://192.168.4.1/
  3. Open in your browser the page http://192.168.4.1/

  4. In WiFi Setup add your WiFi SSID and password and press Success
    wifiSetup

  5. The device starts new, but with a fast blinking onboard LED to inform you, the connection to your WiFi is trying

  6. When the WiFi connection is successfully established, the onboard LED is static on.

    • Search in your router the IP from device
    • open the IP in your browser to control the LED stripe
  7. When the WiFi connection fails after 3 minutes, the device will restart, but im WiFi-Access-Point mode (slow blinking onboard LED)
    Repeat all steps from begin


Known Issues

  • none

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors