Random Nerd Tutorials
Share

$10 DIY WiFi RGB LED Mood Light with ESP8266 (Step by Step)

Share

TIn this project, I’ll show you how you can build your own mood light. You’ll use an ESP8266 to remotely control the color of your light using your smartphone or any other device that has a browser. This project is called $10 DIY WiFi RGB LED Mood Light.

First, watch the step by step video tutorial below


To learn more about the ESP8266 and RGB LEDs use the following tutorials as a reference:

If you like the ESP and you want to do more projects you can download my eBook Home Automation using ESP8266 here.

Let’s get started!

Parts List

Here’s the hardware that you need to complete this project:

rgb led strip

buck converter

white lamp

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Flashing Your ESP with NodeMCU

In this tutorial we are going to use the NodeMCU firmware. You have to flash your ESP with NodeMCU firmare.

Downloading ESPlorer IDE

I recommend using the ESPlorer IDE which is a program created by 4refr0nt to send commands to your ESP8266.

Follow these instructions to download and install ESPlorer IDE:

  1. Click here to download ESPlorer
  2. Unzip that folder
  3. Go to the main folder
  4. Run “ESPlorer.jar” file
  5. Open the ESPlorer IDE

Uploading Code

You should see a window similar to the preceding Figure, follow these instructions to upload a Lua file:

  1. Connect your ESP8266-12E that has built-in programmer to your computer
  2. Select your ESP8266-12E port
  3. Press Open/Close
  4. Select NodeMCU+MicroPtyhon tab
  5. Create a new file called init.lua
  6. Press Save to ESP
cloud-download

Everything that you need to worry about or change is highlighted in red box.

Code

Upload the following code into your ESP8266 using the preceding software. Your file should be named “init.lua“.

Don’t forget to add your network name (SSID) and password to the script below.

IMPORTANT: the embedded script below was made in 2016 and it works with an older version of the Lua firmware. If you’re running a newer version of the Lua firmware, you’ll need to use this script instead: ESP8266_RGB_Color_Picker_New.lua.

Schematics

Now follow these schematics to create the final circuit.

ESP8266_moodlight_bb

Your ESP IP Address

When your ESP8266 restarts, it prints in your serial monitor the ESP IP address. Save that IP address, because you’ll need it later.

In my case, the ESP IP address is 192.168.1.105. If you experience problems seeing your IP read this troubleshooting guide.

You’re all set!

ESPlorer IDE - fixed

Opening Your Web Server

Go to any browser and enter the IP address of your ESP8266. This is what you should see:

RGB color picker main selecting color

Click the input field and a small window opens with a color picker. Simply drag your mouse or finger and select the color for your RGB LED strip:

selecting color

Finally, press the “Change Color” button:

Browser

Now, your mood light can be placed in your living room:

living room

Go to the top of this page to see a video demonstration of this project.

Wrapping Up

This project shows a real world application for the ESP8266 board. If you don’t have an RGB LED strip, but you still want to try this project you can read this blog post ESP8266 RGB Color Picker that changes the color of an RGB LED with an ESP8266.

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog.


MicroPython Programming with ESP32/ESP8266 eBook

Learn how to program the ESP boards with MicroPython, including projects, tips, and tricks! The registrations are open for a limited time, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Add Your Reply

⏰ Registrations are open for "MicroPython Programming with ESP32 and ESP8266" eBook