All Projects → thebigpotatoe → Super-Simple-RGB-WiFi-Lamp

thebigpotatoe / Super-Simple-RGB-WiFi-Lamp

Licence: MIT License
A project based on the ESP8266 and WS2812b

Programming Languages

C++
36643 projects - #6 most used programming language
HTML
75241 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Super-Simple-RGB-WiFi-Lamp

TinyPixelMapper
a Pixelmapping software for the ESP32 and ESP8266 for addressible LED Strips, with a OSC controll interface and FFT
Stars: ✭ 22 (-63.93%)
Mutual labels:  esp8266, ws2812b, esp8266-arduino
LetsHack
Notes & HowTo's covering the Raspberry Pi, Arduino, ESP8266, ESP32, etc.
Stars: ✭ 37 (-39.34%)
Mutual labels:  esp8266, esp8266-arduino
esp8266-1-channel-relay-board-with-mqtt
Sketch to control an esp8266-01 stc 15f104W powered 1-channel relay board
Stars: ✭ 26 (-57.38%)
Mutual labels:  esp8266, esp8266-arduino
EnviroMonitorStation
Arduino compatible software for ESP8266 based environmental monitoring station. Includes temperature, humidity, barometric pressure and PM2.5, PM10 dust monitoring
Stars: ✭ 71 (+16.39%)
Mutual labels:  esp8266, esp8266-arduino
Nick-ESP8266
Nick is a series of different Nixie clocks based on ESP8266.
Stars: ✭ 36 (-40.98%)
Mutual labels:  esp8266-arduino, esp8266-projects
lumazoid
Firmware for the Lumazoid realtime music visualizer board
Stars: ✭ 85 (+39.34%)
Mutual labels:  visualizer, ws2812b
CloudMyIp
Know your router public IP address, from anywhere. Great for cheap routers or IP cameras.
Stars: ✭ 38 (-37.7%)
Mutual labels:  esp8266, esp8266-arduino
Hyperhdr
Open source ambilight implementation for the audio and video stream on Windows 10 and Linux (x86 and Raspberry Pi). Primarily for use with the movie content on your TV and the LED strip. Includes support for HDR10 tone mapping correction for video processing and multi-threading for better performance.
Stars: ✭ 71 (+16.39%)
Mutual labels:  esp8266, ws2812b
esp8266-sensor-mpu6050
A set of arduino sketches that use the esp8266 and the MPU-6050
Stars: ✭ 17 (-72.13%)
Mutual labels:  esp8266, esp8266-arduino
smart-pod
An ESP8266 and VS1053 driven WebRadio and Internet music player.
Stars: ✭ 17 (-72.13%)
Mutual labels:  esp8266, esp8266-arduino
Farm-Data-Relay-System
A system that uses ESP-NOW, LoRa, and other protocols to transport sensor data in remote areas without relying on WiFi.
Stars: ✭ 97 (+59.02%)
Mutual labels:  esp8266, esp8266-arduino
Sonoff wifi switch
Прошивка для ESP8266 (Умный дом)-Firmware for ESP8266 (Smart Home)
Stars: ✭ 156 (+155.74%)
Mutual labels:  esp8266, ws2812b
Homekit Ws2812b Controller
ESP8266 based  Homekit controller for WS2812B lightstrips with WS2812FX support🌈
Stars: ✭ 110 (+80.33%)
Mutual labels:  esp8266, ws2812b
low-power-wifi
Experiments in low-power-wifi on esp8266, esp32, and ...
Stars: ✭ 35 (-42.62%)
Mutual labels:  esp8266, esp8266-arduino
Wled Wemos Shield
Wemos D1 Mini (ESP8266) or Wemos ESP32 D1 Mini (ESP32) based shield for WLED firmware
Stars: ✭ 105 (+72.13%)
Mutual labels:  esp8266, ws2812b
dirty-leds
Music reactive WS2812b LEDs with an ESP8266
Stars: ✭ 24 (-60.66%)
Mutual labels:  esp8266, ws2812b
Mclighting
The ESP8266 based multi-client lighting gadget
Stars: ✭ 977 (+1501.64%)
Mutual labels:  esp8266, ws2812b
Responsive led control
Responsive Led Control based on McLightning & Grisworld-Led-Controller with FastLED
Stars: ✭ 62 (+1.64%)
Mutual labels:  esp8266, ws2812b
WS281x.swift
A Swift library for WS281x (WS2811,WS2812*,WS2813*) RGB led strips, rings, sticks, matrices and more.
Stars: ✭ 32 (-47.54%)
Mutual labels:  ws2812b, ws281x
ResQ
Open Source Search and Rescue Tool for ground tracking and air usage based on ESP8266 hardware.
Stars: ✭ 20 (-67.21%)
Mutual labels:  esp8266, esp8266-arduino

