Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use a transistor as an amplifier?

Status
Not open for further replies.
i have used two resistance in series (combined 200Ω)at the BAse while a single 100Ω resistance at the collector . emitter is directly grounded
 

i have used two resistance in series (combined 200Ω)at the BAse while a single 100Ω resistance at the collector . emitter is directly grounded

Hello mrarslanahmed!

Please go to the end of the following article and check out the reference schematic with 2N2222.
5 channel radio remote control circuit based of TX-2B / RX- 2B pair

You also mentioned something about a LED. Could you please be more specific about it? How is this LED connected and what kind of LED is it (colour, case)? The base resistance is too low anyway, increase it to 1K or maybe a little higher. Maybe you should look into in series with LED resistance.
 

alexxx thankyou for your concerns....

i am using red color led but is it important to be concerned about led color i mean color of led would have any effect on power dissipation of the circuit....
 

I'll tackle your question since alexxx seems to be offline now. The color is significant in that LEDs of different colors have different voltage drops. A red or amber LED drops about 2V and a white one 3-3.5V. That voltage has to be subtracted from the power supply voltage when calculating the series resistor. It doesn't make too much difference if the supply is 12V or higher, but it makes a lot of difference at low voltages like 5V.

As alexxx pointed out, your resistance values are too low. The base resistor is too low because it gives an unnecessarily high drive current to the transistor's base. It wastes power and puts too much stress on the 89S51 output. This is why I asked about those resistors earlier.

Assuming that you're using 5mm LEDs, the collector resistor is too low because it sets the LED current at about 100mA. 5mm LEDs are usually rated for about 20mA.

Depending on how bright you want the LED to be, with a 12V supply, you should use between 470 ohms and 4.7k at the collector. 470 ohms will give you about 21mA of LED current and 4.7k about 2.1mA. With a 5V supply use 150 ohms to 1.5k.

If you're using a 2N2222, you should set the base current (Ib) at about 1/10 of the collector current. If you use a BC547B, BC337 or 2N3904, set Ib to about 1/30 of the collector current. Use the formula R = 4.2V/Ib where 4.2V is approximately the difference between the 89S51 output voltage and Vbe of the transistor.
 
this probably will work but adding a diode in series with the base resistor would make the threshold switch at TTL levels.

What does TTL stand for?

And also, Dartmouth, you mention 'Ired' what is this, and how do you come to assume the 2V drop is causes?
 
Last edited:

What does TTL stand for?

Transistor Transistor Logic.

Originally, digital circuits were built using RTL and DTL, Resistor Transistor Logic and Diode Transistor Logic.
Eventually, TTL won the batlle of the most effective way to create good digital curcuits.

TTL uses two BE junctions to test the input, so the switching threshold is around 1.4V
From 0.8V to 2.0V is a grey area where TTL doesn't guarantee a valid logic level.
But in practice, 1.4V+ will generally be interpretted as a logic high and anything below 1.4V will be interpretted a logic low.
 
Last edited:
Hey guys,

Just out of interest I tried to explain how, in a physicists terms, a transistor works. Below is what I came up with.

" For an NPN transistor: There are more excess electrons in a single the N layer of the NPN transistor than there are holes in the P layer - the P layer is very thin compared with an N layer. At 0.7V the Vbe is sufficient to cause the holes of the base to be filled by electrons from the emitter. This closes the depletion zone, and hence allows the rest of the emitter excess electrons to travel to the collector under the influence of Vce. Current is now flowing through the transistor. "

Is this correct?
 

Hey guys,

I have just tested out the recommended transistor and resistor setup - 100R on the collector and 1K on the base - this has given my infrared emitter very poor emitting distance, compared with when I didn't have the setup (with the transistor) that I have now. I currently have my arduino outputting 5V to the transistor base, and have a 12V on the collector. I have my emitter connected to the ground of my 12V supply.

There is a photo below of the circuit setup....

Where have I gone wrong?

Thanks:)
 

Attachments

  • Circuit setup.JPG
    Circuit setup.JPG
    392.2 KB · Views: 86
Last edited:

I have a few things to note:

