Arduino Uno IR Transceiver Control Code

OzIRTransceiver is capable to encode and transmit as well as receive and decode different type of remote controller signals. An infrared LED needs to be wired to the microcontroller to transmit signals. To receive signals you should wire an infrared receiver, for example the 1838B. The most widely used application of this device is to read signals from the most popular remote controller brands.

Required hardware

  • Arduino Uno
  • 1838B infrared IR receiver module
  • Infra Red LED
  • Resistor 100Ω

Before you upload this code to your Arduino, please format the EEPROM...

IR receiver source code to install on controller


#include <OzIDManager.h>
#include <OzIRTransceiver.h>

OzIDManager* manager;
OzIRTransceiver* IRTransceiver;

void setup(){
    Serial.begin(115200);

    manager = new OzIDManager;
    manager->_sendACK = true;
    manager->_checksum = true;

    OzCommunication::setIDManager(manager);

    IRTransceiver = new OzIRTransceiver(2, MODE::RECEIVE);

    int x = 1;
    manager->sendLinkSetup();
    manager->PrintWelcomeLine(IRTransceiver, x++, "MyIRReceiver");
}

void loop(){
    OzCommunication::communicate();
    IRTransceiver->ownLoop();
}

IR transmitter source code to install on controller


#include <OzIDManager.h>
#include <OzIRTransceiver.h>

OzIDManager* manager;
OzIRTransceiver* IRTransceiver;

void setup(){
    Serial.begin(115200);

    manager = new OzIDManager;
    manager->_sendACK = true;
    manager->_checksum = true;

    OzCommunication::setIDManager(manager);

	//Mega D9, Nano, Uno D3 pin
    IRTransceiver = new OzIRTransceiver(MODE::SEND);

    int x = 1;
    manager->sendLinkSetup();
    manager->PrintWelcomeLine(IRTransceiver, x++, "MyIRTransmitter");
}

void loop(){
    OzCommunication::communicate();
    IRTransceiver->ownLoop();
}

More information