Your receiver looks like one of those 3 pin receiver chips (because you draw 3 wires coming out of it). Is my guess right?
If so, then the IR Repeater output would be 38KHz (or 36 kHz or 40kHz - guessing again) for a mark and nothing for a space. 3 pin receiver output however would be low for a mark and high for a space, with no modulation.
All guesswork though until you tell me all about the component you list as "IR Receiver"
If my guesses are right, then the second circuit will never work correctly, as you are feeding a signal that is modulated with (say) 38kHz into a device that expects un-modulated signal
Check out this site to see what I am talking about:
http://www.sbprojects.com/knowledge/ir/index.php
Can't see any obvious problem with your inverter circuit, except that using Vs as common connection is unusal (I assume Vs is +5V?). I would have had a common ground to connect to "equipment"
EDIT: can you provide information about the repeater, about the equipment and about the sending device? The information so far is very sketchy.
Hexreader. Thanks you for your advice. Your guess is right. The receiver chip is 3pins and the repeater output is 38K.
About the repeater, it was built on Arduino and an IR library provided by Ken Shirriff:
http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
The whole purpose of building the repeater is to overcome a limitation of my existing IR repeater (I bought it from Taobao). I want to use the IR repeater to control the AV equipment (located in sitting room) from my bed room. However I'm having two identical LCD TV in sitting room and bed room. So everytime I turn on TV in my bed room, the same IR signal repeated to sitting room. This makes the TV in sitting turned on unwantedly. Therefore I got an idea to add an additional IR repeater, which would only repeat some pre-defined IR signal. Those from the TV will be ignored and would not be repeated to the sitting room. This special IR repeater built on Arduino does works if it transmits thru IR LED. However, to avoid laying the cable again, I want to build on my existing IR repeater. That's why I try to feed the IR signal into the pins of IR receiver (i.e. receiver B). This is the whole story.
Here is the my Arduino sketch. I have just learnt Arduino for few weeks.
**broken link removed**
In fact I've tried inverting the output within my "special IR repeater" but I failed because I don't even understand all those Timer and PWM statement in Ken Shirriff's library. I've exacted those relevant part and see if you or someone could help:
IRremoteint.h
...
...
// defines for timer1 (16 bits)
#elif defined(IR_USE_TIMER1)
#define TIMER_RESET
#define TIMER_ENABLE_PWM (TCCR1A |= _BV(COM1A1))
#define TIMER_DISABLE_PWM (TCCR1A &= ~(_BV(COM1A1)))
#define TIMER_ENABLE_INTR (TIMSK1 = _BV(OCIE1A))
#define TIMER_DISABLE_INTR (TIMSK1 = 0)
#define TIMER_INTR_NAME TIMER1_COMPA_vect
#define TIMER_CONFIG_KHZ(val) ({ \
const uint16_t pwmval = SYSCLOCK / 2000 / (val); \
TCCR1A = _BV(WGM11); \
TCCR1B = _BV(WGM13) | _BV(CS10); \
ICR1 = pwmval; \
OCR1A = pwmval / 3; \
})
#define TIMER_CONFIG_NORMAL() ({ \
TCCR1A = 0; \
TCCR1B = _BV(WGM12) | _BV(CS10); \
OCR1A = SYSCLOCK * USECPERTICK / 1000000; \
TCNT1 = 0; \
})
IRremote.cpp
...
...
void IRsend::sendNEC(unsigned long data, int nbits)
{
enableIROut(38);
mark(NEC_HDR_MARK);
space(NEC_HDR_SPACE);
for (int i = 0; i < nbits; i++) {
if (data & TOPBIT) {
mark(NEC_BIT_MARK);
space(NEC_ONE_SPACE);
}
else {
mark(NEC_BIT_MARK);
space(NEC_ZERO_SPACE);
}
data <<= 1;
}
mark(NEC_BIT_MARK);
space(0);
}
void IRsend::enableIROut(int khz) {
// Enables IR output. The khz value controls the modulation frequency in kilohertz.
// The IR output will be on pin 3 (OC2B).
// This routine is designed for 36-40KHz; if you use it for other values, it's up to you
// to make sure it gives reasonable results. (Watch out for overflow / underflow / rounding.)
// TIMER2 is used in phase-correct PWM mode, with OCR2A controlling the frequency and OCR2B
// controlling the duty cycle.
// There is no prescaling, so the output frequency is 16MHz / (2 * OCR2A)
// To turn the output on and off, we leave the PWM running, but connect and disconnect the output pin.
// A few hours staring at the ATmega documentation and this will all make sense.
// See my Secrets of Arduino PWM at
http://arcfn.com/2009/07/secrets-of-arduino-pwm.html for details.
// Disable the Timer2 Interrupt (which is used for receiving IR)
TIMER_DISABLE_INTR; //Timer2 Overflow Interrupt
pinMode(TIMER_PWM_PIN, OUTPUT);
digitalWrite(TIMER_PWM_PIN, LOW); // When not sending PWM, we want it low
// COM2A = 00: disconnect OC2A
// COM2B = 00: disconnect OC2B; to send signal set to 10: OC2B non-inverted
// WGM2 = 101: phase-correct PWM with OCRA as top
// CS2 = 000: no prescaling
// The top value for the timer. The modulation frequency will be SYSCLOCK / 2 / OCR2A.
TIMER_CONFIG_KHZ(khz);
}
void IRsend::mark(int time) {
// Sends an IR mark for the specified number of microseconds.
// The mark output is modulated at the PWM frequency.
TIMER_ENABLE_PWM; // Enable pin 3 PWM output
delayMicroseconds(time);
}
/* Leave pin off for time (given in microseconds) */
void IRsend::space(int time) {
// Sends an IR space for the specified number of microseconds.
// A space is no output, so the PWM output is disabled.
TIMER_DISABLE_PWM; // Disable pin 3 PWM output
delayMicroseconds(time);
}