1) On your schematic you say the 12V ground is connected to the transistor emitter. Is that implying that the 5V ground is isolated from the 12V ground? If so the base is floating. This circuit needs to use 5v and 12V supplies with a common ground. Given your initial comments that the 12V supply is used to power the MPU then I assume that the MPU is using a common ground.

2) In our calculations we ignored the pulsing. The 100mA load current was based only on the switch being turned on. So if you're using a 38kHz pulse then average current through the ired will be less than 100mA. For example if the duty cycle of your pulse is 50% then the average current is 50mA.

3) The power dissipation of the 100 ohm resistor will be 10V * 100mA = 1W, well 1/2W if the duty cycle is 50% but you should ensure that the 100ohm resistor is rated for several watts just to be safe. At least 1W anyway or it will melt away.
 
Cheers mate!

You are correct that the 12V supply is also powering the MPU. The MPU has a ground for its power supply AND a ground for the circuit it's controlling (in this case the transistor circuit). The latter ground is not connected in the setup I have at the moment. I think this could be causing me problems. How can I fix this?

My pulsing cycle is thus: (on 13us, off 13 us) * 80, then pause for 520 us, then repeat. So whilst pulsing is occurring the duty cycle is 50%, so that means I should halve the collector resistor value, correct? I'll make sure that it has a sufficient power rating too.
 

The latter ground is not connected in the setup I have at the moment. I think this could be causing me problems. How can I fix this?

Cheers,

No, I was confused by the wording on your diagram but after looking at the Arduino web site I would say that it uses a common ground. I cannot see that this would be causing the problem. You are applying 12V to Vin and internally the MPU provides 5V regulation and is used for the outputs. The ground for the Vin should be internally common for the digital input/outputs on the Arduino.

My pulsing cycle is thus: (on 13us, off 13 us) * 80, then pause for 520 us, then repeat. So whilst pulsing is occurring the duty cycle is 50%, so that means I should halve the collector resistor value, correct?

Ok, so the 520us pause is also going to affect the average current to the ired. I assume by 520us pause that means the ouput will be low. So effectively you have only about 35-40% duty cycle. Thus, with a 100ohm collector resistor, there is probably only about 35-40 mA average current. If you want 100mA average current then you may need to reduce the collector resistor value. But before you do that you really need to make some measurements to see what is actually happening. Since you are using a pulse you will need to make ac measurements. For example, you measure Vac across the collector resistor and calculate the current through it. Another technique wouldbe to modify the program to keep the ired on full time temporarilly so you can measure dc voltages. Also, is the ired rated to handle 100mA? You could also substitue an led for ired to see what is going on if you don't have a multimeter but you should probably increase the value of the collector resistor slightly as they usually have amax cuurent rating of 20-30mA.
 
Last edited:

Hmmmm well I don't know what the problem is then!! Because I've had this setup before, without the transister, and the IED was getting probably 40mA into it (I was maxing out the Arduino, which is bad) and it was transmitting over a distance of about 40cm. Now, with the setup I have currently, the transmission distance is less than 5cm. Are you certain they'd share a common ground?

It was suggested to me that I use an optocoupler in order to isolate the arduino from the rest of the circuit. Would this be a good option? Can you achieve good switching speeds with an optocoupler?

The Ired is rated to run at 150mA at a max. I want to be running it at something near that. I will do some measurements to see what is actually going on, that's a good idea.

So do you think the problem is that the ired just isnt getting enough current because we've limited it with the resistors?
 

I am not certain. I have not used an Arduino myself but based on what I read and the sample circuits the ground is common. I suspect that a grounding problem would cause the circuit not to transmit at all really. If you're getting less distance it appears that there is less current flowing through the ired.
You do have the ground of the 12V power supply connected to the Arduino ground though right? Obviously, because the circuit would not have worked without the transistor without proper ground.

Were you running the same program without the transistor? and did you measure the 40mA or calculate it? Afterall if the Arduino sources a maximum of 40mA and you were pulsing at slightly less than 50% then there should have been maybe 15-20mA average current through the ired.
 

Well I was running the ired without a resistor, straight out of the arduino. So i guess that would have made it 20mA going through it.

I dunno... I'll ask about this problem on the arduino forum, and see if there is any help there.

---------- Post added at 16:09 ---------- Previous post was at 14:17 ----------

