Picture of Arduino - Control LEDs with a Remote Control
Hi guys,
I'm sharing with you a project I've recently done. I'ts about how you can control some LED's with a remote control and your Arduino. But you can apply this to any electronic device such as motors , lights for example.

you can visit my website for more electronic projects, interesting news and tips:

Remove these adsRemove these ads by Signing Up

Step 1: IR library

Picture of IR library
First you need to go to this page and download the IR library. You just need to follow the read me file to install. I think that any IR remote control can do this, I’ll be using a Philips Universal one.

Step 2: Parts required

Picture of Parts required
Parts list:
1x Arduino
1x Breadboard
1x Remote control
1x IR receiver ( I’ll be using TSOP4838)
4x LED’s
4x 220ohm resistors
Jumper cables

The infrared receiver has 3 pins:
First pin: Vout, outputs HIGH when no signal is present and LOW when a mark is received.
Second pin: GND.
Third pin: Vcc.

Step 3: Circuit diagram

Picture of Circuit diagram
You need to wire your circuit something like this.
And then I went to the arduino IDE > file>examples>IRremote> IRrecvDemo. You need to upload the sketch to your arduino, open the serial monitor and start using your remote control and see which values the arduino is receiving.

After a while I’ve wrote down which values appear in the serial monitor when you press the volume up key or any other key, and write it down for all the keys you want to use. And they were:

Power:  E240
Forward: E250
Reverse: E248
Volume+: E244
Volume-: E254
Mute: E24C7
You will need to convert these hexadecimal numbers to decimal, you can use this tool for that.
KUPITO8 days ago

Amazing! Thanks for sharing this bro, this was my first project with an arduino. I was having a hard time at the beginning but it was because the pins of my receiver were different according to the datasheet. As an electric engineer. this could come pretty handy you could even control high power applications, instead of having a LED a relay would take place or a timer. Applications are limitless

Thanks dude this works perfectly for me.

I used this to operate a fan.

micmac1 month ago

The only tiny error I found (beside a missing ';') is that the IR discovery sketch used to capture the IR codes from the controller calls for a different receiver pin, 11 if I remember, where your setup calls for pin 3. Once that change is made in the code, it captures the IR perfectly and then goes on to control the LEDs perfectly. I'm well on my way to my remote control swiveling ceiling mounted garage fan. Thanks.

servalente4 months ago

Caro Rui, gostaria, se possível, que me desse uma ajuda numa questão relativa ao IR a funcionar com o arduino e controlo de leds. Faço modelos à escala, e no projecto que tenho em mãos gostava de aplicar luzes num camião à escala 1/8. Tenho tudo ligado, e quase a funcionar na perfeição, mas ainda não consegui deixar os sinais de pisca a funcionar. Tenho três códigos do IR disponiveis, para os piscas de esq. da direita e para os de emergência. Não consigo arranjar maneira de os deixar a piscar enquanto tenho outras luzes ligadas. Acha que me pode ajudar?

Obrigado desde já pela paciência.

ehameedullah10 months ago

i love instructable site becauze they do alot of different crazy project

ehameedullah10 months ago

i love instructable site becauze they do alot of different crazy project

Kamokaki10 months ago

hi im trying to controll my arduino to move a servo.

(Could you help me put in the code?

The controll gives off the infrared as i press left: FF22DD and right FFC23D. Please help me figure this out.)

#include <Servo.h>
#include <IRremote.h>

unsigned long Value1 = 0xFF22DD; // where XXXXXXXX is on our your remote's values
unsigned long Value2 = 0xFFC23D; // where XXXXXXXX is another button on your remote

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

Servo servo1;

// the setup routine runs once when you press reset:
void setup() {

irrecv.enableIRIn(); // Start the receiver

// initialize the digital pin as an output.

servo1.attach(10); // attack servo to digital pin 10

// the loop routine runs over and over again forever:
void loop() {

if (irrecv.decode(&results)) {

Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value

if(results.value == Value1) {
else if (results.value == Value2){

rogertikboy11 months ago

here is the error I got

IRrecvDemo:16: error: 'IRrecv' does not name a type
IRrecvDemo:17: error: 'decode_results' does not name a type
IRrecvDemo.ino: In function 'void setup()':
IRrecvDemo:27: error: 'irrecv' was not declared in this scope
IRrecvDemo.ino: In function 'void loop()':
IRrecvDemo:32: error: 'irrecv' was not declared in this scope
IRrecvDemo:32: error: 'results' was not declared in this scope
IRrecvDemo:67: error: expected `;' before '}' token

thanks again,

RuiSantos (author)  rogertikboy11 months ago

You need to install the IR library...

You didn't follow throught the Step number 1.. Please read that step carefully.

Have a nice day,


Vaibhav1o11 year ago
Dude the code is wrong!!
RuiSantos (author)  Vaibhav1o11 year ago
sorry for the long delay to answer... what you mean? it works fine for me and for a lot of people who already tried...
tell me what's not working, thanks!
hey dude what if i use a remote control which i got with the arduino starter kit?
thanks :)
lpereira151 year ago
what if I want to do this without using a library?
RuiSantos (author)  lpereira151 year ago
If you don't want to use the library, you'll need to write a lot of code to do this simple project.
What I recommend you to do is to download the library and my code.
See which functions I'm using from the library.
And understand what they do.

Then instead of using the functions from the library you can create your own functions on a single Arduino skecth...

I hope this helps,
I've installed the IRremote library. Opened iRrevc, compiled and uploaded to Arduino. All looks as it should yet nothing prints in the serial monitor. I've tried ALL the baud rates (although I imagine you used 9600) yet the issue persists. My circuit is identical to yours. Only difference in brand/model of the IR Receiver... I've tried 2. One I salvaged from an old sony blu ray player and the other I bought at RadioShack (276-0640). Both are:
38kHz IR receiver
Supply Current: 0.27-0.45mA
Supply Voltage: 2.5-5.5V
Output Volt low: 100mV

I've also tried several remotes that I've confirmed are in perfect working order.

Any thoughts on the matter? If you'd like, PM me.

Thank you!!
faziefazie1 year ago
I follow your circuit diagram, but there are several problems
1. when I upload the code to Arduino, I keep get the wrong message that my Arduino port can't be read by my PC, but if I don't connect the ground and vcc from the circuit to Arduino, the port can be read by my PC.
2. After I upload the code (without connect the circuit and Arduino), I can't test my remote because the serial monitor can't be open if the circuit is connect to Arduino.
3. My IR receiver get hot when I connect it with Arduino.

is that something I did wrong? or can you give me more explanations about how to read the remote.

RuiSantos (author)  faziefazie1 year ago
thanks for trying my project!
1) I didn't understand exactly that problem... :S can you upload others arduino sketches to your arduino? did you upload the IR library to the libraries folder from the arduino IDE?
2) If the answer I gave you in 1) doens't apply to you... try to reinstall the arduino IDE again and try to upload my code.
3) which IR receiver you're using?
did you follow exactly my schematics? because that shouldn't be happening!
Please let me know what I can help you more with