I am struggling with IR emitter circuit which should replace remote control for few devices. I designed some circuit and already made PCB which uses P-channel mosfets for 12V device control. As I am using additional gate driver it's quite fast. I would like to have possibility to connect IR emmiting circuit instead of one device so it will be working as remote controller. Unfortunatelly it's not working. However when I use the same code and connect IR diode with resistor directly to my microcotroller it works without issues however range is quite limited.

  • Code is the same.
  • Diode is also the same.
  • Osciloscope charts also looks very similar.


I would like to make this circuit works by changing only right part of it. The idea is to have possibility to use MOSFET switch for different purposes.

Not working circuit enter image description here

Working one enter image description here

I tried some pull down resistor to made this work but it didn't help. I would really appreciate any help.

  • \$\begingroup\$ please follow convention when drawing schematic diagrams ... V+ at top, GND at bottom, input on one side, output at other side ... R69 and D21 should be oriented vertically... same with Q24 and D20 ... what does J20 connect to? ... how do the two diagrams relate? \$\endgroup\$
    – jsotola
    Nov 19, 2023 at 6:42
  • 1
    \$\begingroup\$ I do not get the idea of your circuit or setup. Please show where the oscilloscope probe is connected and which variants of the circuit exist. \$\endgroup\$ Nov 19, 2023 at 10:34
  • \$\begingroup\$ The problem may involve connections to microcontroller (a more complete schematic might help us, showing exactly how the 12V supply is connected, as well as control wires to microcontroller). I see a +12V connection but am unsure how its other side is connected. I assume it is GND. This GND connection must also extend to microcontroller's GND. \$\endgroup\$
    – glen_geek
    Nov 19, 2023 at 13:36
  • \$\begingroup\$ Can you show how you actually wired up the complete circuit? The switching circuit has a connector with pins 1 & 2, though your LED circuit shows connections A, B, & C, are these connected? Your odd looking plot could possibly be from a power supply or grounding problem. Verify that you have all the ground points hooked together correctly. \$\endgroup\$
    – Nedd
    Nov 19, 2023 at 17:22

1 Answer 1


There's many reasons they don't work or work poorly.

You are transmitting out only the baseband of the IR signal, which looks like NEC protocol. More specifically, it looks like Extended NEC protocol based on the address bits of the data.

What is important is that the pulses should be modulated with a carrier wave.

In case of NEC protocol, the carrier is 38 kHz.

So instead of turning the LED simply on for 9ms for start or 560us for bit pulse, it needs to be driven with 38 kHz carrier wave.

The carrier wave is usually not even a 50% duty square wave, but maybe 33% or 25% to allow higher pulsed currents.

And based on the waveform how FET drives the LED, it is very slow to turn off, so the 10k pull-up cannot turn off the LED fast enough evem for the baseband signal.

So you need some software and hardware modifications anyway, to be able to output the 38 kHz carrier and be able to drive the LED with it.

  • \$\begingroup\$ Thank you for help. I've replaced 10K resistor with 470R and everything works like a charm. \$\endgroup\$
    – michalo
    Nov 20, 2023 at 14:09
  • \$\begingroup\$ If you don't send the 38 kHz carrier to LED, it likely does not work well. \$\endgroup\$
    – Justme
    Nov 20, 2023 at 14:19
  • \$\begingroup\$ I see 38kHz carrier signal seems to be implemented in library which I am using. So I guess I am sending it. That's library which I am using github.com/crankyoldgit/IRremoteESP8266/tree/master \$\endgroup\$
    – michalo
    Nov 20, 2023 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.