I just ran a test then and have discovered that my resistor failed in my initial tests, hence the ired blew! I've got spares:)
So i'll also replace the 100ohm resistor with one rated for several watts. Hopefully that'll solve our problem.

I do have a question though, I think you may have explained this concept briefly before but perhaps you could go into a bit more detail. If I have 12Vs going into the resistor, then into the ired, won't that mean that the voltage going into the ired is exceeding the maximum voltage rating of the ired?
 

You should never connect an led or ired directly to a constant voltage source. You were making an assumption that the Arduino outputs 40mA when short circuited. But this is not necessarily the case and I believe not the case. The digital outputs on the Arduino are rated at 40mA. This is not the same as saying that the outputs will supply 40mA when short circuited. Effectively if you connect the ired directly to the Arduino output then they will battle each other. The Arduino is trying to output 5V and the ired only wants around 2V. Where is the other 3V gonna get dropped? Who's gonna win the battle? Arduino suggests always using atleast a 470ohm resistor to limit the output current. So what I am saying is that you may have been putting a lot more than 40mA through the ired when directly connected. That would explain why it is transmitting less distance now.

Still, you can increase the distance by lowering the collector resistance since the initial calculations did not account for the duty cycle. If you're using an ired with continous current of 150mA it probably has a peak rating of 300mA or so. So you could try a 470ohm collector resistor to get closer to 100mA average through the ired. You'll need at leat a 5W ( better 10W ) resistor to do that. Alternatively, you might try reducing the duty cycle in the program. But really you should measure the actual current through the ired now so you can precisely evaluate the resistor needed to get 100mA.
 

I am afraid you've lost me a bit here. If I have a 12Vs, and I want a bit less than 100mA, say 80mA, going through my ired (I have lots of different ones, but lets use the one with a continuous forward current of 50mA, and a forward voltage of 1.5V), then i need a collector resistor of 130ohm right ((12-1.5)/0.08=131.3)? If I put in a resistor that has a larger value than that, then I won't get as much current, will I?

Also, could you explain how it is that the 12Vs won't blow the ired, when it's forward voltage rating is 1.5V?

Btw, thanks for alerting me to the fact that the arduino needs a 470ohm resistor on it! But I am confused again, because how can the arduino output 40mA when it has that resistor there? Because if V=IR, then (5/470)=1mA.

---------- Post added at 18:15 ---------- Previous post was at 16:46 ----------

Ive run some more tests:

I found that the ired seems to have a limiting distance to its transmission. I tested it with 140ohm, then 105ohm, then 70ohm, then 35 ohm resistors on the collector. The final 35ohm resistor would have caused about 330mA to run through the ired, which is about 130mA when you account for a 40% duty cycle. I realise that this is much more than recommended. Nevertheless, the ired still works fine. But the transmission distance only increased marginally (1-2cm).

I think I need to order a high power infrared transmitter. What do you think?
 
Last edited:

I am afraid you've lost me a bit here. If I have a 12Vs, and I want a bit less than 100mA, say 80mA, going through my ired (I have lots of different ones, but lets use the one with a continuous forward current of 50mA, and a forward voltage of 1.5V), then i need a collector resistor of 130ohm right ((12-1.5)/0.08=131.3)? If I put in a resistor that has a larger value than that, then I won't get as much current, will I?

Yes

Also, could you explain how it is that the 12Vs won't blow the ired, when it's forward voltage rating is 1.5V?

I assume by this you mean that you have tried it and the ired did not blow. It's possible that it might blow or not. It depends on two things:
1- How much current the 12V source can deliver. If the ired can take the maximum current that the voltage source can deliver then it will not blow. What will happen is that the 12V source will drop voltage across its internal resistance and output a lower voltage that the ired can handle.

2- the characteristic curve of the ired. 1.5V is the nominal voltage or knee voltage of the ired. Higher currents will cause a larger voltage drop across it until it eventually reaches its breaking point. But the curve is basically exponential so a small voltage increase requires a large current increase through the ired.