Super Simple RGB WiFi Lamp

Super Simple RGB WiFi Lamp

A Big Thank You to Our Contributors

A special thank you to those who have contributed to this project! Without you it would not what it is now.

Getting started

This is the GitHub repo to support my Instructables publish. Be sure to head over there to see how to build and wire it!

Installing the Arduino IDE

This project was written in the Arduino environment. If you do not have it you will need to download it from here to be able to open and compile any of the files in this repo.

Installing the ESP8266 Core

Since this project uses the ESP8266 as the microcontroller, the board needs to be installed into the Arduino environment. This can be done by following the steps over at the GitHub repo for the ESP8266.

Installing Libraries

The code to run the lights was built to be as simple as possible for users to set up their device and get it up and running. This comes at the expense of the code being a little more complex to get some of the features I wanted. To speed up development I used a couple of absolutely amazing additional libraries which include;

  • ArduinoJson for messaging in JSON.
  • ESPAsyncTCP for the base layer of the WebSocket's
  • ESPAsyncUDP for collecting the time from an NTP via UDP
  • FastLED for controlling the LED's
  • Timelib for keeping track of the current time
  • WebSockets for creating a server for sending messages to and from clients
  • Arduino FFT for running the FFT of teh ADC signal for the visualiser mode

These additional libraries need to be installed, of which some are available in the Arduino IDE and some not. Due to this I have included the current working versions of the libraries in .Zip format to be able to import into the Arduino IDE. If you need to install these libraries, clone this repo and install the .zip files in the External Library folder using the method from Arduino.

Features

The code comes with several features built in to make things easier to manage. This includes things like having all the global variables in the main sketch file to "over the air updates".

OTA

You may update the sketch on the ESP to a new firmware using the inbuilt webhook on http://your-esp-ip-address/update or http://Super-Simple-RGB-Wifi-Lamp.local/update if you kept the default name. You must upload a binary file, uploading a sketch in .ino form will not work. For more info see here.

Website Features

This project comes with its own inbuilt website built in Bootstrap 4 to help make controlling the LED's much simpler. The website is accessible either via your home network if connected, or the ESP's wireless access point. Within the site you can change the mode and the individual settings for each. You can also change your connected Wi-Fi on the Wifi config page.

If you connect your ESP8266 through your home Wi-Fi network, this will be available at the IP address of the device, or at the mDNS name which defaults to http://Super-Simple-RGB-WiFi-Lamp.local/.

If you are connected to the ESP8266 via its access point, the webpage should be sent via a captive DNS. This is automatic on Windows and Apple products, but will require clicking "sign into network" on Android phones. It should be noted that mDNS does not work in this mode, and the default IP address is http://192.168.4.1. Please visit this link first to cache the important files in your browser first.

Home Page

Alt text Here on the home page you can easily select which mode you would like or select the Wi-Fi config tab to change your Wi-Fi network. At the top of this page you will see the three global settings. These are the current mode the light is in, The fading time between modes and power cycles, and the power button. These functions are at the top of each page. Please note, if the website is not connected to your ESP8266's WebSocket server, the Mode text will say WS closed.

Colour Mode

Alt text The colour page sets the mode to colour automatically. In this mode all of the LED's are set to the same colour and brightness. The colour can be changed by clicking on any of the buttons, the top one providing a colour picker.

Rainbow Mode

Alt text Rainbow Mode has two methods of being used. The user can either set the starting hue, being the colour that the RGB strip starts at, or set the speed at which the rainbow shifts around the entire strip. The total brightness of the LED's in rainbow mode can also be controlled here.

