Well, he is trying to impart his wisdom to everyone. As I said before, I tried to do the electronics thing and didn't quite get the hang of it. I've been going through a bunch of online videos, and I get the idea of how a diode works; transistors is kinda like two diodes pointing at (or away from) each other. I'll have to dig up the picture... nevermind. One extra browser tab and a quick google comes up with this wikipedia article for the transistor diode model.
I am just trying to share what I know because I enjoy helping others. But to be honest, I'm not sure I'm doing any good here. Not sure if people are reading it and, if they are, if they are learning anything or are even interested in learning it. It's good to go see what others have to say on the subject but if you have to do this then it might mean I'm not presenting the information clearly enough for you to understand. All this information is available on the web but my goal was to present the information here in relation to the project at hand so people didn't have to search the web to try to figure out what is going on. I've got to admit, it's getting a little frustrating. I'm starting to think it's time just to wrap this up and move on to other projects. If it's helping anyone then I don't mind but it takes a lot of time to do these posts and if they aren't doing anyone any good then I have to wonder why I should keep doing them. If I present something and you don't understand, just ask. I have many ways I can present the information and one of them is bound to ring a bell.
**********
Okay, so the pin is being brought low. Now that you bring it up, I remember reading about that on one of the tutorial sites, but obviously it didn't take. I did a quick check on what a "pull up" resistor was, and curiously enough, it lowers the current/voltage coming in, but still keeps it above zero. It doesn't "pull" anything "up".
You are mixing a few things up here. As far as the transistor goes, the resistor connected to the base isn't acting like a pull up or pull down resistor. I didn't state that it was so in this aspect, the concept of a pull up resistor doesn't apply. In the case of the transistor, the resistor is acting like a current limiting resistor. It's still just a resistor but it's the manner it is used that makes it a current limiting resistor. We need to limit the current in the base of the transistor to protect the transistor and to also protect the microcontroller pin. It is the pin on the microcontroller that pulls the base of the transistor up (high) or down (low) according to the program running on the chip.
pull updn.JPG
This shows a resistor in each of the three different configurations discussed here. A pull up resistor DOES pull a line high. In the first drawing, if we didn't have the pull up resistor on the uC pin then the pin is said to be floating. We don't know the state of a floating pin is nor what voltage we may read on it. If we read the pin, we could read anything. We use a pull up or pull down resistor so we have the pin at a definitive state. With a pull up resistor, when we read the pin the uC will read the pin as a high level.
The middle pic shows the resistor being used as a pull down resistor. A pull down resistor DOES pull the line low. It works just like a pull up resistor except it pulls the pin low. When the uC reads the pin, it will read a low pin.
The resistor network on the tdm board (R22) is used to pull the uC pins high. The uC will read the pin high until the transistor in the optocoupler pulls the pin low. This gives the two definitive states, high and low. If you tie the input pin to 5 V without the resistor then you create a dead short and you can burn out the uC pin and you also don't have the means to toggle the input. So yes, pull up and pull down resistors do pull the pin high and low respectively and are used primarily on input pins.
The third image shows the resistor used at the base of the transistor. Here it is neither a pull up nor a pull down resistor. It is used as a current limiting resistor and works as described above.
I think you are over thinking the transistor operation so lets take another look at it.
DIODES.JPG
Here we have 5 diodes. Current flows from left to right (anode to cathode) when the diode is forward biased. Let's assume these are silicone diodes and so the anode needs to be 0.7 V higher (more positive) than the cathode voltage in order for the diode to conduct.
In the top diode, we have 5 V on both sides of the diode. Since we need a difference of voltage potential for current to flow, current will not flow through the diode.
In the second diode, we have 5 V on the anode and 4.5 V on the cathode. Even though we have a higher voltage on the anode than the cathode, we only have 0.5 V difference and so current will not flow. Remember, we said we need 0.7 V difference for the current to flow in the diode.
In the third diode we have 5 V on the anode and 4 V on the cathode. We now have a positive voltage difference of 1 V which is greater than the 0.7 V difference needed for the diode to conduct. We will now have current flow in the diode.
In the fourth diode we have 5 V on the anode and 0 V on the cathode. Again the differential voltage is greater than 0.7 V so the diode will conduct i.e current will flow. This would be like having 5 V on the anode and having the cathode pulled low by a uC.
In the fifth diode we have 4 V on the anode and 5 V on the cathode. We have a voltage difference of 1 V, however, the cathode voltage is higher than the anode voltage so the diode will not conduct.
************************************************** *******
Now let's see how this all relates to transistors. In order to have current flow in the collector of a BJT or in other words; in order to have current flow through our load, we need to have current flowing in the base of the transistor. I will show an NPN transistor and a PNP transistor below. For simplification purposes, I will show the collector for reference only but I don't show it connected to the transistor. Since we need current to flow in the base to turn the transistor on, let's see what it takes to get current flowing in the base.
************************************************** ********
NPN SYMBOL.JPG
Here is the NPN transistor symbol for reference purposes. Note the diode placement and direction.
NPN.JPG
Here I show the NPN bipolar transistor with only the emitter and base leads connected. Notice that the diode placement is exactly as it is in the NPN symbol from above. The collector is shown for reference only. Until we have current flow in the base, no current will flow in the collector or the load and so we will focus this discussion on the base current requirements.
In a common emitter configuration discussed previously, the emitter will be connected to ground (0 V) and the base will be connected to our microcontroller which we will say is a 5 V microcontroller. If the base voltage is pulled low by the uC by setting the pin low, we will have 0 V on the base and 0 V on the emitter. Since there is 0 V differential voltage from base to emitter, the diode will not conduct and so the transistor will be off.
Assuming this is a silicone diode as before, we need 0.7 V differential voltage for the diode to conduct. Now let's pull the base voltage to 5 V by setting the uC pin high. We now have 5 V at the base and 0 V at the emitter and so now the diode will conduct because we have a differential voltage greater than 0.7 V. The transistor will turn on and the load will energize. We didn't need the full 5 V to turn it on, just anything above the 0.7 V difference.
Note the direction of the current flow. Current will flow from the uC to the base of the transistor, through the diode and out the emitter to ground. From this you should be able to see why it takes a high signal from the uC to turn an NPN transistor on and a low signal to turn it off. We don't have a switch to turn the voltage on and off so we do it by creating a differential voltage (ON) or having a condition of no differential voltage (OFF).
You can also see here why we need the current limiting resistor on the base of the transistor. Once the diode starts to conduct, the uC pin will be connected directly to ground and a short will be created which will burn out our uC pin and possibly our transistor. The resistor has nothing to do with whether the transistor base is pulled high or low, but simply limits the current flow from the uC to ground.
PNP SYMBOL.JPG
Here is the PNP transistor symbol for reference purposes. Note the diode placement and direction.
PNP.JPG
Here I show the PNP bipolar transistor with only the emitter and base leads connected. As before, notice that the diode placement is exactly as it is in the PNP symbol from above. The collector is shown for reference only. Until we have current flow in the base, no current will flow in the collector or the load.
This time the emitter will be connected to the positive rail (5 V for this example) and the base will be connected to our microcontroller which we will say is a 5 V microcontroller. If the base voltage is pulled high by the uC by setting the pin high, we will have 5 V on the base and 5 V on the emitter. Since there is 0 V differential voltage from base to emitter, the diode will not conduct and so the transistor will be off.
Assuming this is a silicone diode as before, we need 0.7 V differential voltage for the diode to conduct. Now let's pull the base voltage to 0 V by setting the uC pin low. We now have 0 V at the base and 5 V at the emitter and so now the diode will conduct. It is the change in the way the diode is connected that has changed what voltage is needed to turn the transistor on or off. The transistor will turn on and the load will energize. Note the direction of the current flow and why it is the opposite of an NPN transistor. Current will flow from the positive 5 V supply rail to the emitter and through the diode. It will then leave the diode and out the base of the transistor to the uC where it will be sunk to ground. From this you should be able to see why it takes a low signal from the uC to turn a PNP transistor on and a high signal to turn it off. Again, we don't have a switch to turn the voltage on and off to the base of the transistor so we do it by creating a differential voltage (ON) or having a condition of no differential voltage (OFF).
The same explanation of the current limiting resistor given for the NPN transistor holds true for the PNP transistor shown here.
Electrical and electronics are no different. There are certain distinctions that have one referred to as electrical and the other electronic but in both cases you have a voltage potential difference which causes current to flow in a circuit to perform some function or work. So don't sell yourselves short by saying you understand electrical but not electronics. If you apply what you already know from the electrical field to your study of electronics, you will find you know more than you think.
I hope this clears things up. If not, just say so. I'd be happy to answer questions.
I am just trying to share what I know because I enjoy helping others. But to be honest, I'm not sure I'm doing any good here. Not sure if people are reading it and, if they are, if they are learning anything or are even interested in learning it. It's good to go see what others have to say on the subject but if you have to do this then it might mean I'm not presenting the information clearly enough for you to understand. All this information is available on the web but my goal was to present the information here in relation to the project at hand so people didn't have to search the web to try to figure out what is going on. I've got to admit, it's getting a little frustrating. I'm starting to think it's time just to wrap this up and move on to other projects. If it's helping anyone then I don't mind but it takes a lot of time to do these posts and if they aren't doing anyone any good then I have to wonder why I should keep doing them. If I present something and you don't understand, just ask. I have many ways I can present the information and one of them is bound to ring a bell.
**********
Okay, so the pin is being brought low. Now that you bring it up, I remember reading about that on one of the tutorial sites, but obviously it didn't take. I did a quick check on what a "pull up" resistor was, and curiously enough, it lowers the current/voltage coming in, but still keeps it above zero. It doesn't "pull" anything "up".
You are mixing a few things up here. As far as the transistor goes, the resistor connected to the base isn't acting like a pull up or pull down resistor. I didn't state that it was so in this aspect, the concept of a pull up resistor doesn't apply. In the case of the transistor, the resistor is acting like a current limiting resistor. It's still just a resistor but it's the manner it is used that makes it a current limiting resistor. We need to limit the current in the base of the transistor to protect the transistor and to also protect the microcontroller pin. It is the pin on the microcontroller that pulls the base of the transistor up (high) or down (low) according to the program running on the chip.
pull updn.JPG
This shows a resistor in each of the three different configurations discussed here. A pull up resistor DOES pull a line high. In the first drawing, if we didn't have the pull up resistor on the uC pin then the pin is said to be floating. We don't know the state of a floating pin is nor what voltage we may read on it. If we read the pin, we could read anything. We use a pull up or pull down resistor so we have the pin at a definitive state. With a pull up resistor, when we read the pin the uC will read the pin as a high level.
The middle pic shows the resistor being used as a pull down resistor. A pull down resistor DOES pull the line low. It works just like a pull up resistor except it pulls the pin low. When the uC reads the pin, it will read a low pin.
The resistor network on the tdm board (R22) is used to pull the uC pins high. The uC will read the pin high until the transistor in the optocoupler pulls the pin low. This gives the two definitive states, high and low. If you tie the input pin to 5 V without the resistor then you create a dead short and you can burn out the uC pin and you also don't have the means to toggle the input. So yes, pull up and pull down resistors do pull the pin high and low respectively and are used primarily on input pins.
The third image shows the resistor used at the base of the transistor. Here it is neither a pull up nor a pull down resistor. It is used as a current limiting resistor and works as described above.
I think you are over thinking the transistor operation so lets take another look at it.
DIODES.JPG
Here we have 5 diodes. Current flows from left to right (anode to cathode) when the diode is forward biased. Let's assume these are silicone diodes and so the anode needs to be 0.7 V higher (more positive) than the cathode voltage in order for the diode to conduct.
In the top diode, we have 5 V on both sides of the diode. Since we need a difference of voltage potential for current to flow, current will not flow through the diode.
In the second diode, we have 5 V on the anode and 4.5 V on the cathode. Even though we have a higher voltage on the anode than the cathode, we only have 0.5 V difference and so current will not flow. Remember, we said we need 0.7 V difference for the current to flow in the diode.
In the third diode we have 5 V on the anode and 4 V on the cathode. We now have a positive voltage difference of 1 V which is greater than the 0.7 V difference needed for the diode to conduct. We will now have current flow in the diode.
In the fourth diode we have 5 V on the anode and 0 V on the cathode. Again the differential voltage is greater than 0.7 V so the diode will conduct i.e current will flow. This would be like having 5 V on the anode and having the cathode pulled low by a uC.
In the fifth diode we have 4 V on the anode and 5 V on the cathode. We have a voltage difference of 1 V, however, the cathode voltage is higher than the anode voltage so the diode will not conduct.
************************************************** *******
Now let's see how this all relates to transistors. In order to have current flow in the collector of a BJT or in other words; in order to have current flow through our load, we need to have current flowing in the base of the transistor. I will show an NPN transistor and a PNP transistor below. For simplification purposes, I will show the collector for reference only but I don't show it connected to the transistor. Since we need current to flow in the base to turn the transistor on, let's see what it takes to get current flowing in the base.
************************************************** ********
NPN SYMBOL.JPG
Here is the NPN transistor symbol for reference purposes. Note the diode placement and direction.
NPN.JPG
Here I show the NPN bipolar transistor with only the emitter and base leads connected. Notice that the diode placement is exactly as it is in the NPN symbol from above. The collector is shown for reference only. Until we have current flow in the base, no current will flow in the collector or the load and so we will focus this discussion on the base current requirements.
In a common emitter configuration discussed previously, the emitter will be connected to ground (0 V) and the base will be connected to our microcontroller which we will say is a 5 V microcontroller. If the base voltage is pulled low by the uC by setting the pin low, we will have 0 V on the base and 0 V on the emitter. Since there is 0 V differential voltage from base to emitter, the diode will not conduct and so the transistor will be off.
Assuming this is a silicone diode as before, we need 0.7 V differential voltage for the diode to conduct. Now let's pull the base voltage to 5 V by setting the uC pin high. We now have 5 V at the base and 0 V at the emitter and so now the diode will conduct because we have a differential voltage greater than 0.7 V. The transistor will turn on and the load will energize. We didn't need the full 5 V to turn it on, just anything above the 0.7 V difference.
Note the direction of the current flow. Current will flow from the uC to the base of the transistor, through the diode and out the emitter to ground. From this you should be able to see why it takes a high signal from the uC to turn an NPN transistor on and a low signal to turn it off. We don't have a switch to turn the voltage on and off so we do it by creating a differential voltage (ON) or having a condition of no differential voltage (OFF).
You can also see here why we need the current limiting resistor on the base of the transistor. Once the diode starts to conduct, the uC pin will be connected directly to ground and a short will be created which will burn out our uC pin and possibly our transistor. The resistor has nothing to do with whether the transistor base is pulled high or low, but simply limits the current flow from the uC to ground.
PNP SYMBOL.JPG
Here is the PNP transistor symbol for reference purposes. Note the diode placement and direction.
PNP.JPG
Here I show the PNP bipolar transistor with only the emitter and base leads connected. As before, notice that the diode placement is exactly as it is in the PNP symbol from above. The collector is shown for reference only. Until we have current flow in the base, no current will flow in the collector or the load.
This time the emitter will be connected to the positive rail (5 V for this example) and the base will be connected to our microcontroller which we will say is a 5 V microcontroller. If the base voltage is pulled high by the uC by setting the pin high, we will have 5 V on the base and 5 V on the emitter. Since there is 0 V differential voltage from base to emitter, the diode will not conduct and so the transistor will be off.
Assuming this is a silicone diode as before, we need 0.7 V differential voltage for the diode to conduct. Now let's pull the base voltage to 0 V by setting the uC pin low. We now have 0 V at the base and 5 V at the emitter and so now the diode will conduct. It is the change in the way the diode is connected that has changed what voltage is needed to turn the transistor on or off. The transistor will turn on and the load will energize. Note the direction of the current flow and why it is the opposite of an NPN transistor. Current will flow from the positive 5 V supply rail to the emitter and through the diode. It will then leave the diode and out the base of the transistor to the uC where it will be sunk to ground. From this you should be able to see why it takes a low signal from the uC to turn a PNP transistor on and a high signal to turn it off. Again, we don't have a switch to turn the voltage on and off to the base of the transistor so we do it by creating a differential voltage (ON) or having a condition of no differential voltage (OFF).
The same explanation of the current limiting resistor given for the NPN transistor holds true for the PNP transistor shown here.
Electrical and electronics are no different. There are certain distinctions that have one referred to as electrical and the other electronic but in both cases you have a voltage potential difference which causes current to flow in a circuit to perform some function or work. So don't sell yourselves short by saying you understand electrical but not electronics. If you apply what you already know from the electrical field to your study of electronics, you will find you know more than you think.
I hope this clears things up. If not, just say so. I'd be happy to answer questions.
Comment