Controlling home appliances with an IR remote is a convenient and easy way to automate your home. With the use of an Arduino IR receiver system, you can control your devices from anywhere in the room. In this article, we will show you how to build an Arduino IR receiver system with an IR remote in a step-by-step guide.
Step 1: Gather the Materials
To build your Arduino IR receiver system, you will need the following materials:
QUARTAZ COMPONENTS LINKS :
Arduino board (UNO or Nano) : BUYNOW
IR receiver module : BUYNOW
IR remote control : BUYNOW
Breadboard : BUYNOW
Jumper wires : BUYNOW
AMAZON LINKS :
Arduino board (UNO or Nano) : BUYNOW
IR receiver module : BUYNOW
IR remote control : BUYNOW
Breadboard : BUYNOW
Jumper wires : BUYNOW
Step 2: Connect the IR Receiver Module to the Arduino Board
The first step is to connect the IR receiver module to the Arduino board. Insert the module into the breadboard and connect the VCC pin to the 5V pin on the Arduino board, GND to the GND pin, and the signal pin to any of the digital pins (in this example, we will use pin 2).
circuit for IR receiver with Arduino:
Step 3: Install the IRremote Library
The next step is to install the IRremote library to your Arduino IDE. To do this, open the IDE, click on the Sketch menu, then click on Include Library, and then click on Manage Libraries. Type "IRremote" in the search box and click Install.
Step 4: Program the Arduino Board
Once you have installed the IRremote library, it's time to program the Arduino board. Open a new sketch in the Arduino IDE and copy and paste the following co
IR receiver with Arduino code :
#include <IRremote.h>
// Define sensor pin
const int RECV_PIN = 2;
// Define IR Receiver and Results Objects
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup(){
// Serial Monitor @ 9600 baud
Serial.begin(9600);
// Enable the IR Receiver
irrecv.enableIRIn();
}
void loop(){
if (irrecv.decode(&results)){
// Print Code in HEX
Serial.println(results.value, HEX);
irrecv.resume();
}
}
This code reads the IR signal received by the IR receiver module and prints the signal in hexadecimal format to the serial monitor.
Step 5: Upload the Code to the Arduino Board
Once you have finished writing the code, upload it to the Arduino board by clicking the "Upload" button in the Arduino IDE software. Wait for the upload to finish, and then disconnect the USB cable.
Step 6: Test the System
Now it's time to test the system. Point the IR remote control at the IR receiver module and press any button. The signal received by the module should be printed to the serial monitor in hexadecimal format. If this works, you have successfully created an Arduino IR receiver system with an IR remote.
0 Comments