Author Topic: Extending range of DIY IR remote control  (Read 1561 times)

0 Members and 1 Guest are viewing this topic.

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Extending range of DIY IR remote control
« on: October 23, 2022, 11:17:14 pm »
A while back I built an Arduino-based IR remote to control my Roku puck and my TV so as to automate all the scrolling needed for Sling TV on Roku to get to the right channel.  I don't use Sling or Roku anymore, but I thought I might use the remote so I can contol my Cox Mini Box and the same TV from my office, which is about 40 feet away.  I want to be able to at least mute the audio during the prescription drug and Camp Lejeune commercials.  And I might want to mute the audio for two minutes, then turn it back on automatically.  And maybe other interesting things would come to mind that go beyond simple remote functions.

The remote uses a 3.3V 8MHz Arduino Pro Mini with it's regulator and power LED indicator removed.  So it runs directly off an 18650.  The IRLED is powered in paralled through a darlington transistor.  The circuit is shown below.

The battery was at 3.98V during tests with my scope which gave the following voltage drops during the "on" time of the IRLED:

.08V  -  Battery under load
1.6V  -  10.3R current limit resistor
1.5V  -  IRLED (unknown type - scavenged from old TV remote)
0.8V  -  MPSA13 darlington transistor

Based on the drop across the resistor, it looks like I'm running about 155mA through the IRLED.

I would really like to get rid of the drop across the darlington, and as luck would have it, I have in my junque box a genuine 2N2222A NPN in a metal can (TO-18 I think).  I need to test its gain, but if it's 100 or so, it seems the ATmega328P should be able to drive it at close to 500mA.  Of course this would be at 38KHz, with whatever duty cycle the old IRremote.h library gives me.

But even if I don't increase the current, if I get rid of the darlington drop, I think I can place another IRLED in series with the existing one, and double the IR transmit power for free (the only free lunch I know of in electronics).  I think it might be good not to increase the current since I'm already inducing 80mV of ripple in the power supply as it is.

The board is already soldered, so it wouldn't be easy to make changes to test things.  So I wanted to see if anyone has thoughts about what I have in mind, particularly if there's a better way that I haven't thought of.

OT Note - My scope is somewhat less powerful than Dave's recommended $800 4-channel scope.  I paid $20 for it in kit form, plus another $10 to make it battery powered.  But since it's battery powered and therefore not referenced to anything, I can take readings directly across items in the circuit without having to worry about where ground is.  And - I still have the $770.
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3249
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #1 on: October 24, 2022, 02:32:05 am »
You might want to take a look at the design of the Adafruit "TV-B-Gone":

product page: https://www.adafruit.com/product/73
schematics/cad files: https://learn.adafruit.com/tv-b-gone-kit/download
design notes: https://learn.adafruit.com/tv-b-gone-kit/design-notes

It uses an Attiny85, runs off of batteries and claims an operating distance of "150 ft or more".

Coincidentally, just two weeks ago Lady Ada talked about the LED used in the TV-B-Gone in her regular youtube streamcast. She went through the datasheet pointing out the reasons why she chose this part and then showed how to find a suitable SMD version on Digikey.

https://youtu.be/oykXJkb9RwM?t=14m16s

The LED segment begins at 14:16 in the video.

« Last Edit: October 24, 2022, 02:34:37 am by ledtester »
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12577
  • Country: ch
Re: Extending range of DIY IR remote control
« Reply #2 on: October 24, 2022, 07:15:26 am »
The battery was at 3.98V during tests with my scope which gave the following voltage drops during the "on" time of the IRLED:

.08V  -  Battery under load
1.6V  -  10.3R current limit resistor
1.5V  -  IRLED (unknown type - scavenged from old TV remote)
0.8V  -  MPSA13 darlington transistor

Based on the drop across the resistor, it looks like I'm running about 155mA through the IRLED.
There’s your problem right there. IR remote LEDs are designed to be pulsed at very high currents, so at 155mA you’re severely under-driving it. If you look at datasheets for IR transmitter LEDs, they’re specced for being pulsed at 1-1.5A. No, that’s not a typo.
 
The following users thanked this post: SeanB

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14749
  • Country: de
Re: Extending range of DIY IR remote control
« Reply #3 on: October 24, 2022, 10:01:50 am »
The IR LED come with different lenses.  Having a narrower beam can help a lot , but it needs some aiming.
The current can be higher, especially if the pulses are short/ the on/off ration is low. At a given current the 38 kHz modulation get the most signal with 50% PWM ratio, but the last part only help marginally. So a smaller PWM ratio (like 20%) and slightly more current will be more effective. For the supply, one could add additional capacitors.
If needed one could also consider 2 IR LEDs in parallel to reduce the voltage drop at the LEDs. So not just 2 in sereis, but more like 2S2P.
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12577
  • Country: ch
Re: Extending range of DIY IR remote control
« Reply #4 on: October 24, 2022, 10:22:22 am »
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16362
  • Country: za
Re: Extending range of DIY IR remote control
« Reply #5 on: October 24, 2022, 10:42:39 am »
Yes, replace the 10R resistor with a 1R one, and up C1 to 2200uF 16V. Arduino power pin put the 10R and 220uF resistor, with the resistor before the capacitor to decouple the supply.  Add more IR LED's in parallel with the existing 1R resistor and LED, which will give you a lot more power output from them. That will, with the existing darlington, allow you to pulse each LED at around 1A. If you want to improve things use a small power mosfet with 3V3 operation rating, SQD40N06-14L being the first one I saw, and making R2 to drive it 47R. Capacitance of the gate is not great at 2n, but it should at least work better than the darlington there. Probably cheaper as well, and easy enough to fit on the existing footprint as well. Otherwise IRLL024N will have lower capacitance, and will work as well, though it is a tiny part, it will survive.
 
The following users thanked this post: tooki

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #6 on: October 24, 2022, 03:27:41 pm »
Thanks very much for the replies.  I need to go over your comments and see what might work.  I didn't see any reaction to using the 2N2222A.  Is that because at high current the saturation voltage will be almost as bad as the darlington?  I was really hoping to use two LEDs in series, but don't have much battery voltage to work with, so any drop across the switching device makes a difference.

I find that I have some BS170 mosfets, which are essentially the same as the 2N7000.  I don't think they will work unless I keep the current pretty low - something under 400mA.  And the RDSon is very high.  But with two LEDs in series, it might work.

But it's odd looking at the Adafruit circuit.  She has the GPIO pin driving a PNP which in turn drives four 2N3904's.  But there isn't a resistor in sight in the base drives of the NPNs, or even in the LED paths.  That's a little scary.  The explanation they give is that the power supply will sag enough to make it all work.  Is this a school-approved solution?  :-)

Well, first I need to test the parts I have on hand, under load, and see what the voltage drop is.  Also, I find that I have a TSAL6200 LED, which is similar to the IR333-A Adafruit uses.
 
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14749
  • Country: de
Re: Extending range of DIY IR remote control
« Reply #7 on: October 24, 2022, 04:54:27 pm »
The 2N2222 may be a bit weak to drive a high current. I would more like go for a BD139 / BC639 (same chip, just different case) or a little larger (e.g. 3 A types) maybe even a D44H . I know it is not the best way to stabilize the current, but one could use the limited base current instead of the 10 ohm resistor in series to the LED.
The 2N7000/BS170 are too small for a peak current of some 1A.
 

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #8 on: October 24, 2022, 11:24:34 pm »
I found in my stash an AOSS32136C mosfet.  It's an SO-23 part, but I have the little adapter boards to make it through hole, so it would be an easy replacement for the darlington.  It looks like it should work fine, except that I've never understood the gate charge/capacitance values in these mosfet datasheets, so I'm not sure the ATmega328P can drive it at 38KHz.  But I can test it along with the 2N2222A and BS170.  I've written a little sketch for the Pro Mini to turn on a GPIO pin for 8us, then off for 18us, then on again for 8us.  That should let me test these parts under actual operating conditions, and see what voltage drops I get at various currents.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14749
  • Country: de
Re: Extending range of DIY IR remote control
« Reply #9 on: October 25, 2022, 10:00:46 am »
The MOSFET is already quite large, but still acceptable.  A gate charge of 7 nC and 10 mA drive current would be 700 ns, which should be still fast enough. With only 5 V drain voltage the gate charge would be somewhat smaller than the specs that are for 10 V. For fast switching there should be only a little gate resistance, like 50 ohms.
 

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #10 on: October 27, 2022, 05:07:46 am »
I tested the 2N2222A NPN transistor with a current limiting resistor of 1 ohm, and a base resistor of 220 ohms.  Vcc was 4V. And I used the TSAL6200 IR LED.

The voltage drop across the 1 ohm was .5V, so current was 500mA.  The drop across the LED was 1.7V, and the C/E drop was 1.8V.  I suspect that's not materially better than the darlington would produce at the same current.  And the transistor isn't even in full saturation.  The datasheet says I could get the C/E drop down to 1V at 500mA with a gate current of 50mA, which the 328P can't really supply in PWM.

I guess this would work if increasing the current from 155mA to 500mA would be enough to get the extra distance, but I would at least like to have the option of inserting a second LED in series, which I can't do with the NPN.  And I don't like the dissipation in the NPN with the 1.8V drop.

I'll try to test the mosfet tomorrow.
 

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1609
  • Country: ca
Re: Extending range of DIY IR remote control
« Reply #11 on: October 28, 2022, 02:18:52 am »
Wow I had idea it was so high. I have a few salvaged IR components from TVs. I'll try and remember that, otherwise I'll probably think the parts are already damaged.
 

Offline EPAIII

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #12 on: October 28, 2022, 07:05:53 am »
Paul A.  -   SE Texas
And if you look REAL close at an analog signal,
You will find that it has discrete steps.
 

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #13 on: October 29, 2022, 02:20:07 am »
I tried the AOSS32136C mosfet today, and it worked perfectly.  The saturation voltage is essentially zero up to about 500mA, and gets up to about 100mV at 1A.  At 500mA I think I could use two LEDs in series although the current would vary a good bit with battery voltage since there would be so little headroom.

The gate resistor was 470 ohms, which even at 1A produced a near perfect D/S waveform.  In fact, the 2.2K I used with the Darlingon did almost as well.  But a very low value resistor, such as 47 ohms, or even 100 ohms, resulted in a big D/S spike of several volts when the GPIO was brought low - well above the battery voltage.  I don't quite know what would cause that.

I didn't test the BS170, but I suspect it would work at low current.

So the mosfet is clearly the more perfect switch.  And the Arduino is quite capable of driving it at these current levels and frequencies.
 

Online PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2141
  • Country: us
Re: Extending range of DIY IR remote control
« Reply #14 on: October 30, 2022, 10:27:12 pm »
I finished modifying the remote using the original IR LED, about which I know nothing, the mosfet with gate diven through a 470 ohm resistor, and current limiting resistors yielding 5 ohms.  And I changed the big capacitor to 1000uF, 6.3V.  The current is just under 500mA, and it works fine from my office, which is what I needed.  The only thing I did that's a bit sketchy is to use two 1/4 watt 10 ohm resistors in parallel to get the 5 ohms.  The voltage across them is about 2.3V, so they dissipate about a watt.  But it's 38K with a 30% duty cycle, and it only sends one command at a time - the Mute button code - so I think the resistors will work ok.

I programmed the Pro Mini so if I hit the "*" button the remote will simply transmit the Mute code and go back to sleep.  If I hit the "#" button, it will toggle the On/Off code, and go back to sleep.  But if I hit a number key, or multiple number keys, constituting a numerical value, it will send the Mute code, wait for a number of minutes equal to the entered numerical value, then send the Mute code again, then go back to sleep.  In all cases there is a three-second delay before sending the code so I have time to return the remote to its cradle, which has it pointing directly to the TV.

Since the voltage across the resistors is 2.3V, there's room to add a second IR LED in series, and double the transmit power, if I ever need that - well, as long as the battery is pretty fully charged at least.  But it works well enough for now.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf