About This Project

In this tutorial, we will be learning about IoT(Internet of Things) on how to control the color of RGB LED using NodeMCU ESP 12E. This tutorial basically is for controlling the color of the LED NIGHT LAMP.

Project Info

  • Programming Platform: Arduino IDE
  • Difficulty: Intermediate
  • Estimated Time: 2 Hrs
  • Category: IoT

Introduction

The LED Night Lamp can be controlled using the NodeMCU ESP 12E module. Do you know how? Exactly, this tutorial will let you know how it is made. You can also change the colour of the lamp using RGB LED.

What is NodeMCU ESP 12E ?

In NodeMCU ESP 12E, there are 30 pins in total, out of which there are 17 GPIO (General Purpose Input Output) pins. There are 9 digital pins ranging from D0-D8. It’s only one analog pin “A0” which is a 10 bit ADC. The “D0” pin can only be used to read or write data and can not perform other options. It is enabled when the EN pin is HIGH. When this pin is LOW the chip works at minimum power. The board has a 2.4 GHz antenna for a long range of network, the CP2102 is a USB to TTL converter. The development board equips the ESP 12E module, containing ESP8266 a chip having Tensilica Xtensa 32-bit, LX106 RISC microprocessor which can operate ranging from 80 to 160 MHz, and Clock Frequency can be adjusted.

It has 128KB RAM, and also 4MB of Flash memory for program and data storage just enough to cope with the large strings that makeup web pages. It is an Integrated board, equipped with 802.11/b/g/n HT40 WiFi transceiver, so it can not only connect to a WiFi network and interact with the Internet. The NodeMCU ESP 12E can also set up a network of its own and allow other devices to connect directly. Due to this, ESP8266 NodeMCU makes it more versatile.

Project: Make Your Own IoT LED Night Lamp Using NodeMCU ESP 12E

Now that we have a clear understanding of the project and the components used, let’s start the project.

soil-motsture-notification

Components Required

IMAGE COMPONENT QUANTITY

nodemcu-sp-12E

NodeMCU ESP 12E

1

android-phone

Android Phone

1

Breadboard

Breadboard

1

jumper-wire

Jumper Wires

As Per Required

cable-a-to-b

USB a to b

1

rgb-led

RGB LED, Common Cathode

3

Building Guide

Step 1: Assembly

  • Collect all the required components to make LED Night Lamp and place them on the breadboard.

Step 2: Connections:

  • Nodemcu digital pins D0, D1 and D2 to the RGB LEDs’ anode pins.  LEDs are in parallel connections. GND pin to the Cathode pins of RGB LEDs.

Note: RGB LED used here are common cathode.

iot-led-night-lamp-using-arduino

Step 3: After all the connections are done, start the coding to make LED Night Lamp Glow.

CODING:

night-lamp-code

The above programming code is obtained from the default library, so we need to change the authentication code which can be obtained from “Blynk Android App”. The procedure is shown below:

creat-new-project-of-night-lamp

Procedure to obtain Authentication code:

  • Go to the Blynk App.
  • Create a New Project.
  • Generate an Authentication Code by entering an email ID so that a code will receive through an email ID.

generate-code-for-a-night-lamp

When the authentication code is received through an email ID, Copy the Code and replace the default authentication code in the program with the new one received from an email ID.

Step 4: Upload the code on the NodeMCU.

Step 5: When the uploading is done, go to the Blynk App to set up. Procedure is depicted below:

Change the mode of control from the default settings according to the connections between LED and NodeMCU.


Now, we can see the ZCC (Zebra Colour Control). If we change the color in the ZCC, RGB LEDs of the LED Night Lamp will also change their color accordingly.

Code

DESCRIPTION

DOWNLOAD CODE

IoT LED Night Lamp Using NodeMCU ESP 12E


Download Code

Libraries

Blynk Library Master


Download Code