RC Controlled Rgb Led Strip

14,287

284

22

Posted

Introduction: RC Controlled Rgb Led Strip

Create your own rc controlled led-strip for individual room illumination!

Most rgb-led-strips are controlled by an infrared remote control. To turn it off or on or change the color, you have to stay in front of the receiver. This is boring and not really smart. To control the light in a cooler way, i developed a rc controlled board to set the right color of the strip. The rc code can be send from a raspberry pi, think of IFTTT. That's a lot smarter than the ir remote control.

Things you need:

  • rgb-led-strip, for example this would do the trick
  • ATTiny85
  • 433 MHz receiver (and optionally sender)
  • 5v regulator (L7805)
  • 3 NPN transistors, i used a darlingtonarray
  • 1 µF capacitor
  • 10 µF capacitor
  • 12v power supply
  • strip circuid board
  • several wires
  • ATTiny programmer, arduino-mega or arduino-uno
  • optionally raspberry pi to send signals

Step 1: Solder the Circuid Board

If you have all the components, you must solder the circuid board.

The led-strip needs 12v, the ATTiny and the rc receiver need 5v, because of that, the circuid gets 12v.

For the ATTiny and the rc receiver i use the 5v regulator, my circuid was inspired by sooraj619

The board switches the three colors red green and blue to the led-strip in a timetable of 3 ms. Each color in the right percentage to achieve the specified color. Because of a duration of the timetable with 3 ms, you don't see switching the three colors red green and blue, but you see just the right color (for example yellow mixed by red and green). In my toolbox there was a darlingtonarray, because of that i used this array to switch the colors. You can use any NPN transistors.

Don't forget a 17 cm antenna on the receiver.

Step 2: Flash the ATTiny

Now it's time to flash the ATTiny with the right arduino-sketch.

To flash the microcontroller, i used the arduino ide. I have no programmer, so i used my arduino-mega. You can use your arduino-uno or your arduino-mega to flash the ATTiny, described here or here

The sketch uses the rc switch library to receiver the signal, you can download this here.

The rc switch library was written for the arduino boards, therefore it uses some routines, that are not available in the ATTiny microcontroller. Because of the ATTiny, lines 153 to 165 initializes the interrupt in a very radically way. You also have to make the method 'handleInterrupt' from 'private' to 'public' in the rc switch library.

Step 3: Send a Code From Your Raspberry Pi

Now it's time to switch the light on.

To send a signal you must connect the rasperry pi with the rc sender. Several websites demonstrates sending rc codes with the raspberry pi. For example here, here and here. The image shows the led strip behind a tv screen, but this is a photomontage out of three images with single color.

A minimal c program to send a code can look like the following:

#include "RCSwitch.h"
#include

#include

int main(int argc, char *argv[]) {

int PIN = 0;

int message = atoi(argv[1]);

if (wiringPiSetup () == ­1) return 1;

printf("sending message[%d]\n", message);

RCSwitch mySwitch = RCSwitch();

mySwitch.enableTransmit(PIN);

mySwitch.send(message, 32);

}

The color is encoded in an integer value with 4 byte. The most left byte must equal to 10, see 178 in the sketch. The next three byte contains the color intensity for each color (red, green and blue).

To set a green light with 66% intensity, enter the command: sudo sendInt 167815680, where sendInt is the above compiled program.

Switch the led off with the command: sudo sendInt 167772160

Imagine possibilities with IFTTT, for example 3 seconds blue light for an email, green for a google-calendar notification. That's a little smarter than pressing the ir remote control in front of the receiver ;)

Share

Recommendations

  • Remote Control Contest 2017

    Remote Control Contest 2017
  • Arduino Contest 2017

    Arduino Contest 2017
  • LED Contest 2017

    LED Contest 2017

We have a be nice policy.
Please be positive and constructive.

Tips

Questions & Answers

21 Comments

How about Bluetooth, so you can control it with a smart phone?

Jea, i am currently coding on a little smart-home solution. This smart-home-java-application, calls the c-application from step 3. I attached a screenshot of the android-client of my smart-home application (wifi-connected). For more details visit https://github.com/dabastynator/RemoteControlSystem

Please do not use four way ties in your schematics (GND, regulator,1u and 10u cap). The way it is drawn now there is no connection in that place.

Right, thanks for the hint. I just fixed it.

My regular controller broke. I have been looking for something like this for ages. Thank you so much!

Very nice work, thanks for sharing.

Build_it_Bob

"RC Controlled" = "Radio Controlled Controlled"?

Yes, like my ATM Machine