@tutorial: IR remote - Arduino and VS1838

This setup is very common. We have many types of IR remotes. Those, basically are sending a infrared light signal that is usually encoded. To emit light, they usually use an IR LED: That light will touch the receiver, which is usually a phototransistor. This will decode and give at the output the received signal. If we attach a microcontroller to this setup, we could read the signal for each pressed button of the remote and control anything with

External Link: https://electronoobs.com/eng_arduino_tut34.php

by: ELECTRONOOBS on 2026-08-08

~What do we need?

- 1 x Arduino (UNO, NANO, etc) eBay LINK

- 1 x VS1838 receiver eBay LINK

- 1 x IR remote eBay LINK




~PART 1 - Preparing the receiver.

We will use the VS1838 IR receiver. But, in order to work properly it needs a simple configuration that we could see below in the next schematic. We need to limit the current so a 100ohm resistor is placed between Vcc pin adn 5V. Aslo, the output needs a pullup so a 10K ohms resistor is placed between signal out pin and Vcc.

IR remote - Arduino and VS1838
IR remote - Arduino and VS1838
~PART 2 - Arduino schematic

Now the receiver will give a modulated signal each time it receives a IR light from the emmiter. To read and decode the signal, we attach the VS1838 signal to digital pin D3 of an Arduino as seen below.

Now, the signal can be decoded with the Arduino. But the signal si strange and will eb different for each type of remote. Below we have an example of the signal from the colors remote when the "ON" button is pressed. As you can see, the signal has different frequencies and we can't know which is a "1" and which a "0".


For taht, we will use a library for Arduino that will decode the signal and give us a numeric value for each button. Donwload the library from a link below.

~PART 3 - The code

Now that you have the library downloaded in z .zip format, open Arduino IDE, go to sketch, include library, add .zip library and select the downloaded file. Now the library is installed. Copy or download the example code below and uplaod it to your Arduino with the IR schematic connected. This code should print on the serial monitor the received values from the IR remote.

Upload the code and open the Arduino serial monitor at a baud rate of 9600. Now press buttons on your IR remote and see the result on the serial monitor. You can have the decimal number printed or the type of remote.


Leave a comment

Please login in order to comment.

Comments

ADVERTISERS
ADVERTISERS
PCBWAY