Source or sink?
MJHanagan
Posts: 189
Hi everyone - I need some guidance on using the Propeller's I/O pins to drive some devices. According to the manual each of the Propeller's pins can source or sink up to 40 mA of current. I have an application where I am driving the input LEDs on a series of optoisolator TRIAC drivers and a few ZC SSRs most of which require only about 20 mA of current to activate. Some of these devices activate 120VAC power so having them trigger on during a reboot would be problematic as well as a possible safety concern.
I currently has a Propeller running a series of power transistors that witch some small inductive loads. I am using the Prop's pins to source the base current to these transistors and have noticed that some (not not necessarily all) are activated during the boot-up process as well as when I end the Prop's run.
As a matter of good practice how should I prevent this false triggering during the boot-up/reboot process as well as leave the devices off when I power down?
I currently has a Propeller running a series of power transistors that witch some small inductive loads. I am using the Prop's pins to source the base current to these transistors and have noticed that some (not not necessarily all) are activated during the boot-up process as well as when I end the Prop's run.
As a matter of good practice how should I prevent this false triggering during the boot-up/reboot process as well as leave the devices off when I power down?
Comments
Check the actual values of sourced current, as the Data claims this :
["Reset (active low). When low, resets the Propeller chip: all cogs disabled and I/O pins floating. Propeller restarts 50 ms after RESn transitions from low to high."] and gives < |1uA| leakage figures.
A pull down may be needed to know the pin-state.
Something I feel that's important to note here about BJTs and MOSFETs:
BJTs draw constant current proportional to the gain of the transistor. That is, if you have a 100:1 gain, it will draw 1ma for 100ma switched, constant. If you do not have any current limiting in place on the base of the BJT, it can draw too much current from the port pin, up to the limit of the load on the BJT, at least until something breaks.
A MOSFET will draw a gating current from the device controlling it, but once switched on it falls back to a not so significant holding current. MOSFETs have a gate capacitance which will act like a capacitor charging from the controlling device, without a current limiting resistor you will see a large surge of current as the gate charges up, this can exceed what the controlling device can supply and lead to failure.
Both BJTs and MOSFETs can be driven in a non-linear region, dissipating energy in the switching device, as switches this is not typically desired, thus the use of PWM. PWM drives the switching device hard, so it switches on quickly, limiting the amount of time the device is in the linear region.
Something I want to repeat again, because I feel it cannot be understated: BJTs draw a constant base current proportional to the switched current while the device is on. MOSFETs draw a large gating current, but have a very small hold current.
@MJ: You didn't say whether those transistors you had were BJTs or MOSFETs and in fact you didn't really tell us anything. A schematic speaks volumes as does source code. BTW, please make sure you understand datasheet terminology correctly. If the specs say "sink or source 40ma max" then it also says within these Voh and Vol limits too as you cannot expect the voltage to be unaffected.
As for start-up transients this could depend upon the power supply rise time as there shouldn't be any since the Prop's I/O are floating at reset. It is always a good idea to add pull-down resistors to the gates of MOSFETs and even possibly BJTs although they really need current to operate (which can't come from a floating pin). However you will see that adding them is common practice. Double check your start-up code by manually stepping through the source and pretend you are the Propeller chip. Interpret each instruction literally and you might even find that the "glitch" has nothing to do with the Propeller but has more to do with what you are telling it to do.
That depends on the BJT :
If we take a small generic TO92 darlington, like this one
http://www.onsemi.com/pub_link/Collateral/MPSA27-D.PDF
the Fig 3 shows it can get close to saturation on 100mA drive, with just 1uA (!) of base current.
Such a device would need a pull down (and series base drive) resistor.
Notice, that the Collector to Emitter saturation voltage is 1.5 Volts.
You don't get that low base current without a cost, in this case a relatively high saturation voltage.
Duane J
I agree that the curve is non-linear to a degree, but to sweepingly say that the base current has no bearing on the collector current is ignoring the fact that transistors have gain which is proportional to the base voltage/current.
Hi pedward, I think where you are going awry is your statement " BJTs draw a constant base current proportional to the switched current while the device is on" which is rather back to front in that the maximum collector current can be proportional to the base current so that a BJT with a Hfe of 100 will sink a maximum of 100ma for 1ma of base current. But just because you are only drawing 20ma collector current does not mean that the base current will go down proportionally as the base current is dependent (simplistically) upon the drive voltage minus Vbe (~0.6V) divided by the base resistor.
We do not know what exact transistor the OP is using.
Also note the ULN2003 is a darlington array, and is very widely used to drive 'small inductive loads'
See Fig 3 in the Data sheet, Vce sat is well under 1.6V : Remember it trends to ONE Vbe, not two. So 800-900mV
I doubt anyone would run a 500mA darlington at 500mA, but using a 'small inductive load' figure region of 100mA-250mA, we have at 100uA of Ib, power values of ~ 80mW and ~220mW
Also, do not dismiss Darlington power loss too quickly.
It does not come from the low voltage rail, so is not as bad as it may seem.
Suppose a 24V supply and a 100mA Load, with a single bipolar device, with a forced beta of 12.5, and a linear regulator.
Your drive power budget is 192mW, most of which heats the linear regulator.
So a Darlington device offers a lower total power loss, and much lower regulator power impact.
In good engineering practice one would not violate the printed "Max/Min" "ELECTRICAL CHARACTERISTICS" on the data sheet.
Graphs are useful to help see how the part works but these are only approximation based on "Typical" characteristics.
OK, I violate the "Max/Min" specs all the time when looking at a single part on an individual basis. However, I would not be surprised if a part did approach the maximum value.
Duane J
However much I enjoy a little friendly banter on a subject it just seemed that this "far-fetchedness" confuses the OP when a simple "show us the code and schematics" would clear up a lot of conjecture.
Did you not bother to look at the actual data sheet I gave a link to ?
http://www.onsemi.com/pub_link/Collateral/MPSA27-D.PDF
Take a look at Fig 3, and you can see exactly what this real device will do.
Sure, the 1uA is a data sheet figure, but one cannot do a design HOPING things will be way better...
[Indeed that 1uA is the first to go, on poor handling, or even moisture, and yet things will otherwise 'work ok' ]
My posts are to prove you cannot assume anything, and really Do need to read a real data sheet every now and then, (and also run some
system mW numbers, when sniffing at Darlingtons).
The OP stated he had strange things happening, viz "have noticed that some (not not necessarily all) are activated", but forgot to tell us the devices. I've given a possible explanation, supported by the data, and notice he said SOME only..
Another reality check : (yes, I have used super-beta BJTs, and also MOSFETS ) is they are not cheap, and tend to be low voltage :
@ Future :
MPSA27RLRAG 60V 2000 : $0.0319
PBSS4021NT,215 20V 3000 : $0.127
NOOB? Naive, Ignorant, Obstinate?
This highlights the difference between possible and plausible. It is possible to have a high-gain darlington without cutoffs glitched by leakage current but it is highly implausible that this would ever be the case. But then again........
Anyway, the discussion I hope is a healthy discussion. Even in jest I wouldn't bandy about any derogatory remarks. Everyone has a valid point and we are only looking for good to come out of it, aren't we?
The moment we clam up is the time to forget about participating on the forum. (NO NO NO)
Perhaps someone who posted this ?
[ "have noticed that some (not not necessarily all) are activated"...] - the report suggests either a MOSFET, or Small Darlington, sans resistors.
Here is a link to the transistor datasheet (http://www.fairchildsemi.com/ds/TI/TIP122.pdf). I think the 200 ohm resistor between the base and the Prop pin shoudl limit the current to about 20 mA (Vbe ~ 2V and an hfe>1000).
If you hold the Prop in reset, does this still apply ? [ "have noticed that some (not not necessarily all) are activated"...]
Use a multi-meter to find why only some are activated - all prop pins should be the same (floating) state in reset.
The TIP120 NPN darlington transistor will, acording to the spcc, disipate about 6 6 watts of power so will require a heatsink, escentially negating any cost savings from its low cost. Besides there will only be 10V across the 12V relay.
A much better solution is to use an IRF3708 MOSFET. It is guaranteed to have 0.029 ohm on resistance driven with 2.8V. Even better at 3.3V.
The power dissipated would be about 0.34 watts. This will not require a heat sink.
Duane J
Here's a dual logic level N-channel 8A MOSFET that costs only 55 cents in one off quantities but there are plenty to choose from. At 5A load it will drop 100mV with 3V gate drive. I use similar ones to drive solenoids.
The concerns for the safety and control of the system would seem that rather than relying on some possible design characteristics which can vary depending on design and component characteristics, he would be better served going the route of an inline safety circuit whether the mechanical (relay) or electronic type. Every X-ray system I have ever worked on and also all mechanical control systems for tables, single and bi-plane Card/angio system as well as CT have a safety circuit built into the design that will absolutely NOT allow activation/power sourcing until specifically enabled by a fully initialized system. Look for the term Safety Contactor for example. It should be of a fail-safe design that can not be enabled with out a very specific signal or enable command. Other systems such as those using PWM and multiphase variable frequency motor systems, the mains supply to the power supply / power circuit is separately switched either electronically or via relays depending on Voltage/current/power requirement.
Understanding the esoterica is important, but the designer must ultimately make the risk analysis and see where on the spectrum from an elegant maybe tricky design to full on brute force failsafe. This is not a slap at the previous posts in this thread, just a redirect to the initial question of as far as possible assuring the safety / risks of an intended function.
Frank
Throughout the thread we were "discussing" what the cause could be but without sufficient input from the OP therefore the "exotica" I guess. This does not sound like an X-ray system or a safety critical system as it would not be discussed at this level on the forum. From the rough sketch that was supplied etc we are making recommendations appropriate for someone inexperienced in these matters as it is also necessary to address associated areas of concern. At a professional level I completely agree with the statements concerning safety critical operation which however would not seem to be applicable in this case.
Agreed probably not x-ray dangerous, but 120VAC can be as dangerous. Since we can't always tell if the poster is some bright middle schooler or another PhiPi, I tend to suggest on the side of safety, especially electrical so as not to encourage bad or dangerous practices.
FF
Yes, might even put an eye out.......
No, wait.. That was for BB guns..
Nevermind....
However, I do have another application I am working on which involves some 120VAC power so what I learn here will be applied to that application. This next project is geared towards kids (controlling a toy train) so I do want this to be relatively failsafe. For this application I need to send 120VAC power to a nominal 80W transformer. Again, not a major application but I do want to be sure I don't accidentally send 120V power unless it is intended.
I like the MOSFET device and at $0.55 each I'm inclined to buy a set of ten!
I need another day or two before I can get back to measuring the pin outputs during the reboot/reset conditions. I will post the results as soon as I get a chance to measure.
I appreciate all the feedback on this - it is very helpful.
After moving to pins 11..15 the problem went away so there is no false triggering with a "normal" Prop pin!
Thanks for all the input and suggestions!
NEW POSTING RULE
Please do not provide sufficient information to actually solve the problem, but please tell us your observations and frustration. This is to make sure that forum members do not miss out on a little educational entertainment (why else do they answer posts?).
DISCLAIMER: Parallax takes no responsibility for: a) loss of hair b) time lost in misdirected research c) dangerous X-rays emanating from a thread