Clock Mode

Alt text In clock mode the time of day is shown using the top and bottom of the light. On the top, the lights progression along the length is the total number of hours passed since 12am/pm. This is 12 hour, so 6am/pm will be in the middle. The minutes are shown in the same manner, just with the total period of time being the number of minutes that have passed in the hour. In minutes 0 is at the start, and 30 will be the middle.

Bell Curve Mode

Alt text Bell Curve mode is the same as colour, where all the LED's are set to the same brightness. They are however dimmed in a bell curve shape to provide a more aesthetically pleasing cove of light.

Night Rider Mode

Alt text This is a gimmick mode that I just had to put in. It fades the lights left and right across the length just like the front of KITT from Knight Rider. This mode has no but instead just nostalgia.

Visualiser Mode

Alt text This is a mode which runs FFT over the ADC input to produce a spectrum of intensity across the length of the light. There are many options to play with to make the visualiser show off your music, sounds, or any other input perfectly. These settings are detailed on the webpage so you will always know what they do.

Note that while the fft runs using any input on the ADC, its is your job to ensure that you provide a clean and amplified signal to the pin within a range of 0 to 3.3V. Digitially amplifying the signal will not produce good results. Not reducing the effects of electrical noise on the input will also hinder the output seen for quiet sounds.

Messaging Specification

The webserver code is listening for incoming WebSocket messages with a JSON payload. This is processed after the message is received out of the callback. The complete example of the message is as follows. By connecting to the WebSocket server at port 81 from an external application such as Node-RED, allows users to talk to the device.

{
    "Name": "Super Simple RGB WiFi Lamp",
    "Mode": "Colour",           // Needs to be a String
    "State": true,              // Needs to be boolean
    "Fade Period" : 200,        // In milliseconds and will be kept above 0
    "Colour": {
      "Red": 0,                 // Values will be constrained to between 0 and 255 
      "Green": 0,               // Values will be constrained to between 0 and 255
      "Blue": 0                 // Values will be constrained to between 0 and 255
    },
    "Rainbow": {
      "Hue": 0,                 // Values will be constrained to between 0 and 360
      "Speed": 10,              // Values will be kept above 0
      "Brightness": 100         // Values will be constrained to between 0 and 255
    },
    "Clock": {
      "Epoch" : 1569494993,     // This is the UNIX time stamp of seconds since 1970
      "hourColour": {
        "Red": 0,               // Values will be constrained to between 0 and 255
        "Green": 0,             // Values will be constrained to between 0 and 255
        "Blue": 0               // Values will be constrained to between 0 and 255
      },
      "minuteColour": {
        "Red": 0,               // Values will be constrained to between 0 and 255
        "Green": 0,             // Values will be constrained to between 0 and 255
        "Blue": 0               // Values will be constrained to between 0 and 255
      }
    },
    "Bell Curve" : {
      "Red": 0,                 // Values will be constrained to between 0 and 255
      "Green": 0,               // Values will be constrained to between 0 and 255
      "Blue": 0                 // Values will be constrained to between 0 and 255
    },
    "Night Rider" : {
      
    },
    "Visualiser" : {
      "Period" : 250,           // Values will be constrained to between 0 and 2000
      "MinThreshold" : 100,     // Values must be above 0, and less than MaxThreshold
      "MaxThreshold" : 750,     // Values must be above 0, and greater than MinThreshold
      "FadeUp" : 32,            // Values will be constrained to between 0 and 255
      "FadeDown" : 32,          // Values will be constrained to between 0 and 255
      "HueOffset" : 170,        // Values will be constrained to between 0 and 360
    },
    "Wifi": {
      "SSID": "Test",           // This needs to be a String, empty strings will be accepted causing the Wi-Fi to disconnect and go into softAP mode
      "Password": "Test"        // This needs to be a string, empty values are accepted
    }
  }

Contributing

If you would like to edit or use this project elsewhere you are more than welcome, I just ask that you let me know if you can, I'd love to see how the project is used and adapted. Changes and additions to Modes, the website, or documentation here on GitHub are also welcome. I just ask that you follow the basic contributing guide and make a pull request so I can both read and test your changes before implementing.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].