I'm trying to get my raspeberry pi to control a floor fan via IR. I'm stuck on getting the IR codes to be emitted through the IR LED. I'm not able to get the IR LED to turn on at all. I'm checking that it's burning by using an app on my phone. (I've verified the app is working by testing it with the fan's remote, I can see the remote's ir bulb going off when pressing the button)

I've setup my breadboard to turn on a normal LED which works but when I swap the LED with an IR LED I don't get anything. Below is the setup for the normal LED. I've tried 100 - 1kohm resistors, but no luck. I've swapped out the IR LED for others, I've checked and double checked the direction of the IR LED (and tried it both ways to be sure). I've gone through many tutorials with no luck.

It seems like this should be really easy which makes me think I'm missing something pretty simple. This is my first project with a raspberry pi and working with circuits. Any help would be very much appreciated.

enter image description here

  • 1
    Is any chance you know the model of your IR diode? May we see the picture? Be aware of the fact that the GPIO limit on RPi3 is 16mA (0.016A) and may be insufficient for some IR diodes. Have you tried to check it with any continuity tester?
    – smajli
    Commented Apr 23, 2020 at 20:28
  • Hi @Kywillis, welcome and nice to meet you. Ah, let me see. (1) Our stupid human eyes cannot see IR light. Perhaps you can use a digital camera to try your luck, (2) Nowadays, almost everybody is using TSAL6200. You might to read my answer to know more details: "TSAL6200 940nM High Power IR Emitter Diode (If = 1A max at 3V) (See Section 5) ": raspberrypi.stackexchange.com/questions/103452/….
    – tlfong01
    Commented Apr 24, 2020 at 1:38
  • (3) As you can see from the IR emitter diode, the max forward current is roughly 1A, so need to use perhaps a NPN BJT such as 2N2222 to help, or you might fry your Rpi, (4) Almost always, you must use a series current limiting resistor, say 220Ω to play safe. (5) The popular NEC IR protocol is a bit complicated. You need to use the LIRC driver to make your job easier. LIRC documentation is not not for newbies. (6) For newbies, I would recommend to start off experimenting with a pair of cheapy IR transceivers. Again see my answer above.
    – tlfong01
    Commented Apr 24, 2020 at 1:44
  • 1
    I 'm definitely going slowly, no worries there. I've gone through the steps of installing and trying to record my remote using LIRC. I got the recording to work with a simple remote (I had dots showing up as I held down a button). With the remote to the fan there was only a single dot. I gave up on LIRC and moved onto pigpio. I was able to record my remote with that.
    – Kywillis
    Commented Apr 24, 2020 at 13:35
  • 1
    this is a link to the IR LEDs I'm trying to use: amazon.com/gp/product/B00M1PN5TK/…
    – Kywillis
    Commented Apr 24, 2020 at 13:39

2 Answers 2


Check the specs for your IR LED.

Mine needs far more than the 20 mA or so available from a Pi GPIO to illuminate.


You could help yourself a huge amount in the future by NOT buying electronic components from Amazon (or anyone else) that does not supply a spec sheet for the parts they sell. There are many vendors that specialize in electronic components, and sell them at reasonable prices. As an added incentive, you'll also find that the more reputable vendors also deal in reputable parts from reputable manufacturers - instead of no-names that sell electronics and shoelaces out of the same dump. I hope I've made my point clear :)

All of that said, the laws of physics suggest that there won't be huge differences between 5mm 940nm (IR) LEDs, regardless of who makes them. And if you consulted a reputable vendor of electronic components, you could find a list similar to this one, and a spec sheet like this one. The spec sheet for this 5mm 940nm IR LED indicates that you will need to source or sink about 100mA of current to drive this part properly.

As @joan has stated, you won't get 100 mA from a GPIO pin on the Raspberry Pi. Instead, you will need to use the GPIO output to drive a switch capable of handling the voltage and current this LED requires. This is a frequently-asked-question here, and here's one answer that's fairly close.

Please review this answer. If you have further questions, I would suggest that you edit your question to add a proper schematic instead of photos of wires and parts; the photos simply don't communicate enough information to allow us to help you much.

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.