SmartPhone Controlled RGB MOOD Light V2.0

by geekrex in Circuits > Arduino

8231 Views, 104 Favorites, 0 Comments

SmartPhone Controlled RGB MOOD Light V2.0

IMG_4885.JPG
IMG_4878.JPG
IMG_4882.JPG
IMG_4881.JPG

Mood lamps are always fascinating for me and is a very good project for starters to start with Arduino.
In this Instructables i will show how to make a wifi mood lamp , using nodemcu /esp8266 12.
This is for people who are starting in IOT or Wifi Related Project.

What is a Mood Lamp ?

Mood lamps are lighting devices that are used to establish a particular feeling or mood within a room. In some cases, this type of lamp may be a small device that is plugged into an outlet and creates points of light near the floor line of the room. Other examples of a mood lamp may be used to illuminate specific points along the walls or cast a soft light over a larger piece of furniture in the room. Mood lighting differ somewhat from other lamps in that their purpose is not so much practical as aesthetic. Reading lamps for example tend to provide bright light to a given space in order to make it possible to read a book or magazine without creating strain on the eyes. Overhead lighting is used when there is a need to illuminate the majority of the space, such as in a classroom or laboratory. By contrast, a mood lamp is used to help create a specific ambiance within the room as a means of making the space more attractive and welcoming in some manner.
Subscribe to out channel for awesome videos

BTW it got accepted for the circuit and IOT contest so if you like it do vote .

Components

Fritzing 24-May-16 23621 AM.jpg
Fritzing 24-May-16 23958 AM.jpg
IMG_2866.JPG
IMG_4554.JPG

Controlling RGB LED

IMG_2878.JPG
IMG_2880.JPG
FFZHAZBIOK9M86N.LARGE.jpg

To Control The RGB we need to learn how to control a Normal LED Brightness.

The Answer is PWM Pulse Width Modulation.It is digital representing Analog signal by varing the duty cycle of the pulse. In Nodemcu, we use the analogwrite function to get a PWM wave the function generates a square wave of specified duty cycle the value of which is defined by the user. In the graphic below, the green lines represent a regular time period. This duration or period is the inverse of the PWM frequency. In other words, with Nodemcu,PWM frequency at about 500Hz, the green lines would measure 2 milliseconds each. A call to analogWrite() is on a scale of 0 - 1023, such that analogWrite(1023) requests a 100% duty cycle (always on), and analogWrite(512) is a 50% duty cycle (on half the time).

Luckily the blink app does all the complicated stuff and you don't need to worry anything about it.

Connections

IMG_4557.JPG
IMG_4962.JPG
IMG_4964.JPG

At first we will connect the simple RGB 5mm LED to the Nodemcu and control it .
The connection is very simple .Bend the leg of the anode at an angle .
now connect the R , G, B Pins to the D6 , D7 ,D8 pins respectively on the breadboard.
Now we need to connect the anode to the Vcc / 5 V which is here the V in.
If it is cathode connect it to the Gnd

Setting Up the App

Screenshot_2016-11-18-22-03-08.png
Screenshot_2016-11-18-22-03-55.png
Screenshot_2016-11-18-22-08-00.png
Screenshot_2016-11-18-22-09-20.png

Once you open the app

  • click on the plus icon to create a new project
  • Name your project
  • Select the hardware you will be working on (Nodemcu here)
  • Click on Create
  • Now you need to use a widget named ZeRGBa
  • Click on the plus icon and select ZeRGBa
  • Define the pins in our case D6,D7,D8
  • Since our is common cathode we need to define the PWM reverse
  • Change the min to 1023
  • Max to 0
    App is ready now using the authentication token we need to change the code

Code

sdd.jpg
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "Enter you Auth Token";

void setup()
{
  Serial.begin(9600);
  Blynk.begin(auth, "wifi router name ", "wifi router pass");
}

void loop()
{
  Blynk.run();
}

Downloads

Connecting With RGB Strip

Untitled Sketch_schem.jpg
IMG_4977.JPG
IMG_4976.JPG
IMG_4970.JPG
IMG_4974.JPG
IMG_4971.JPG

In case of any RGB strip I use a custom made controller interface
the connections are as follow

  • Red to Pin 3 of NodeMcu
  • Blue to Pin 5 of NodeMcu
  • Green to Pin 6 of NodeMcu
  • Gnd to Gnd Of NodeMcu

Complete Your Mood Lamp

IMG_4950.JPG
IMG_4951.JPG
IMG_4952.JPG
IMG_4953.JPG

I rolled a paper and then Squeezed it . Then again shaped it back to the cylinder .
This gives it a crystal effect .
or you can simple connect the roll paper roll your choice.
Now connect the Nodemcu to a power source and run the app.
Once you are connected you can change the color of the Mood lamp from anywhere around the world
if you like the project than do like my Facebook page
https://www.facebook.com/makewithRex/

And subscribe to my youtube channel
https://www.youtube.com/c/PrajjwalNag