loading

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

<p>How about Bluetooth, so you can control it with a smart phone?</p>
<p>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</p>
<p>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.</p>
<p>Right, thanks for the hint. I just fixed it.</p>
<p>My regular controller broke. I have been looking for something like this for ages. Thank you so much!</p>
<p>Very nice work, thanks for sharing.</p><p>Build_it_Bob</p>
&quot;RC Controlled&quot; = &quot;Radio Controlled Controlled&quot;?
<p>Yes, like my ATM Machine </p>
<p>Nice one keep it up.</p>
<p>idont know how to change my profile ?guys help.</p>
<p>just log out.</p>
<p>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-&gt;12 Volt converter at one of the chinese web retailers: </p><p><a href="http://www.aliexpress.com/item/New-5W-5V-To-12V-USB-Step-Up-Boost-Module-Power-Supply-Better-US12/32273656554.html?spm=2114.01020208.3.1.B2EIdx&ws_ab_test=searchweb201556_3_79_78_77_80_61,searchweb201644_5,searchweb201560_8">http://www.aliexpress.com/item/New-5W-5V-To-12V-US...</a></p>
<p>good job</p>
<p>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.</p>
<p>Sure. The one I referred to is 6 Watt so it could supply half an amp</p>
<p>hey cool project,</p><p>can you explaine what is the 18 legs chip?</p>
<p>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.</p>
<p>You've got several systems ? There are three colors on your picture.</p>
<p>Right, the picture is a photomontage out of three pictures. I added this section now in the text above, thanks for the hint.</p>
<p>Probably means several modules, each are addressed differently so he can get different color setups.</p>
<p>Cool lighting design. </p>

About This Instructable

13,256views

280favorites

License:

More by bastynator:Smart Mirror by raspberry pi RC controlled rgb led strip 
Add instructable to: