Limited range using irout command

john_mills

New Member
Hi

I've been trying to create an infrared remote to control a tank. Both use a PICAXE 08M2. The problem is, the remote only has a very small range of about 20 cm when powered by a 5V battery. When I use the remote from my Sony TV the range is at least several metres.

I tried measuring the current that is produced when the irout command is run on pin c.0 and it is at most 1.5mA and not the 20mA that I excepted from using the high command on the same pin.

I believe the IR LED I am using can handle up to 100mA and I'd like to be running it at 80mA.

Why is the current produced by irout so low? How can I increase the current to the 20mA that is supported by the high command.

John
 

AllyCat

Senior Member
Hi John,

Welcome to the forum. Firstly, are you sure that your "5 volt battery" is really delivering 5 volts and can manage 80 mA? The current might be quite a lot less even with only a slightly reduced voltage. What value of series (current-limiting) resistor are you using?

I tried measuring the current that is produced when the irout command is run on pin c.0 and it is at most 1.5mA and not the 20mA that I excepted from using the high command on the same pin.
The IROUT signal is "modulated" (quickly switching on and off), so the average current that a meter will read can be much less than the peak current. What current do you measure after a High C.0 command? However, the PICaxe pins are much better at "sinking" current (pulling current down to the ground/negative terminal) than "sourcing" current (from the supply rail), there is no "guarantee" that it will deliver as much as 20 mA. BTW, don't try measuring a pin's "sink" current with an ammeter as you might damage the PICaxe.

The best solution is to use a NPN transistor (or maybe n-channel FET) to amplify the current. Also make sure you have a large electrolytic capacitor (at least 100 uF) across the supply/ground rails; that is probably what the Sony RC uses. There are also various compromises associated with the "lensing" and optical filtering of the transmitter (IR LED) and receiver ;)

Cheers, Alan.
 

erco

Senior Member
You can reduce or remove (caution) your series resistor. The duty cycle is so low that the LED and Picaxe pin will live. Careful to only use IROUT, not HIGH, though, or you risk damaging the output pin. Certainly not best practice, but possible for brief events like IROUT.

The underlying PIC silicon has shown itself to be surprisingly resilient and forgiving even when output pins get shorted to ground occasionally. They are only rated for ~20mA . There is a fair amount of internal resistance which limits the maximum current. The forum has many examples of people who accidentally shorted pins without any permanent damage to the Picaxe.

Obviously, lower the supply voltage (3V?) would help self-limit the short circuit current, compared to 5V.

Almost makes me wonder if it is really possible to damage an output pin. Might be time to smoke test. :)
 
Last edited:

john_mills

New Member
Hi Alan

Thanks for the welcome and your reply.

Firstly, are you sure that your "5 volt battery" is really delivering 5 volts and can manage 80 mA?
My 5 volt battery is actually just 3 x AAs. I've measured around 400mA on it.

What value of series (current-limiting) resistor are you using?
Initially I tried a few different resistors, starting out with a 330 ohms. But when I realised that the IR LEDs support a much higher current than normal LEDs and that I wasn't getting enough current through with even an 82 ohms resistor, I just stopped using resistors on the output pin all together.

The IROUT signal is "modulated" (quickly switching on and off), so the average current that a meter will read can be much less than the peak current. What current do you measure after a High C.0 command?
Ah ok, is it possible to read the peak current using a multimeter? The current from a High C.0 measures 19-20mA for me.

The best solution is to use a NPN transistor (or maybe n-channel FET) to amplify the current.
When using a BC549 NPN transistor I'm able to get 19-22mA with irout. When using the transistor with high along with a potentiometer, I've dialed it all the way up to the 80mA I'm seeking.

I've also tried using 2 - 3 transistors chained together with irout but am not able to exceed 40mA. My intention was actually to power this remote with a CR2032 3V battery but the current I get using that is much lower so I thought I'd try and getting it working with 3 x AAs first.

Also make sure you have a large electrolytic capacitor (at least 100 uF) across the supply/ground rails; that is probably what the Sony RC uses.
Perhaps this is a dumb question - I'm new to all of this :) What is the capacitor for?

Cheers
John
 

john_mills

New Member
Hi erco

I've been measuring the current from the output pin by placing my multimeter inbetween the pin and ground with no resistors and using both high and irout. Is this putting the PICAXE at risk of damage?

When I use 3V, I'm only measuring 10mA on the output pin when using high.

Cheers
John
 

AllyCat

Senior Member
Hi John,

The "High" effectively selects the peak current (if you don't have a multimeter or 'scope to indicate the peak directly). You probably won't cause "dangerous" currents to flow with the "High" command, but a "Low" to a pin that is being pulled strongly up to the supply rail might damage the PICaxe.

You're unlikely to get very good range with a CR... type 3 volt cell for two reasons: those cells normally won't deliver more than a few tens of mA, and LEDs need a voltage drop of 1 - 3 volts (depending on their colour) across them, before much current flows. Also, the PICaxe output current capability falls considerably at lower supply voltages.

The capacitor can act as an energy store or "reservoir", which may help a weak battery to deliver pulses of higher current. Consider the analogy of an electric current being like the flow of water: You can fill a bucket or tank (= a capacitor) with a trickle of water from a hose, but then release it all very quickly by turning the bucket upside down (or opening a large tap).

Cheers, Alan.
 

premelec

Senior Member
I've noticed many multimeters have fairly high internal resistance - so if you want a better accuracy reading look at millivolts on a 10 ohm series resistor or use 10 amp meter range with less resolution...
 

hippy

Technical Support
Staff member
I am not convinced any multimeter will give a meaningful measurement of current for any 13us pulse signal. I would guess the best option is to measure voltage across components and determine what the current would be from that.

I am not sure why a multi-transistor switch is capping at 40mA other than this being an artefact of the multimeter not being able to read the pulsed current properly. It might be best to post what your circuit is.

I am not convinced you will get massive range from any button cell powered remote unless you also have some sort of voltage or current charge pump circuit and are using and high-brightness IR LED.

The initial 20cm range seemed rather low to me so perhaps there is some issue with the IR LED.
 

erco

Senior Member
Good call, hippy. John, is this a known good 940 nm IR LED? No visible red glow at 20 mA, right?
 
Top