Hi bozo, that can not work, as even the tristate output is connected to 3.3 via a diode so you should never try to apply more that 3.3 plus some margin to an high impedance output.
That was addressed in the second post.
@Ariba: I will have to keep that one in mind. Thanks.
I was trying to determine best practice/proven components that work best with the prop.
I want to use transistors as switches and maybe a relay replacement if the transistors can handle the current.
Optimally I'm looking for a schematic with component part numbers that safely interfaces transistors with the propeller. With pull up resistors or pull down resistors and all.
Yes, you can do it that way. Both transistors require current-limiting series resistors in their base circuits. The PNP should also have a pull-up on its base.
BTW, you can save yourself a whole bunch of effort and produce better-looking schematics by using LogicWorks 5, the succesor to DesignWorks Lite.
-Phil
Ok, I've downloaded this, will probably take a while before I'm proficient in it
The problem with driving PNPs directly from a Prop (through a current-limiting resistor, of course) is that their positive supply can be no higher than 3.9V, i.e. Vdd + VBE (PNP). Otherwise, they'd be on all the time. With NPNs and nMOSFETs that limitation does not exist. They're limited only by their VCEmax (NPN) or VDSmax (nMOSFET).
BTW, the IRF3708 (nMOSFET) is fully characterized for VGS values as low as 2.8V and can be driven directly from a Prop pin.
-Phil
Phil,
Do you have some logic work schematic examples in how you've interfaced this into the prop and not damaged the prop in any way or added a few safety nets? Maybe with some zeners and resistors?
Optimally I'm looking for a schematic with component part numbers that safely interfaces transistors with the propeller. With pull up resistors or pull down resistors and all.
I can give you part numbers on the schematics I gave you on the first page. We have tested these circuits at temperatures between -4C and above 125C, and have used the first two for years now. Both at 3.3V and 5V control and up to 16V input. Is that not what you were looking for?
Yes that is what I was looking for, I'm sorry I didn't mean to imply that I was not with my last post ... more so I was just trying to see other examples of what others had done so I can learn. Part numbers would be great.
I'm less than a year into this and very new and trying to soak up all of the experienced info that others are willing to provide.
I have a PCB I've build, and I'm almost done except for that I need to make sure that I've "covered" all of my bases with the interfacing of transistors with the prop, before I order a few copies. I don't want to needlessly waste money by getting something I can't use and then having to modify it.
I can give you part numbers on the schematics I gave you on the first page. We have tested these circuits at temperatures between -4C and above 125C, and have used the first two for years now. Both at 3.3V and 5V control and up to 16V input. Is that not what you were looking for?
All my NPN transistors I use are the BC846BLT1G. But I created the circuits so they are very flexible (as they should be). Almost any NPN would work. Higher frequency and higher gain transistors would increase the overall frequency of the circuits. Higher frequencies will reduce the turn-on/turn-off times of the MOSFETs which will reduce the wattage wasted during the transition, which is what will kill MOSFETs.
In the first schematic, we use IRF7343. It's an SOIC dual N- and P-channel MOSFET with low gate thresholds (for use with prop).
In the second and third schematic, there are a million MOSFETs that are available that fit the same package. We use IRF7404TRPBF. It is a single MOSFET SOIC that can go up to 6.7A, but there are ones that go above and beyond 13A.
Just to verify, F1, F4 and F5 are IC mosfet transistors? Do you shy away from a TO type package or DIP package for any specific reasoning?
It appears as if the latter IC has a built in flyback zener diode? If so that's pretty handy! Maybe there is a DIP version that I can put into my breadboard? I'm not quite ready for SMD yet.
All my NPN transistors I use are the BC846BLT1G. But I created the circuits so they are very flexible (as they should be). Almost any NPN would work. Higher frequency and higher gain transistors would increase the overall frequency of the circuits. Higher frequencies will reduce the turn-on/turn-off times of the MOSFETs which will reduce the wattage wasted during the transition, which is what will kill MOSFETs.
In the first schematic, we use IRF7343. It's an SOIC dual N- and P-channel MOSFET with low gate thresholds (for use with prop).
In the second and third schematic, there are a million MOSFETs that are available that fit the same package. We use IRF7404TRPBF. It is a single MOSFET SOIC that can go up to 6.7A, but there are ones that go above and beyond 13A.
I'm just a surface mount type of guy.
Actually, I get my boards assembled, so SMT is easier, cheaper, has more options, and smaller than TO-220, and compatible in size to TO-92. The different packages work about the same. The larger 220 package probably has greater heat dissipation and options to heatsink.
The dual N/P channel MOSFET is handy: simple low power switching can be done with 2 components. And SOIC is really easy to hand solder anyway. I bet the SOIC transistors come in a similar DIP version, though I have never looked.
By the way, I don't think they are technically "ICs". A one-transistor device isn't much of a circuit. And even the dual MOSFET doesn't contain a circuit (it is two transistors next to each other). But I have seen them listed as IC from some suppliers.
Oh, and the zener diode is just a product of MOSFET processing. All MOSFETs have them (they are not added). The first schematic is our oldest, and we never bothered to add the zener in the component. The zener's reverse breakdown voltage is approximately equivalent to the maximum voltage the MOSFET is rated for.
The old schematic component doesn't have the zener, but labels gate/source/drain. The new one doesn't label, but has the diode. Maybe I should standardize this stuff. The people working on the schematics know enough not to require that stuff, but consistency is something to be desired.
Looks like the answer is no. I never realized a thread like this would generate so much varied response?
... Tim
Oh, but there are more options. I've heard people suggesting using rail-to-rail op amps, and ICs specifically designed to interface between voltages. But I think the discrete solutions are simple and effective enough. They are also usually the only solutions that can allow any significant amount of power through.
I talked with my instructor tonight and he seemed to like the uC --> NPN --> PNP --> Mosfet option the best, with some properly placed resistors. I am going to modify my PCB to have those as an end all solution for what I am doing. It may be a bit overkill, but I should not have any issues with it and that is what matters in the long run.
At some point I will probably used IC foot print options as Bobb has kindly suggested but while I'm assembling I'm going to use TO style on my prototype PCBs.
Remove the 90-degree angles. You should (with few exceptions) always use two 45-degree angles instead, especially on smaller traces.
Also, just to remove some confusion when assembling, adding another line to the TO parts to indicate which direction they are place is handy. The square hole is not enough, because there is no indicator on the part itself.
Other than that, it looks sufficient to me; assuming all the connected pads are connected correctly, and the unconnected pads will get connected.
Remove the 90-degree angles. You should (with few exceptions) always use two 45-degree angles instead, especially on smaller traces.
Also, just to remove some confusion when assembling, adding another line to the TO parts to indicate which direction they are place is handy. The square hole is not enough, because there is no indicator on the part itself.
Other than that, it looks sufficient to me; assuming all the connected pads are connected correctly, and the unconnected pads will get connected.
It's pretty important. When the board is being fabricated, corners can have the edges messed up. Less of an angle will give a lesser likelihood to have the corners messed up, and there is less corner to mess with. The 45-degree angles don't need much of a straight between them, just as long as there are two distinct corners. You can probably manage adding them where the 90-degree corners lay.
It may be a good idea to post your entire board. There are always helpful suggestions people can give to you.
It's pretty important. When the board is being fabricated, corners can have the edges messed up. Less of an angle will give a lesser likelihood to have the corners messed up, and there is less corner to mess with. The 45-degree angles don't need much of a straight between them, just as long as there are two distinct corners. You can probably manage adding them where the 90-degree corners lay.
It may be a good idea to post your entire board. There are always helpful suggestions people can give to you.
Post the file (experssPCB I'm guessing), and I will show you a few suggestions, rather than trying to describe them. Overall, it looks pretty good, other than the 90-degree angles, which be too difficult to fix, just will take some time.
Post the file (experssPCB I'm guessing), and I will show you a few suggestions, rather than trying to describe them. Overall, it looks pretty good, other than the 90-degree angles, which be too difficult to fix, just will take some time.
Well, I realize now, it is in a less complete state than I first though from the screen shot. Here are the suggestions:
1) The 45-degree angle thing. By the way, you probably only need to do this on traces that are thinner than 0.02", but is generally a good idea to do it on all traces.
2) Use a copper pour (AKA "filled plane") for your 3.3V circuit. It doesn't need to cover the whole board, but it is an important circuit where reduced resistance from a thick pour would be beneficial. I, almost without exception, will have every layer of the board I am designing be almost completely covered with a copper pour. The top layer is usually ground. Most parts that sink heat (like your regulators) sink on a ground-connected pad, so a large pour will help sink heat better. Then the bottom will be 3.3V, and other essential power circuits.
3) You have in more than a couple places traces crisscrossing. I would bet they are not on the same circuit. This would cause a short.
4) There are numerous places where the trace length could be reduced. This is not a matter of life and death, but getting in the habit of forming the shortest possible traces will help you in the long run.
5) You use both silkscreen labels and copper labels. Is there reasoning behind this? Usually you should stick with one or the other. Copper labels use up a lot of space, but silkscreen labels require you to have the board fabricated with a silkscreen.
6) Your vias can be smaller. You use 0.029" holes, unless it is a high-power trace, I always use the smallest available (0.014" from ExpressPCB). This will give you more board space. I believe you can changed the default somewhere in the program's settings.
7) Many of the traces you are using are probably bigger than you need. This isn't a bad thing, except it uses additional board space (another good habit to get into is precisely over-engineering every aspect -- meaning oversize traces, components rated strong than necessary, but within engineering reason). Use this as a guideline.
8) I didn't see it on your board, but with ExpressPCB, don't use traces smaller than 0.01". A number of problems I had with their boards was from small traces.
9) The prop clip would be difficult to use. I think they are designed to be used at the edge of a circuit board.
Hope this helps.
You may have seen this from me on other threads, but I would suggest getting away from ExpressPCB as soon as possible. There are a number of other, much better, free CAD suites that would allow you get much better fabrication done at a fraction of the price.
Your experience with expresspcb was disappointing to read. Ya, I had three really bad orders. The first was early on when I thought I had made a mistake, but the mistakes weren't consistent, so I was confused. The other two were later on. I had ordered dozens of boards, both ordered too close to each other to stop the second before I realized 10% of the boards had major flaws. I did order batches that all came back fine, but a random 10% failure rates are unacceptable.
I have some things in copper and some in silk because I won't be ordering them with silk, but the labels will help me in the mean time. I kind of guessed that. I did the same when I ordered from ExpressPCB.
I will start rounding the < .02 traces, I have a feeling that's going to take a while Pimping other CAD suites: DipTrace will automatically add 45's at the corners and will assist in keeping your traces perfectly straight.
I have a green plane, no red plane yet though. Out of curiosity, why is the red plane ground and the green plane supply? That seems backwards to me? The colors are not important, they are arbitrary. The location relative to the components is important. If your regulators were not surrounded by traces, a copper pour surrounding them would sink the heat away better. But you did the right think and are sinking the heat to the bottom anyway. This is mostly preference, but I think there is some logic in my choice.
I didn't see any crossing on the same plane, I'll have to look more closely though. See attachment.
I'll relocate the prop clip, thank you for the advice!
It is more common to have the ground plane on the bottom and power on the top.
You should also check out the other threads discussing pcb layouts for the prop. Your power supply to the prop is not ideal as both sets of the power and ground pins should be directly connected and have decoupling. I published extracts of my TriBlade on one of the threads discussing pcb layouts which should help.
Definately do not use right angle traces for anything. You will just be asking for problems.
All ICs require a decoupling cap, as do the input and output of the regulators - you should check the regulator specifications for recommendations as they vary.
View attachment.
Comments in Red. It's a good idea to look at others' boards and the other threads Cluso mentioned are a good read. Maybe we can find those and post a link.
It is more common to have the ground plane on the bottom and power on the top. I looked around and am finding this to be true too. I think the logic is the majority of your traces will be on the top (especially when using lots of SMT parts) so the bottom will be less cluttered, so you will achieve a better (lower impedance) ground, and a better shield of sorts. Turbo, it doesn't make a huge difference with the level of board making you are at, but all these little things can add up to something significant later in the engineering process.
You should also check out the other threads discussing pcb layouts for the prop. Your power supply to the prop is not ideal as both sets of the power and ground pins should be directly connected and have decoupling. I published extracts of my TriBlade on one of the threads discussing pcb layouts which should help. You have caps on both power pins to your prop, but ideally the one on the right should be closer, and for both, you may want to at least thicken up the traces a bit. This is why I use a profuse amount of copper pours, it connects the pins with less impedance. Adding decoupling caps to all your ICs is a worthwhile endeavor. I have yet to have a component not work due to lack of decoupling cap, but the brief drop in voltage can alter the functionality of many ICs.
Definately do not use right angle traces for anything. You will just be asking for problems. It's more important on smaller traces, but he is right, it's work the little effort to put 45's on all traces.
All ICs require a decoupling cap, as do the input and output of the regulators - you should check the regulator specifications for recommendations as they vary. He has capacitors on inputs and outputs of the regulators (the little circles with the + symbol next to them). But be sure to supply enough capacitance (with the correct ESR) for them.
Hi bozo, that can not work, as even the tristate output is connected to 3.3 via a diode so you should never try to apply more that 3.3 plus some margin to an high impedance output.
Hi ErNa can you please elaborate? I would have thought that with a pin configured as an input (hi-Z), it would be safe to have a higher voltage present on it, as there is hardly any current flowing at the pin (thanks to its high impedance). What is the mechanism internal to the propeller that makes this a bad idea?
With each IO on any IC doesn't have to be a Propeller, there are two reverse biased diodes that are normally there to re-direct an ESD event to either Power or Ground. However they can be activated or forward biased 'ON' if the voltage to the IO pin is either higher than the supply power to the IC or lower than the supply ground to the IC.
What happens with a PNP is that the Emitter-Base junction basically acts like a diode regardless if the transistor is on or off ... As long as the voltage supply to the PNP's Emitter is the same as the voltage supply to the Propeller (or other driving IC) there won't be a problem. It's when the supply voltage to the PNP is greater than the supply voltage to the Propeller (or other driving IC) that the PNP will start to conduct through one of the reversed biased diodes.
Take this circuit for example...
+V2
+V1 >--|<--o /
| 100 E
IO >------o--------/\/\-----B (PNP transistor)
| C
GND >-->|--o \
??? Don't care
If V1 and V2 are the same you don't have a problem.
Suppose V1 is 3.3V and V2 is 12V, then the equivalent circuit from above would look like this...
Each diode would drop the voltage about 0.6V, so the 100 Ohm resistor would experience 7.5V ... The difference of 12V - 3.3V - two diode drops of 0.6V = 7.5V
The overall current would be 75mA... enough to adequately turn 'on' the PNP transistor, assuming that the internal IO diode could handle that much current (<-probably not for long)
Three component to turn on and off a relay seem a bit excessive. So here is my 2 cents.
You can generally rely on 2n3904 for a first stage of output from a Propeller, but with the 2N2222 you can actually achieve more gain and often avoid needinga second stage. And 'yes', the current limiting resistor is extremly wise even if it seems not to be required (as in the 2N7000).
At first, I was a conservative (a paranoid conservative with grandiose designer ambitions, maybe) and wanted opto-isolators on everything. But they are less responsive and have less power output (150ma at tops) than the 2N2222 (which some say can switch 640ma).
And then I got into Darlingtons of all sorts (an idiot zealot). The UNL2803 package is so tiny when you want 8 parallel lines, I considered that superb. But being in one package limited how much they really could sustain at full on of all 8 lines to about 60ma per channel. Darlingtons are very much about heat and sizzle.
So back to the 2N2222....
And then, MOSfets came along and the 2N7000 seemed to be leading edge (a masterful engineer?). So I began to pursue that. What a mess! They do work --- when you get it right. But there are more things that can go wrong (Did you know that putting one in backwards turns it to smoke because of the by-pass diode). So with both with fears of static electricity and mysterious handling damage, why bother with having to have a pull down to assure they are off or a pull up to assure they are on? They are just too sensitive.
So once again, it I am back to the 2N2222 as my preferred choice.
Sure I do have a few 2N3904 sitting around and often they are all I need. And I even have their mate, the 2n3906. But I have put a stop to buying more. And yet if I restock, I can buy 2N2222s and 2N2907s for the same price and complete more circuits with just one transistor rather than stages.
I do have power MOSfets (IRF540s) now and I finally understand that they are better than power Darlingtons. But I suspect I'll just drive them from a 2N2222 for the first stage rather than being "a purist" that uses the 2N7000 to drive a bigger MOSfet as an 'all MOSfet' solution. I can afford to waste a full milliamps for the sake of a lot less construction frustration.
And most importantly, these days my main goal is to have merely 5-6 transistors on hand that will nearly do everything. I no longer have to clone each circuit that I find on the web with hard-to-get transistors.
I'll save my opto-isolators for long transmission lines that might get zapped by lightning - I think that is what they were originally intended for. If you really, really are afraid of damaging your Propeller I/O, you should build your board using the 40 pin DIP Propeller, leave it out until after you have completed the board and after you have tested all the pins for wrong voltage and short circuit.
The opto-isolators are just like Linus's security blanket, excess baggage.
If I really, really must have isolation these days, there is nothing wrong with a 2N2222 driving a 12 volt mechanical relay. You can get some really rugged 40 amp automotive relays that love to wallow in mud and grease, but don't create the heat that a power transistor does. Of course they are slow, but so are the opto-isolators.
My only remaining dilemma is what to do with those chunky 2N3055s that thought would be so necessary for robotics.
Comments
@Ariba: I will have to keep that one in mind. Thanks.
I was trying to determine best practice/proven components that work best with the prop.
I want to use transistors as switches and maybe a relay replacement if the transistors can handle the current.
Optimally I'm looking for a schematic with component part numbers that safely interfaces transistors with the propeller. With pull up resistors or pull down resistors and all.
Ok, I've downloaded this, will probably take a while before I'm proficient in it
Phil,
Do you have some logic work schematic examples in how you've interfaced this into the prop and not damaged the prop in any way or added a few safety nets? Maybe with some zeners and resistors?
Thanks!
Yes that is what I was looking for, I'm sorry I didn't mean to imply that I was not with my last post ... more so I was just trying to see other examples of what others had done so I can learn. Part numbers would be great.
I'm less than a year into this and very new and trying to soak up all of the experienced info that others are willing to provide.
I have a PCB I've build, and I'm almost done except for that I need to make sure that I've "covered" all of my bases with the interfacing of transistors with the prop, before I order a few copies. I don't want to needlessly waste money by getting something I can't use and then having to modify it.
All my NPN transistors I use are the BC846BLT1G. But I created the circuits so they are very flexible (as they should be). Almost any NPN would work. Higher frequency and higher gain transistors would increase the overall frequency of the circuits. Higher frequencies will reduce the turn-on/turn-off times of the MOSFETs which will reduce the wattage wasted during the transition, which is what will kill MOSFETs.
In the first schematic, we use IRF7343. It's an SOIC dual N- and P-channel MOSFET with low gate thresholds (for use with prop).
In the second and third schematic, there are a million MOSFETs that are available that fit the same package. We use IRF7404TRPBF. It is a single MOSFET SOIC that can go up to 6.7A, but there are ones that go above and beyond 13A.
Just to verify, F1, F4 and F5 are IC mosfet transistors? Do you shy away from a TO type package or DIP package for any specific reasoning?
It appears as if the latter IC has a built in flyback zener diode? If so that's pretty handy! Maybe there is a DIP version that I can put into my breadboard? I'm not quite ready for SMD yet.
IRF7343
IRF7404TRPBF
IRF7404TRPBF
Actually, I get my boards assembled, so SMT is easier, cheaper, has more options, and smaller than TO-220, and compatible in size to TO-92. The different packages work about the same. The larger 220 package probably has greater heat dissipation and options to heatsink.
The dual N/P channel MOSFET is handy: simple low power switching can be done with 2 components. And SOIC is really easy to hand solder anyway. I bet the SOIC transistors come in a similar DIP version, though I have never looked.
By the way, I don't think they are technically "ICs". A one-transistor device isn't much of a circuit. And even the dual MOSFET doesn't contain a circuit (it is two transistors next to each other). But I have seen them listed as IC from some suppliers.
The old schematic component doesn't have the zener, but labels gate/source/drain. The new one doesn't label, but has the diode. Maybe I should standardize this stuff. The people working on the schematics know enough not to require that stuff, but consistency is something to be desired.
Looks like the answer is no. I never realized a thread like this would generate so much varied response?
... Tim
I talked with my instructor tonight and he seemed to like the uC --> NPN --> PNP --> Mosfet option the best, with some properly placed resistors. I am going to modify my PCB to have those as an end all solution for what I am doing. It may be a bit overkill, but I should not have any issues with it and that is what matters in the long run.
At some point I will probably used IC foot print options as Bobb has kindly suggested but while I'm assembling I'm going to use TO style on my prototype PCBs.
Here is what I've got, any comments or suggestions?
With the BJT's the square pin is the emitter. With the FET the square pin is the gate.
Also, just to remove some confusion when assembling, adding another line to the TO parts to indicate which direction they are place is handy. The square hole is not enough, because there is no indicator on the part itself.
Other than that, it looks sufficient to me; assuming all the connected pads are connected correctly, and the unconnected pads will get connected.
I have 90 degree angles on my whole board
It may be a good idea to post your entire board. There are always helpful suggestions people can give to you.
As you can see, I'm going to have many many corners to add 45's to.
Anyway, don't hold back on the comments/suggestions!
You are correct, it is expresspcb
1) The 45-degree angle thing. By the way, you probably only need to do this on traces that are thinner than 0.02", but is generally a good idea to do it on all traces.
2) Use a copper pour (AKA "filled plane") for your 3.3V circuit. It doesn't need to cover the whole board, but it is an important circuit where reduced resistance from a thick pour would be beneficial. I, almost without exception, will have every layer of the board I am designing be almost completely covered with a copper pour. The top layer is usually ground. Most parts that sink heat (like your regulators) sink on a ground-connected pad, so a large pour will help sink heat better. Then the bottom will be 3.3V, and other essential power circuits.
3) You have in more than a couple places traces crisscrossing. I would bet they are not on the same circuit. This would cause a short.
4) There are numerous places where the trace length could be reduced. This is not a matter of life and death, but getting in the habit of forming the shortest possible traces will help you in the long run.
5) You use both silkscreen labels and copper labels. Is there reasoning behind this? Usually you should stick with one or the other. Copper labels use up a lot of space, but silkscreen labels require you to have the board fabricated with a silkscreen.
6) Your vias can be smaller. You use 0.029" holes, unless it is a high-power trace, I always use the smallest available (0.014" from ExpressPCB). This will give you more board space. I believe you can changed the default somewhere in the program's settings.
7) Many of the traces you are using are probably bigger than you need. This isn't a bad thing, except it uses additional board space (another good habit to get into is precisely over-engineering every aspect -- meaning oversize traces, components rated strong than necessary, but within engineering reason). Use this as a guideline.
8) I didn't see it on your board, but with ExpressPCB, don't use traces smaller than 0.01". A number of problems I had with their boards was from small traces.
9) The prop clip would be difficult to use. I think they are designed to be used at the edge of a circuit board.
Hope this helps.
You may have seen this from me on other threads, but I would suggest getting away from ExpressPCB as soon as possible. There are a number of other, much better, free CAD suites that would allow you get much better fabrication done at a fraction of the price.
I have some things in copper and some in silk because I won't be ordering them with silk, but the labels will help me in the mean time.
I will start rounding the < .02 traces, I have a feeling that's going to take a while
I have a green plane, no red plane yet though. Out of curiosity, why is the red plane ground and the green plane supply? That seems backwards to me?
I didn't see any crossing on the same plane, I'll have to look more closely though.
I'll relocate the prop clip, thank you for the advice!
Here is the latest PCB.
I still have to make sure I am doing the correct thing and understanding what I am doing with the top and bottom plane.
The top is supply and the bottom is ground? Or the top is ground so that I can bend over the things like the regulators, and the bottom is supply?
I'll convert over to either pcb123 or dip trace pretty soon, which do you like better?
You should also check out the other threads discussing pcb layouts for the prop. Your power supply to the prop is not ideal as both sets of the power and ground pins should be directly connected and have decoupling. I published extracts of my TriBlade on one of the threads discussing pcb layouts which should help.
Definately do not use right angle traces for anything. You will just be asking for problems.
All ICs require a decoupling cap, as do the input and output of the regulators - you should check the regulator specifications for recommendations as they vary.
Comments in Red.
It's a good idea to look at others' boards and the other threads Cluso mentioned are a good read. Maybe we can find those and post a link.
Hi ErNa can you please elaborate? I would have thought that with a pin configured as an input (hi-Z), it would be safe to have a higher voltage present on it, as there is hardly any current flowing at the pin (thanks to its high impedance). What is the mechanism internal to the propeller that makes this a bad idea?
Cheers,
Mark
With each IO on any IC doesn't have to be a Propeller, there are two reverse biased diodes that are normally there to re-direct an ESD event to either Power or Ground. However they can be activated or forward biased 'ON' if the voltage to the IO pin is either higher than the supply power to the IC or lower than the supply ground to the IC.
What happens with a PNP is that the Emitter-Base junction basically acts like a diode regardless if the transistor is on or off ... As long as the voltage supply to the PNP's Emitter is the same as the voltage supply to the Propeller (or other driving IC) there won't be a problem. It's when the supply voltage to the PNP is greater than the supply voltage to the Propeller (or other driving IC) that the PNP will start to conduct through one of the reversed biased diodes.
Take this circuit for example...
If V1 and V2 are the same you don't have a problem.
Suppose V1 is 3.3V and V2 is 12V, then the equivalent circuit from above would look like this...
Each diode would drop the voltage about 0.6V, so the 100 Ohm resistor would experience 7.5V ... The difference of 12V - 3.3V - two diode drops of 0.6V = 7.5V
The overall current would be 75mA... enough to adequately turn 'on' the PNP transistor, assuming that the internal IO diode could handle that much current (<-probably not for long)
cheers,
MArk
You can generally rely on 2n3904 for a first stage of output from a Propeller, but with the 2N2222 you can actually achieve more gain and often avoid needinga second stage. And 'yes', the current limiting resistor is extremly wise even if it seems not to be required (as in the 2N7000).
At first, I was a conservative (a paranoid conservative with grandiose designer ambitions, maybe) and wanted opto-isolators on everything. But they are less responsive and have less power output (150ma at tops) than the 2N2222 (which some say can switch 640ma).
And then I got into Darlingtons of all sorts (an idiot zealot). The UNL2803 package is so tiny when you want 8 parallel lines, I considered that superb. But being in one package limited how much they really could sustain at full on of all 8 lines to about 60ma per channel. Darlingtons are very much about heat and sizzle.
So back to the 2N2222....
And then, MOSfets came along and the 2N7000 seemed to be leading edge (a masterful engineer?). So I began to pursue that. What a mess! They do work --- when you get it right. But there are more things that can go wrong (Did you know that putting one in backwards turns it to smoke because of the by-pass diode). So with both with fears of static electricity and mysterious handling damage, why bother with having to have a pull down to assure they are off or a pull up to assure they are on? They are just too sensitive.
So once again, it I am back to the 2N2222 as my preferred choice.
Sure I do have a few 2N3904 sitting around and often they are all I need. And I even have their mate, the 2n3906. But I have put a stop to buying more. And yet if I restock, I can buy 2N2222s and 2N2907s for the same price and complete more circuits with just one transistor rather than stages.
I do have power MOSfets (IRF540s) now and I finally understand that they are better than power Darlingtons. But I suspect I'll just drive them from a 2N2222 for the first stage rather than being "a purist" that uses the 2N7000 to drive a bigger MOSfet as an 'all MOSfet' solution. I can afford to waste a full milliamps for the sake of a lot less construction frustration.
And most importantly, these days my main goal is to have merely 5-6 transistors on hand that will nearly do everything. I no longer have to clone each circuit that I find on the web with hard-to-get transistors.
I'll save my opto-isolators for long transmission lines that might get zapped by lightning - I think that is what they were originally intended for. If you really, really are afraid of damaging your Propeller I/O, you should build your board using the 40 pin DIP Propeller, leave it out until after you have completed the board and after you have tested all the pins for wrong voltage and short circuit.
The opto-isolators are just like Linus's security blanket, excess baggage.
If I really, really must have isolation these days, there is nothing wrong with a 2N2222 driving a 12 volt mechanical relay. You can get some really rugged 40 amp automotive relays that love to wallow in mud and grease, but don't create the heat that a power transistor does. Of course they are slow, but so are the opto-isolators.
My only remaining dilemma is what to do with those chunky 2N3055s that thought would be so necessary for robotics.
Have I learned anything? I hope so.
I know just the thing. Use them to build yourself the Class-A amplifier audio amplifier designed by the world famous John Linsley Hood.
See here: http://www.tcaas.btinternet.co.uk/
You need the updated version from 1996 that uses 2N3055: http://www.tcaas.btinternet.co.uk/jlh1996.pdf
I have a bunch of 2N3055 just for that purpose, waiting on a decent heat sink arrangement.
Your robots need sound don't they?:)