IR: Receiving Works; Can't Transmit

I'm new to this, but I'm stumped on why my IR transmitter circuit won't work. I'm using a TSOP4856 receiver, and a TSAL6100 IR emitter/LED.

Also using a 2n4401 transistor to drive the transmitting part of the setup. The wiring I have looks like this:

The code I'm running uses the Infrared4Arduino library, and the code I'm using is looks like this:

It sends on pin3, using a 56kHz carrier, when I input something to the serial console.

The problem: I can receive data just fine, and the timings get written to serial output. I'm testing this using a remote control I have in my home.

However, when I send a signal using the circuit connected to my Arduino (as pictured) I get nothing. I can visually verify that the LED is firing, because I can see it light up when I view it in dim light with the camera from my mobile phone.

There's something fundamental I'm missing because it seems to attempt to send, but I can't get anything to register and get recorded using both my receiver and transmitter. Any tips would be appreciated.

This is just a test setup to build on - mostly just trying to get something to work at this point. Appreciate folks taking a look.

Take a look into the data sheet of the transmitting diode. Hint.. In what direction is most of the power sent out? Look for transmission angle.

Did you try other frequencies (38kHz)?

I'm guessing you mean that LED needs to be pointed more towards the receiver? That's why I used the smaller green board: so I can lift it and point it at the receiver. No matter the distance or orientation, I still don't get a signal at the receiver.

It's odd too because for my device remote that works, I don't hardly need to point it at the receiver at all. It seems to be very sensitive.

From what I understand, the TSOP4856 filters to 56k, so that's what I'm trying.

I just re-ran using 38, and still no data either (which maybe is expected, since the receiver is expecting 56?)

Good. You have got that right. Now to the powering of the transmitter.
I wish You post wiring showing the transmitter circuitry as well as how the project is powered. Transistor pins and designation, resistor values....

I'm not familiar with the IR library you are using, but can you send and receive at the same time?

To the untrained eye, it looks like you are sending out your IR sequence with:

sender->send(*irSequence, 56000U);

and then enabling the receiver with:

receiver->receive(); // combines enable, loop, disable

The comment suggests that receive mode is enabled on calling the receive() function, but by then the IR signal has disappeared into the ether?

1 Like

Yeah I wonder about this too. The code I'm using is a modified example of something from the library source that illustrates send/receive all at once:

If I move the receive() call to the beginning of loop() I still don't get recorded data. It's really odd. :frowning:

Railroader - here's what I have for transmitting:

The LED does seem to light up based on this circuit, so it's sending at least some light.

Many cell phone cameras are sensitive to IR light so can be used to confirm IR transmission.

Thanks. That circuit is okey. I assume the transistor has an Hfe of at least 27... and is capable of handling 5/36 = ca 140 mA.

You didn't tell how the project is powered......
If You use USB power it could work but if You use Vin You're in danger...

Correct - as I note in the original post, I can see the LED light up using my mobile. When I send something to the serial, I see the LED light up (there's a purple flash that I can see on the screen of my phone).

Hmm, could you possibly be reading too much into the initial comment in the file:

// This sketch combines sending and receiving.

The sketch may well be able to send and receive, but the key is whether it can do both at the same time.

Apologies - yep it's USB-B from my laptop, plugged into the arduino board.

Okey, powered by USB.

Eehh.... Does IR LEDs shine? Are You sure You've got an IR LED and not a conventional LED? No offence, just a desperate guess.

Definitely an IR LED, and it does indeed shine. I can see it with my phone.

Okey if the phone is the eye.

Looks like the system guys are closer to the solution, talking/listening at the same time....

Agreed. From my reading of the code, it should be enabled and ready to receive for 2s after receive() is called.

Actually, it looks like it has an embedded disable() call.

I rewrote my loop to call enable, isReady, and disable separately, and now I'm getting data. :slight_smile:

void loop() {

receiver->enable(); 

while(!receiver->isReady()) {
  if (Serial.read() != -1) {
      Serial.println(F("Sending a signal from PROGMEM!"));
    sender->send(*irSequence, 56000U);
  }
}

receiver->disable();

if (receiver->isEmpty()) {
  Serial.println(F("No data."));
} else {
  receiver->dump(Serial);
  Serial.println();
}
}

Thanks everyone for helping me make some progress.

The problem now is that the data looks nothing like the sequence I'm trying to send, but at least I'm registering something. :slight_smile:

Are you sure that irSequence addresses PROGMEM? I'd think that special instructions are required for reading from PROGMEM, like implemented in the F() macro. Or is your output misleading?