Introduction: Easy IoT RGB Bed Lamp From Used Stuff With Cayenne

Hi there.

I wanna share how to create IoT RGB Bed Lamp from used stuff and controlled by Cayenne.

This lamp can controlled with Red, Green, Blue Slider over the Internet.

Step 1: Bill of Materials

Hardware required :

- NodeMCU ESP12E as microcontroller

- Rainbow LED FC-102

- Cell phone charger

- Some cables to connect NodeMCU with LED

- Used mineral water bottle

- White plastic bag

- Adhesive tape

Software required :

- Arduino IDE

- Adafruit NeoPixels Library for Arduino

- Cayenne for iOS/Android/Web Browser

Handtool required :

- Soldering iron

- Soldering tin

- Scissor

Step 2: Connecting NodeMCU to Rainbow LED FC-102

This is the connection beetwen NodeMCU with Rainbow LED :

NodeMCURainbow LED

VIN VCC

GND GND

DIN D2

You need to use soldering iron to join the cable with rainbow led. You can cut one side of jumper cable and solder them to rainbow led and connect to NodeMCU with the connection map above.

Step 3: Programming the NodeMCU

In this step we will program the NodeMCU with Arduino IDE.

First, you need to import Adafruit Neo_Pixels library to your Arduino IDE. You can search NeoPixels library from Sketch - Include library - then search Adafruit NeoPixel and install it.

Second, download LIGHT.ino from this step.

Third, open LIGHT.ino and edit your Cayenne token, SSID, password and then connect your NodeMCU with USB Cable to your computer and upload the code to NodeMCU.

Step 4: Creating Case for the Lamp

- Take the mineral water bottle.

- Release the sticker (normally on the body of bottle)

- Cut the neck of bottle until get flat cylinder form

- Take the plastic bag, cut it and patch it to cylinder and bond with adhesive tape

- Place the NodeMCU with LED above (arrange to fit the case)

- Give hole on the side of bottom case for supply the power

Step 5: Setting Up Cayenne Widget

Add three silder widget from Cayenne Dashboard :

1. Give slider widget name with Red, connected to Virtual Pin 6, data : voltage, min value 0, max value 255

1. Give slider widget name with Green, connected to Virtual Pin 7, data : voltage, min value 0, max value 255

1. Give slider widget name with Blue, connected to Virtual Pin 8, data : voltage, min value 0, max value 255

Step 6: Done !!!

Now you can control the bed lamp with your smartphone/web browser.