IR emit raw codes

Updated on 31 August 2021
dev board Arduino UNO
sensor infrared
features infrared IR emit raw
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Pre-requisites

Try these simpler or similar examples:

Buy the components

Code

Download code ir-raw-emit.ino
#include <IRLibSendBase.h>
#include <IRLib_HashRaw.h>
#include "./data.h"

IRsendRaw mySender;

void setup() {
  Serial.begin(9600);
}

void loop() {
  delay(5000);
  Serial.println("Sending ON");
  mySender.send(rawDataON, RAW_DATA_LEN, 38);
  Serial.println("Sent Turn ON Aircon");

  delay(5000);
  Serial.println("Sending OFF");
  mySender.send(rawDataOFF, RAW_DATA_LEN, 38);
  Serial.println("Sent Turn OFF Aircon");
}

Makefile

BOARD?=arduino:avr:uno
PORT?=/dev/cu.usbmodem14*

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) ./

flash:
	arduino-cli upload -p $(PORT) --fqbn $(BOARD)

clean:
	rm -r build

Prototype

A photo of the actual setup.

IR emit raw codes prototype

Schematic

Wire up the hardware accordingly

IR emit raw codes schematic

Description

This code takes in a raw dump of IR and emits it. This is useful when IR protocols are not defined for example, Mitsubishi Air conditioner model MSY-GE10VA. The file data.h has the list of raw dumps.

References