Cannot Get IR Transmitter to Work Properly

Hey Guys -

I’m trying to set up a NodeMCU which includes an IR Transmitter & Receiver, but having some difficulty. I got the receiver working just fine as hitting a button on my fan IR remote yielded the below log:

[13:46:57][D][remote.jvc:048]: Received JVC: data=0x0CF3
[13:46:57][D][remote.lg:053]: Received LG: data=0x0CF331CE, nbits=32
[13:46:57][D][remote.nec:068]: Received NEC: address=0x0CF3, command=0x31CE
[13:46:57][D][remote.pioneer:144]: Received Pioneer: rc_code_X=0x0C8C

When putting the below info into the yaml, uploading it, and triggering it via dashboard button; nothing happens, though.

remote_transmitter:
  pin: D0
  # Infrared remotes use a 50% carrier signal
  carrier_duty_percent: 50%

switch:
  - platform: template
name: Tower Fan - Power
turn_on_action:
  - remote_transmitter.transmit_nec:
  address: 0x0CF3
  command: 0x31CE
  - platform: template
name: Tower Fan - Power2
turn_on_action:
  - remote_transmitter.transmit_jvc:
  data: 0x0CF3

As you can see, I tried both the NEC & JVC codes assigned to different templates for testing, but neither worked.

I also tried facing the IR transmitter & Receiver to each other, then triggering. Logging yielded the below in the log when I actually expected to see what was logged with the initial capture from the remote…

[13:51:39][D][remote_transmitter:066]: Sending remote code...
[13:51:39][D][remote.raw:041]: Received Raw: 229

Shouldn’t the above match the output the receiver displays when original remote is read?

Hardware wise, I have a 100ohm resistor between the IR LED’s anode and of course ground going to ground of the NodeMCU. Although I I couldn’t see the IR LED with my phone camera (even briefly) when triggered, I can see it when I connect the resistor to 5V. To ensure that something was coming across D0, I replaced the IR LED with a standard blue one which did briefly light when triggered. Aside from this, I’ve tried a couple different resistors, powering the NodeMCU via 5V battery instead of USB, + verified its not a range issue.

The IR LEDs are rated 1-1.5V and are linked here.

I’m at a loss. Any suggestions? Thanks!

Finally resolved it - Didn’t have a transistor introduced. Now just need larger range :slight_smile: Thanks

1 Like

Greetings,

I thought rather than opening a new item it might be better to post here because this post is similar to my issue. I followed this circuit diagram…

And managed to get everything working. BUT… the LED is really dim and can barely be seen. Not a guru on circuits, so was wondering if there was some approach I could take to make the LED brighter?

Appreciate any advice. Even happy to change circuits or electronics.

Hi, I just did the same setup with one of my ESP8266.
In the end, I used 2 IR LEDs in series with no resistor and a 150-ohm resistor for the base of my 2N2222.
I made a junction block to feed the ESP (connecting to VIN and GND) and LEDs with 5 volt directly.
My range is now sufficient (the longest I tested was 5-6 meters) and quite bright, it’s now located so it bounces on a wall to reach my AC unit.
My LEDs are Lite-On LTE-5208A they should handle 2 amp peak and 1.6 volt.
I guess the lifespan of the LEDs is going to be shortened but we’ll see since it such a short puls.

Hi Richard,

Great to hear from you. Wow, the Lite-On LED is a serious unit, mostly used for DVD/CD drives I believe. What prompted you to use that?

I ended up removing all the resistors and running on 3.3v from the ESP8266 and the brightness has improved moderately.

I dont have far to transmit, so now I need to figure out what codes to send for my Daikin AC unit? And how to program the YAML code for ESPHome? I’ve read there are raw codes and perhaps other codes, so more learning to do.

Once I have worked out the codes and YAML I will give it a test to see if it works. Not sure where you are with codes or YAML, but if you have any advice that would be great.

Thanks, Mark

Range of course!
The output from the GPIO, 3.3v and the 5v ain’t powerful enough if you need range.
I just used the code from IR Remote Climate for my AC and it comes up as a thermostat. Daikin is supported too.