RPi Quadcopter blog

RPi Quadcopter blog
Click to open
Showing posts with label IR. Show all posts
Showing posts with label IR. Show all posts

May 28, 2011

Fujlight ir-codes

Found this remotecontrolled led -bulb for cheap: http://www.verkkokauppa.com/fi/product/8159/cgfmm

The remote is  "MCL Remote Controller" and it seems to be used in various other products. These codes should then work with other products with the same remote.

Infrared NEC codes:

speed +: 0xFF08F7
speed -: 0xFFC03F
Pause: 0xFF807F
Off: 0xFF609F
skip 1: 0xFF906F
skip 2: 0xFFB847
Fade: 0xFFF807
Strobe: 0xFFB04F
Red1: 0xFF9867
R2: 0xFFE817
R3: 0xFF02FD
R4: 0xFF40BF
R5: 0xFF50AF
Green1: 0xFFD827
G2: 0xFF48B7
G3: 0xFF12ED
G4: 0xFFA05F
G5: 0xFF7887
Blue1: 0xFF8877
B2: 0xFF6897
B3: 0xFF20DF
B4: 0xFF2AD5
B5: 0xFF708F
White: 0xFFA857
100%: 0xFF32CD
75%: 0xFF00FF
50%: 0xFFB24D
25%: 0xFF58A7

See how to send these NEC-codes with Arduino!



The whole top part of the controller is glued sheet of plastic with buttons. You may see this remote with different layouts, so I included .odt/excel file where you can see the codes in button order. Download

May 23, 2011

Receiving and sending IR with Arduino

Sending IR with Arduino means that you can control various different devices in your home. Controlling different devices with IR can be part of your Arduino smart home.

Reading the IR signals is fairly easy. All you need is a IR receiver. The most commonly used infrared carrier signal is 38 kHz, but it should still work fine, if the receiver and sender use different frequencies.


Receiver:
38khz

I used IRremote library to send and receive infrared signals. You can download and read more instructions about IRremote library here.

Use the IRrecieveDump -demo to dump all the data read from your remotecontroller. If the data could be identified as RC5, Sony or NEC it will also be very simple to send.

To send IR, you need an Infrared LED with a resistor. You don't want to burn your LED so use this counter to calculate the best resistor for it.


IR-Led



Example:

Start the IRrecieveDump -demo and open serial monitor.
Point your remote towards the receiver and press a button.
The program should print out for example the NEC -code and the raw data.
The NEC -code should look like this: "FF906F".

Now you can try sending the same code by using sendNEC() method:
Irsend.sendNEC(0xFF906FF, 38); 

UPDATE:
the 38 above is wrong. The second parameter is the lenght in bits. The Nec function will always send 38khz. Correct way is:

Irsend.sendNEC(0xFF906FF, 32);

Because the code you are sending is a HEX code you need to put the "0x" before it.
"38" in the constructor means that you want to send it with 38khz carrier frequensy.


Some devices use their own protocols such as Samsung, but you can get the raw data from them. To clean the raw data you get from the dump -demo, you need to erase the first number, then convert all negative numbers to positive and place commas between the numbers.

Here's an example:

Raw data: 4802, -620, 500, -420, 600, -440....

Sending:

unsigned int[68] power_ON ={620,500,420,600,440... ...};
Irsend.sendRaw(power_ON, 68, 38);

68 is the length of the unsigned integer.