2

enter image description here

I need help with the following configuration, using LIRC for as the source signal for infrared led transmitter circuit with raspberry pi.

When putting the infrared led emitter led above the collector, I couldn't get enough range for led (wasn't bright enough using a digital camera) even with higher voltage and current (5 volt) .

So, I've chosen the following configuration to get current gain without voltage gain, the led was bright and got range about 6 meters and even can handle 2 IR leds in series.

My question:

  1. I know the emitter follower configuration has a current gain and no voltage gain (the IR led can handle up to 1.5 A for a short time of pulses). How can I calculate current flowing from the emitter to the IR led.

  2. If the emitter follower has no voltage gain, it should have voltage drop about 0.7V, so vout should 3.3-0.7 = 2.6V. I have used a digital multimeter between the emitter and ground and shout that voltage is about 0.2V.

    Is it a wrong reading ? How could the led be bright if the IR led typical forward voltage is 1.3V?

  3. How can I calculate current of Ie?

  4. How can I simulate IR pulses using ltspice (generating squarewave from independent signal source tool)

Example for IR pulses https://www.onetransistor.eu/2014/12/infrared-protocol-analysis-with-pc.html

moh marey
  • 23
  • 3
  • 1
    The current gain to a load in the collector or emitter is largely the same so maybe you have done something wrong? – Andy aka Nov 15 '15 at 11:17
  • but how can I calculate current flowing from the emitter (Ie) anyway in this circuit ? – moh marey Nov 15 '15 at 11:21
  • "a digital mulitmeter between the emitter and ground and shout that voltage is about .2 volt" definitely doing something different than described. – jippie Nov 15 '15 at 11:22
  • 3
    My assumption on your problem is that you have not included a base resistor, or a diode-resistor in your drawing, meaning many different bad things can be happening. Probably the IR diode in the emitter path limits the IO-pin drop caused by the "unlimited" base-current allowing the processor to keep the output in a nearly-defined state, whereas with the emitter to ground it will drop to 0.7-ish volts, causing who-knows-what state. Use resistors where they belong. Diodes and transistors have knees in their curve and need resistors to not die (or cause other things to die) – Asmyldof Nov 15 '15 at 11:28
  • may be something wrong with the multimeter itself , because the led was bright enough to get high range . but how can i calculate the current of Ie flowing to the IR leds mathematically ? (simple emitter follower circuit without resistor on base ) I can't find it anywhere with my available resources and books – moh marey Nov 15 '15 at 11:29
  • asmylodof , I didn't use a base resistor as i followed another thread on this site to get current gain http://electronics.stackexchange.com/questions/60865/how-to-drive-a-20ma-led-from-a-4ma-max-gpio-pin – moh marey Nov 15 '15 at 11:32
  • 1
    The fact the LED's resistor is still missing, made me assume you did also not use one in the set-up before this one. Where it is very desperately needed. As still is the diode limiting resistor. Which will then let you estimate the current through the diode. You can do that now, but you need to look up the exponential curves of all parts included, rather than read off a point on a graph. And yet again, it will become a pissing match between the transistor and diode, making the MCU very much see a current drain that may go beyond its capabilities, because the diode _has no resistor_ – Asmyldof Nov 15 '15 at 13:17
  • It might help [not to ask too many questions in one](http://meta.stackexchange.com/questions/246328/dealing-with-bundle-omnibus-list-of-questions-question-that-consists-of-rather-d). Your last question is rather unclear actually... you might be looking for PWL or wave file input as voltage source. I don't think you really need that to design this circuit though. – Fizz Nov 15 '15 at 23:58

3 Answers3

2

The simplest solution is to put the IR transmitter in the colelctor and have a small valued resistor in the emitter. Thus, if you drive the base with 3.3 volts, the emitter voltage will be at about 2.6 volts and this will appear across the emitter resistor. If the emitter resistor is 26 ohms then the current that flows is 100mA - this current (maybe 99%) flows through the collector and IR transmitter. There are more accurate and higher power versions of this but get the basic circuit working first.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • andy aka , I did that , it worked , but with short range (less than 50 cm away from the infrared reciever even with using lenses , mirrors , and filters ) . i decided to use the emitter follower configuration to get current gain (the IR led can handle up to 1.5A with short pulses ) it worked with more range 10 meter , but how can i calculate the current flowing from the emitter to calculate gain too ? – moh marey Nov 15 '15 at 11:38
  • The forward voltage to get 1A flowing can be as high as 3V for that device so I would consider increasing the 3V3 feeding the device to something a bit higher. Als, your diagram seems to imply that your 3V3 rail is limited to 50mA - is this true? Also can you re-specify what your transistor is - you have PN22220 and this doesn't tally. – Andy aka Nov 15 '15 at 11:48
  • You MUST not use an emitter follower or you risk damaging your IR LED - and you cannot rely on hFE of the transistor to predict current gain - your only option is putting it in the collector and using a smaller emitter resistor but, going to an op-amp and transistor may be a more accurate approach. – Andy aka Nov 15 '15 at 11:53
  • when putting the ir led above the collector , I replaced the 3.3 volt with 5 volt (200 milliamperes max. ) and i couldn't get the a single ir led bright enough to increase the transmitting range . nothing worked fine with enough range and even handled 2 infrared leds except the emitter follower configuration . and yes the 3v3 rail is limited to 50ma max in raspberry pi 2 model b according to its specifications . it actually worked , but i have no idea how much current is flowing from the emitter ? how can i calculate it without using a resistor in base ? – moh marey Nov 15 '15 at 11:55
  • pn2222A transistor – moh marey Nov 15 '15 at 11:56
  • I've looked at the PN2222 and it is probably unsuitable for higher currents as the hFE drops so badly. An emitter follower is going to damage your device - the current is unpredictable for this type of circuit - I cannot provide a formula and even if I could I would NOT use this configuration without a current limiting resistor. – Andy aka Nov 15 '15 at 11:58
  • which TR would u recommend ? what about bd237 (used in official lirc ir transmitter with serial port ) . actually i was asking for the formula of the emitter current in order to determine the value of current limiting resitors to the leds . http://www.lirc.org/transmitters.html – moh marey Nov 15 '15 at 12:35
  • 2
    Another name for an emitter follower is a voltage follower i.e. whatever voltage is on the base appears on the emitter minus about 0.7 volts hence there is no equation for emitter current that suits your type of load because the load is highly non-linear. – Andy aka Nov 15 '15 at 13:14
  • I understand now , so any way to amplify lirc current signal to about 200 milliamperes ? the lic show lirc signal from gpio pin analyzed with sound card i can't afford an oscilloscope http://postimg.org/image/42w90yz41/ – moh marey Nov 15 '15 at 14:01
  • What is LIRC and LIC? – Andy aka Nov 15 '15 at 14:09
  • sorry it's a typing mistake , " the link below show lirc signal from gpio pin analyzed with sound card i can't afford an oscilloscope " , lirc is a linux software allow sending infrared signal from GPIO pin on raspberry ( attached to the base of the transistor) , actually it's a square wave , How can i amplify the current of this signal . I've been working for a month trying to find out a solution for that with no success . – moh marey Nov 15 '15 at 14:30
  • lirc allows recording various infrared remote control using infrared reciever , decoding it , then transmitting it again over infrared transmitter . this helps in home automation , controlling various devices remotely from the internet by accessing raspberry pi through web interface – moh marey Nov 15 '15 at 14:35
  • the signal is constant alternating pulses at 38kHz – moh marey Nov 15 '15 at 14:47
  • There are some mosfets from Alpha & Omega that have very low gate threshold voltages and will "turn on" to milliohms at easily 3V on the gate so maybe one of these and a current limit resistor BUT your supply has to be stable or the current could creep up and destroy the IR LED. The LED would go in the drain with source of the n channel device to 0V. The AO3416 looks good to go for this type of application: http://www.aosmd.com/products/mosfets/n-channel – Andy aka Nov 15 '15 at 18:46
2

I think you are seriously abusing the TSAL6100; it's not meant to take those 1.5A surges on a repeated basis, but only 200mA pulses. If you keep putting 1.5A through it with your remote application, you will probably damage it soon enough. And then no wonder it has no range.

enter image description here

I think you need to read Visay's guide their diode (=LED) datasheets.

Peak surge forward current, IFSM: The maximum permissible surge current in a forward direction having a specified waveform with a short specified time interval (i.e., 10 ms) unless otherwise specified. It is not an operating value. During frequent repetitions, there is a possibility of change in the device’s characteristic.

As badly written by [non-native speakers of English] interns as that doc might be, the message is clear I think.

I don't know exactly how Vishay determines IFSM for their stuff, but a different manufacturer does this (for rectifier diodes):

IFSM, Non-Repetitive Forward Surge Current

IFSM is the maximum allowable nonrepetitive half-sine wave surge current under the following conditions: TJ = 45°C and the base-width of the half-sine wave surge pulse is 8.3 ms. A sample of diodes is selected and one-by-one the diodes are tested to destruction. This is done by hitting the DUT with a single surge pulse and checking to see whether the diode was destroyed. If so, the peak value of the surge is recorded as that diode’s pulse-height capability, and the next diode is tested. If not, the junction temperature is allowed to return to 45°C, the peak value of the surge is increased, and the DUT is hit again. This process is repeated until all of the diodes in the sample have been destroyed. Then the pulse-height capabilities are averaged and IFSM is set equal to half of the average.

Fizz
  • 14,355
  • 2
  • 43
  • 97
1

First of all: forget about driving this LED with a single stage 2N2222 transistor at any current higher than a couple hundred mA. It will not work.

If you actually tried to do it, you'd be stressing the emitter quite a bit, and you'd need about 50mA of base current, or even more, due to very low gain. That's not feasible from a GPIO pin - at least not on most MCUs. You'd need a driver stage, and you'd still probably kill the output stage the first time the MCU hit a snag - the LED would probably survive this better than the poor 2N2222.

I decided to use the emitter follower configuration to get current gain

Common-emitter stages have current gain too. The emitter follower has a much higher effective voltage drop, unless you drive the base through a capacitor, and set things up so that the base voltage can go beyond the emitter voltage (above VCC for NPNs, below GND for PNPs).


In the circuits below, I've assumed that we're limited to 2N2222 and its complementary PNP part 2N2907. Those transistors are somewhat lousy performers vs. more modern ones, but hey - we can make it work. It makes it a nice challenge.

When debugging the firmware, when it's possible to inadvertently turn the LED on continuously, the current should be limited to about 100mA. The base resistor is sized for a minimum current gain of about 50 per the PN2222A datasheet.

schematic

simulate this circuit – Schematic created using CircuitLab

For pulsed use at about 1A current, the pulse duration must be limited to 100us. This is best enforced at the level of the driver, so that firmware glitches won't destroy the LED. Since IR protocols us pulses shorter than 20us, I've limited this circuit's pulse length to about 50us. This circuit is inherently protected against hung firmware.

The 2N2222 isn't rated for use at 1A, and doesn't nearly have enough gain to drive 1A at a reasonable base currents. Two of them have to be paralleled instead. Their gain at 500mA is low - about 40. They thus need a driver stage.

schematic

simulate this circuit

C1 is the pulse-forming capacitor. D2 ensures that the capacitor can be quickly discharged when the input goes low. Q1 is the driver, R3 and R4 are output stage base ballasts that equalize the base currents between the output stages. Q2 and Q3 form the paralleled output stage. R2 can be trace resistance and is optional in the 0-500mOhm range. Use a current probe and oscilloscope to verify peak current, and adjust the value as needed. 0 Ohm should be safe enough given the parasitic trace resistances.

The length of the current loop through C1, D1, R2, Q2/Q3 and back to C1 should be kept minimal. C1 could be two 47uF capacitors in parallel, one next to Q2 and Q3 each.

The current waveform, should GPIO get stuck high for longer than 50us, looks as follows:

Current waveform with input stuck high

It is also possible to implement this circuit with emitter followers. Due to the B-E voltage drop of the output devices, three of them have to be paralleled to get enough current flow. They dissipate more, but their base currents do useful work vs. a common-emitter output stage.

schematic

simulate this circuit

The selected voltage and current waveforms are as follows:

Voltage waveforms Output current waveform

As I've shown above, an emitter follower output stage with base drive within the power supply bounds requires three 2N2222-class transistors just to get 1A out of it. Five if you want 1.5A! A common-emitter output stage requires just two transistors for operation above 1A, and three for 1.5A. It's of course your pick - either one will work fine for this application.

In practice, you'd want to use more modern transistors. Even the 2N3904/2N3906 would be better for this application, although those are old parts as well. There are way better small transistors available today.