I suspect the ired would break before 12V ( I could be wrong though ), so likely the 12V source could not supply enough current to kill the ired so for example it could only source 6V at 500mA and at 500mA the ired drops 6V. That would be the Q point of the circuit. Of course the Q point might not be stable because of heat dissipation and might eventually lead to disaster. But this is just an example. In reality, it is somewhat unpredictable, which is why you should always use a series current limiting resistor.

Btw, thanks for alerting me to the fact that the arduino needs a 470ohm resistor on it! But I am confused again, because how can the arduino output 40mA when it has that resistor there? Because if V=IR, then (5/470)=1mA.

First of all, they are being overly cautious because they don't want you to destroy the output pin on your Arduino. Secondly, they cannot assume that you are using 5V. Let's say the Ardiuno is outputting 0V through a resistor which is attached to a 12V source. Now, R=12V/40 mA = 300 ohms. Sourcing is less of a problem unless you use a negative voltage but still they are basically covering their buts so you don't blame them for a faulty product. Thirdly, your calculation is actually
10 mA not 1 mA. In fact, if using 5V you can use 150 ohms and still be under the 40 mA rating. But with 12V you should limit to 330 ohms or more. It is likely a transistor inside the MPU that is rated at 40mA, so if you burn it, essentially you need a new Arduino or at least replace the MPU. So, it is far better to design external circuitry to sink or source more current. That circuitry is easier and cheaper to replace even if you make a mistake in the design.

Ive run some more tests:

I found that the ired seems to have a limiting distance to its transmission. I tested it with 140ohm, then 105ohm, then 70ohm, then 35 ohm resistors on the collector. The final 35ohm resistor would have caused about 330mA to run through the ired, which is about 130mA when you account for a 40% duty cycle. I realise that this is much more than recommended. Nevertheless, the ired still works fine. But the transmission distance only increased marginally (1-2cm).

I think I need to order a high power infrared transmitter. What do you think?

It would appear that you need a larger ired or some way to collimate the infra red signal to the detector. It is not surprising. The distance vs current is probably logarithmic function or similar. Is the photo-detector matched in frequency to the ired? ie are their peek frequencies the same or similar? What is the bandwidth of the frequencies? In other words, improvement might not necessarily be based on more power, but better matching of efficiency between transmitter and receiver.

Another thing, you should try connecting the ired directly to the Arduino, with an appropriate series resistor of course, to compare the distance without the transistor vs the distance with the transistor at similar current levels. It should not matter. But if you test it, then we will know for sure that the decreased distance was a result of less current as opposed to some other problem introduced by the transistor circuit. Then you can determine the logical next step to get more distance out of the transmitter. The key is when something does not seem right, to take measurements and try a few different things so you can see what is actually happening vs what you were expecting to happen. Making a plot of distance vs current was a great example. Now you can extrapolate the graph to estimate how much current will be required for a given distance needed.
 
Last edited:
Oki doki! Well I'll run some more tests soon. I'm busy today and tomorrow, so I'll be onto it in a few days.

Thanks for all your help:)

I found this page too, I haven't had a good read of it, but it looks promising as far as helping me with distance. **broken link removed**

Here is my ir reciever data sheet, it responds best to 38kHz pulsing:http://www.newark.com/pdfs/datasheets/vishay/TSOP34.pdf
 

I a going to try changing my duty cycle and pulse length. I am going to have the ired pulse for 6 phases, then pause for 20 phases. Ill see how that goes!
 

I tried it and it worked pretty well! I got about 1.5 - 2m of range with only using the arduino as a current source. I had my pulse running for 6 phases and pausing for 6 phases.

The circuit with the transistor isn't working well though. It blew two of my ired's!! This was with a 100ohm collector resistor. The ired was rating for a 100mA forward current, so theoretically the current (about 103mA) shouldn't have been a problem at 50% duty cycle. I wasn't able to get very much distance with the transistor circuit.

There was a strange thing happening though. The voltage drop over the 100ohm resistor was 18Vac!!!! How is that possible! I only had 12Vdc supply!!!!

Another strange thing happened. My infrared receiver only started working properly when I had held my finger over it for 1-2 seconds. So I'd hold my finger over the receiver, take it off, then all of a sudden it started sensing the infrared signal coming from the ired. Weird. It's as though it was getting sensory overload and I had to block out all inputs whilst it re-configured itself.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top