RC Controlled Rgb Led Strip

17K28723

Intro: 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 ;)

STEP 4: Create an Enclosure

Create a 3d printed enclosure.

The design has a hole for the power cable and gaps in the top to connect the led strip.

I used Fusion 360 to design the enclosure and exported the result as a .step file.

Netfabb allows the tessellation as well as the build job preparation. I attached the 3mf that contains the top and bottom of the enclosure. Netfabb also supports the gcode creation.

Finally i used a prusa i3 mk2 to print the enclosure.

22 Comments

I want to code my rgb led strip. I want to code it so that 1 is on, 2 and 3 are off and 4 is on, continuing in that pattern. How would the code start for that? I'm new to coding so I need assistance? Thanks

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

great. I have built some microcontroller LED projects that needed 5 and 12 Volt. With the abundance of cheap 5 Volt psu's around that is a bit of a drag. One could consider getting a cheap ( dimes) 5->12 Volt converter at one of the chinese web retailers:

http://www.aliexpress.com/item/New-5W-5V-To-12V-US...

The only thing to consider is the amount of LEDs you will be powering since the more LEDs in the strip will mean more current to power them and some of those Step-up boards can only push out so much current. Not to say it's not possible, short lengths should be fine, but longer ones probably stay with the 12V and step down for the ATTINY.

Sure. The one I referred to is 6 Watt so it could supply half an amp

hey cool project,

can you explaine what is the 18 legs chip?

That is just a darlington-array. Using three npn transistors would be enough, but on my desk there was this transistor-array, so i used this one.

You've got several systems ? There are three colors on your picture.

Right, the picture is a photomontage out of three pictures. I added this section now in the text above, thanks for the hint.

More Comments