Easy IoT RGB Bed Lamp From Used Stuff With Cayenne
3612 Views, 44 Favorites, 0 Comments
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.
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
Connecting NodeMCU to Rainbow LED FC-102
This is the connection beetwen NodeMCU with Rainbow LED :
NodeMCU Rainbow 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.
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.
Downloads
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
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
Done !!!
Now you can control the bed lamp with your smartphone/web browser.