Multifunctional RGB LED Light

Multifunctional RGB LED Light © GPL3+

Create the perfect mood in your room, wake-up easily, light up your room as you enter or be alerted when someone enters your private space.

  • 5,894 views
  • 1 comment
  • 29 respects

Components and supplies

Apps and online services

About this project

Introduction

Then you start working with microcontrollers, embedded systems or IoT the first tutorial usually shows how to blink the LED. When you start using Cayenne it offers the same - "Let’s add a luminosity actuator widget." So I decided to do this, but in a slightly more complex way.

I started with Arduino Uno, three colour LED and motion detector. Connect all the components, write some simple code and here you have it - a colourful automatic LED light. Using PWM you can control its brightness and colour.

The remote control

But this is just a beginning. These days we want to control everything: TVs, doors, cars, husband. And we prefer doing it remotely. So I need to connect it to a remote control, and nowadays obviously it is my smartphone. This is where the Cayenne comes in. Cayenne (as their site claims) is the world’s first drag and drop IoT project builder that empowers developers, designers and engineers to quickly prototype and share their connected device projects.

This is exactly what I need to make it happen with minimal effort. I just need to connect my Arduino Uno to the net. For that I use W5100 Ethernet shield and Ethernet cable, but in the future I will upgrade to the WiFi enabled board like ESP8266.

All I need now is go to my Cayenne account and create a new project.

If you don’t have Cayenne Account, you can create it from your Mobile device or online. Cayenne was designed to work from iOS and Android smartphones and popular browsers. Go to the Sign Up page, enter your Name, Email, create a Password and you’re done.

Setting up Arduino

Then setup your Arduino Uno and install the Cayenne Arduino Library onto the device. All the detailed instructions are on Cayennes webpage. The code is generated by Cayenne automatically, you only need to assign pin numbers for your sensors and actuators and upload it to Arduino.

I added three Luminosity widgets to my dashboard to control LEDs colour and brightness, also motion sensor widget and button widget to turn on/off the light.

Triggers & Alerts

Now it’s time to add some triggers. I set the trigger to light up the red LED then motion is detected and another one to send me a notification SMS.

When the motion is detected the red LED is on and Cayenne sends a notification SMS. To turn off the LED we need to set up another trigger.

Another trigger is set to turn on or turn off the LED. Here we can also set the default LED colour.

Scheduling

Everything worked fine at this stage, but then I realized that Cayenne has a another useful feature - scheduling. So why not to use it?

One thing we can do with this feature is to set an alarm clock. But I already have an alarm clock, and not just one but three, and they all are annoyingly loud. So this one must be different. I will make a wake-up light which will silently fill up my room with warm light just before I need to wake up. If it doesn’t help there always is my annoying alarm clock.

If you have enough patience you can set schedule for all week or a month, or even a year. But I don’t… Also we can use this feature to imitate activity in a house while we are away as we can turn on/off the lamp whenever we want.

Hardware

I use a RGB module with 12 LEDs mounted on a big aluminium heatsink. The LEDs are controlled from dedicated controller board with internal power supply. The board is powered from 230 VAC mains outlet and controlled via standard Ethernet cable using PWM signals. To generate these signals I use Arduino Uno with Ethernet shield and for motion detection there is a PIR sensor.

I mounted the PIR sensor on the top of the lamp. It will detect movement if someone is walking around, but it won’t disturb you while in bed or if your dog is moving around.

For the lampshade we can use all sorts of material like plastic, glass, paper, fabric or metal and give it any shape. The same is for the lamps stand. Here I use a metal housing of another LED light, we only need to make sure that all the component will fit inside.

And here is the final result.

In the end I could say that this is very useful piece of hardware which can be used as a automatic light, some kind of alarm system, wake-up light or just a regular lamp with remote control for lazy people. Also you can use it like a Mood lamp to create the perfect mood in your room or use it like a night lamp.

Code

Cayenne codeC/C++
This sketch connects to the Cayenne server using an Arduino Ethernet Shield W5100
and runs the main communication loop.
//#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#include <CayenneEthernet.h>

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "AuthenticationToken";

void setup()
{
	Serial.begin(9600);
	Cayenne.begin(token);
}

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

Schematics

RGB LED light schematic
This circuit diagram show you how to connect the main components
K2q26cwqhy8ohdegsccx

Comments

Similar projects you might like

RGB LED Strips Controller

Project tutorial by Philippe Libioulle

  • 16,647 views
  • 2 comments
  • 18 respects

LED Emergency Lights using WS2812 RGB LED Module

Project tutorial by bigboystoys13

  • 10,004 views
  • 5 comments
  • 20 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 2,133 views
  • 0 comments
  • 3 respects

Arc RGB LED Lamp

Project in progress by antiElectron

  • 1,405 views
  • 0 comments
  • 5 respects

Temperature-controlled RGB LED

by Benjamin Larralde

  • 19,557 views
  • 7 comments
  • 30 respects
Add projectSign up / Login