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.
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.
lines 76 - 82
if (irrecv.decode(&results)) {
digitalWrite(STATUS_PIN, HIGH);
storeCode(&results);
irrecv.resume();
digitalWrite(STATUS_PIN, LOW);
delay(30);
// 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("");
}
digitalWrite(STATUS_PIN, HIGH);
sendCode(lastButtonState == buttonState); // relay signal to ir lights
digitalWrite(STATUS_PIN, LOW);
delay(30); // Wait between retransmissions
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.
-
Setup Arduinohere.
-
Download the zip Arduino RemoteIR library here.
-
Adding the zipped library to Arduino text editor here .
-
git clone (download) this repository https://github.com/MitchTODO/Arduino-IR-repeater.git .
-
Open irRepeater.ino from Arduino text editor make changes if needed and upload to arduino.
-
Test with phone camera (IR is outside the visual light spectrum) and Serial Monitor within the Arduino text editor under tools.