I have built a simple prototype for a circuit attached to a Wemos D1MINI for a DIY thermostat application. I've confirmed that it works (I can turn it on and off from my software), when I hold the breadboard (and thus the LED) very close to my a/c (less than 1 m) but any further and it fails to register.
Unfortunately I'm very new to this but will try to describe my situation as best I can.
The IR led being used is this, I have had no luck finding a datasheet https://www.amazon.co.jp/-/en/gp/product/B07W4JP1YR/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1.
Could a different wavelength LED result in a significantly different range? Or do I just need to fashion up some kind of reflector box? As is it's extremely sensitive to direction. Is this all a problem with the LEDs I have or is there something else I can improve? The radiation distance was supposed to be 7 m but I'm getting a meter at best. I'm not really sure what I should be considering when selecting an LED for this application
The other components are an S8050 NPN resistor with the base connected(via 10 kohm resistor) to the D1MINI D2 pin and the collector going to the LED (and 220 ohm resistor which I've added back since taking the photo), the DHT11 in the photo is working fine and not really relevant to the question. Everything is powered(temporarily) off a 9 V battery through a HW-131 power supply set to 5 V.
I have also recreated the circuit without the d1mini, just the npn, resistors and led and I'm getting 1.26v and 22mA over the LED, which should be the correct amounts.
lolin sells an IR shield(which I wanted to avoid using due to size) for the d1mini, which includes https://www.onsemi.com/pdf/datasheet/bss138-d.pdf . This advertises itself as minimizing on-state resistance. A comment has mentioned how the large resistor could cause lag. Would it be reasonable that this lag would be made worse by distance, thus something like this could fix it?
By combining several suggestions from comments this now works.
- The transistor base resistor was reduced to 1Kohm and had a 1K pull-down resistor added to ground.
- The LED resistor was removed entirely, resulting in a higher voltage passing through. This however isn't damaging since the IR signal is very short and is also pulsed at a 50% load.
I still don't entirely understand why this works but I presume it's a combination of higher voltage-> stronger signal and the pulldown resistor cutting it off faster, is this reasonable? Are there any resources I can review to better understand this?