Send signals to TSOP1736 IR SENSOR

Greetings the whole community, My name is Nataly Lopez , I'm completely new to the topic of Arduino. i bought an Arduino Uno R3 and I find it very interesting. I have already successfully connected the board to the pc and have tried some simple projects, such as counters 0-9 using 7-segment display, LED. etc

The thing is, before buying this fabulous board. I had built on a breadboard, a receiver IR using TSOP1736 IR receiver module, a BC558 transistor, a capacitor of 470 uF, a resistance of 68 ? and a common LED based in this guide:

I built the receiver and works perfectly and is highly accurate.
To test it I used the remote control of my TV, a LG PLASMA. When I press any button on the control module captures their signals and the LED lights turn on and simply love it.

However, considering the possibilities of Arduino and your experience as experts in this field, humbly i ask for some help to create a simple program that allows me to use arduino for send signals in RC5 code or any other code compatible, as my TV control-
So that the sensor can capture.

I tried to use integrated circuits as the 555 timer, to try to achieve 36kHz frequency emissions but without any success.

Thanks for reading my post and sorry for my bad english

Nataly :slight_smile:

I found a code that allows you to use Arduino as IR signal transmitter

/* Control a Lutron Maestro light dimmer */
#define BIT_IS_SET(i, bits)  (1 << i & bits)

// LED connected to digital pin 13
const int LED_PIN = 13;
// Width of a pulse, in microseconds
const int PULSE_WIDTH = 2300;
// # of bytes per command
const int COMMAND_LENGTH = 4;    

const int UP[]     = {255, 136, 130, 34};
const int DOWN[]   = {255, 136, 130, 20};
const int ON[]     = {255, 136, 132, 184};
const int OFF[]    = {255, 136, 189, 18};
const int RECALL[] = {255, 136, 132, 183};

void setup()
{
  pinMode(LED_PIN, OUTPUT);
}

/* Modulate pin at 39 kHz for give number of microseconds */
void on(int pin, int time) {
  static const int period = 25;
  // found wait_time by measuring with oscilloscope
  static const int wait_time = 9;  

  for (time = time/period; time > 0; time--) {
    digitalWrite(pin, HIGH);
    delayMicroseconds(wait_time);
    digitalWrite(pin, LOW);
    delayMicroseconds(wait_time);
  }
}

/* Leave pin off for time (given in microseconds) */
void off(int pin, int time) {
  digitalWrite(pin, LOW);
  delayMicroseconds(time);
}

/* Send a byte over the IR LED */
void send_byte(int bits) {
  for (int i = 7; i >= 0; i--)
  {
    if (BIT_IS_SET(i, bits)) {
      on(LED_PIN, PULSE_WIDTH);
    } else {
      off(LED_PIN, PULSE_WIDTH);
    }
  }
}

/* Send a full command */
void command(const int bytes[]) {
  for (int i = 0; i < COMMAND_LENGTH; i++) {
    send_byte(bytes[i]);
  }
  off(LED_PIN, 4 * PULSE_WIDTH);
}

void loop()
{
  command(UP);
  delay(1000);
  command(DOWN);
  delay(1000);
}

Simply connect an IR LED to digital pin 13 and GND. Software is loaded to the Arduino and it works!
For all I know this code controls a device from company Dimmer Lutron Maestro and the most important configuration is based on this specific part:

[255, 136, 130, 34] fade up
[255, 136, 130, 20] fade down
[255, 136, 132, 184] full on
[255, 136, 189, 18] full off
[255, 136, 132, 183] memory recall

I think is the Achilles heel. for program the code and make it compatible with other electronic devices that use IR sensors.

I know with an oscilloscope would be possible to read the frequencies emitted by remote controls, but they are very expensive and I have not one, so for now I will be playing some reading about xoscillo and understand its operation.

Nataly...

A library with everything you need.