Skip to content

How to use Infrared receiver and remote control with Arduino

Hello there, welcome to this simple tutorial on how to use an infrared receiver and its remote control with an Arduino board.

I’m using an Arduino Uno, LCD i2c screen, VS1838B Infrared receiver and a generic remote control, you can use most of IR remote controls that are used for TVs, Satellite Receivers..

This sensor and its remote will permit you to control remotely your Arduino board, and you can use it to control Relays, LEDs or even small robots… Yes I know it’s very old comparing to Wifi and Bluetooth but here we are :D.

The remote control sends IR codes to the sensor, in some code you’ll see that you can read the raw code and know its type, or IR protocol like NEC/RC5/RC6/Samsung/Panasonic…, in your project you’ll have to associate these buttons codes to some actions or functions like a robot movements, sound, lights….

If you want to see how to use a LCD i2c screen see my other post or video:

Arduino LCD I2C simple use and direct write from serial monitor

Generic IR remote controle and VS1838B IR receiver (there are some full modules versions)



Wiring:

The module has a digital output that should be wired with a digital pin.

N.B: For both codes used below the LCD i²c is optional

Wiring VS1838B and LCD i²c screen

Libraries

The libraries I used are: LCD i²c New_liquid_crystal  Download here
and for the IR library you can download it through Arduino IDE -> Library Manager search for IRremote and install it.

 


Codes:

First it would be better to test with the library examples, then the tutorial video will give you an idea about the codes I provided below, they are supposed to be easily integrated in your projects.

The first code displays (on both serial monitor and LCD screen) raw values received by the sensor, this will help you to identify each button code to associate later with functions of your choice.

Code 1:

 

Code 2:

Here in the second code, I already associated every button with its own name, if we have the same remote, this would be easier to integrate in your project.

 

Yassine View All

Automation and Electrical Engineer, Electronics amateur trying to share my little projects.

Leave a Reply

%d bloggers like this: