Skip to content

Latest commit

 

History

History
87 lines (62 loc) · 2.85 KB

README.md

File metadata and controls

87 lines (62 loc) · 2.85 KB

Arduino IR repeater

Description

A simple solution to repeating any IR signals around walls. With a IR receiver to receive the signal and IR LEDS to send the signal.

Quick Code rundown

Code relies on the Arduino IRremote library for sending, receiving, encoding and decoding IR signals. The code can be broken down into three steps; Receive a IR signal, cleaning and remembering the signal and sending the signal. Base code is from the examples and changed to fit my needs of repeating any IR signal.

Receive IR signal

lines 76 - 82

if (irrecv.decode(&results)) {
  digitalWrite(STATUS_PIN, HIGH);
  storeCode(&results);
  irrecv.resume();
  digitalWrite(STATUS_PIN, LOW);
  delay(30);

Cleaning/remembering signal

// Stores the code for later playback
// Most of this code is just logging
void storeCode(decode_results *results) {
  codeType = results->decode_type;
    Serial.println("Received unknown code, saving as raw");
    codeLen = results->rawlen - 1;
    // To store raw codes:
    // Drop first value (gap)
    // Convert from ticks to microseconds
    // Tweak marks shorter, and spaces longer to cancel out IR receiver distortion
    for (int i = 1; i <= codeLen; i++) {
      if (i % 2) {
        // Mark
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK - MARK_EXCESS;
        Serial.print(" m");
      }
      else {
        // Space
        rawCodes[i - 1] = results->rawbuf[i]*USECPERTICK + MARK_EXCESS;
        Serial.print(" s");
      }
      Serial.print(rawCodes[i - 1], DEC);
    }
    Serial.println("");
}

Sending IR signal

digitalWrite(STATUS_PIN, HIGH);
sendCode(lastButtonState == buttonState); // relay signal to ir lights
digitalWrite(STATUS_PIN, LOW);
delay(30); // Wait between retransmissions

Parts / wiring

Im no expert in circuitry

You could use this wiring diagram .

Hypothetically all parts except for the Arduino IR repeater can be found in a broken tv and remote. The IR receiver is found along the bottom of the tv and IR LED can be found in the tip of the remote controller.

Quick code setup

  1. Setup Arduinohere.

  2. Download the zip Arduino RemoteIR library here.

  3. Adding the zipped library to Arduino text editor here .

  4. git clone (download) this repository https://github.com/MitchTODO/Arduino-IR-repeater.git .

  5. Open irRepeater.ino from Arduino text editor make changes if needed and upload to arduino.

  6. Test with phone camera (IR is outside the visual light spectrum) and Serial Monitor within the Arduino text editor under tools.