Shop OBEX P1 Docs P2 Docs Learn Events
Running I/O s in Paralle to Source / Sink > 40 mA — Parallax Forums

Running I/O s in Paralle to Source / Sink > 40 mA

Juliet Oscar EchoJuliet Oscar Echo Posts: 31
edited 2014-12-19 06:00 in General Discussion
I know the 40 mA source / sink limitation comes up a lot when people want to drive a relay with the Propeller, but I've been wondering if it would be possible to drive a load of up to 80 mA by connecting the load to two I/Os in parallel and driving both I/Os simultaneously? I've searched the forum and haven't seen anyone suggest this approach.

I'm working on a project where I want to be able to power my GPS receiver module on and off. It draws ~32 mA at 3.3V, but can peak at over 35 mA. It's uncomfortably close to 40 mA, and I have no way of measuring instantaneous current when I first power the GPS receiver on. Using an NPN transistor switch on the low side won't work because the GPS module needs a small voltage to keep it from losing EPHEMERIS data when powered off (my GPS receiver module doesn't have a small battery commonly found on modules for this purpose). I could use a PNP transistor switch, but that's even more parts. If I can power the GPS receiver module via two I/Os in parallel to get a higher "safety margin" it will make for a much simpler approach. Thoughts?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-12-16 10:15
    I could use a PNP transistor switch, but that's even more parts.
    I'm not sure why you say that. If the GPS operates at 3.3V, you need only one transistor and a couple resistors. It's when the switched device requires a higher voltage than the Prop pin outputs that a second transistor is required.

    -Phil
  • Juliet Oscar EchoJuliet Oscar Echo Posts: 31
    edited 2014-12-16 10:24
    Phil,

    Thanks for your response. I definitely agree with needing only one PNP transistor because the load is at 3.3V and not a higher voltage. However I'm still curious to know if I can tie two I/Os together to source / sink twice the current? Why bother with a few extra components if all I need is two I/O s?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-12-16 10:33
    The problem with tying pins together directly is that they're programmable, and a program error could cause a bus conflict and, perhaps, release the magic smoke. Also, you're making a huge dent in the chip's overall output current budget, which is not the sum of the individual pin budgets, BTW. One possible way around the bus conflict is to use a pair of diodes, cathode ends to the pins. But that's two extra components already and a slight voltage drop. You might as well add a third component and do it right.

    -Phil
  • Juliet Oscar EchoJuliet Oscar Echo Posts: 31
    edited 2014-12-16 10:47
    Thanks Phil. Your answer makes a lot of practical sense. I had also forgotten about the output current budget. Just looked it up in the datasheet.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-16 11:51
    While one Propeller might might be able to stand up to 40ma under dire circumstances, I'd never attempt it. You are pushing the absolute limits. Under some circumstances, I might try to drive 25ma. But in most cases, I prefer loading my i/o under 5ma.

    Consider the fact that you have 28 pins. So if each is loaded at 5ma simultaneously, that is 140ma. Lets say that leaves another 160ma for actual internal Propeller operations. Seems about right with an overall package limit of roughly 300ma.

    Saving a transistor and destroying an i/o pin of the Propeller really is a step backwards. If you need to drive power, do it with power components -- not with Propeller i/o. You will get a lot more satisfaction out of your projects.

    A 2N2222 transistor will drive up to 500ma. If powered with 5VDC, that will supply 4.4VDC output. That should be enough for any 5VDC relay and costs pennies for protecting the Propeller i/o. If you dislike the 0.6VDC voltage drop, use a MOSfet.

    And I use the 2N2222 with a 12VDC power to drive 12VDC relays which come in larger sizes and more configurations. 11.4VDC after the drop is not noticed. Most of my 12VDC relays require 60ma to drive them, so the 2N2222 work just fine.

    (Yes, you might use Darlingtons. But they double the voltage drop to 1.2VDC and may run hot.)
  • JDatJDat Posts: 103
    edited 2014-12-16 12:31
    Learned by mistakes: always build electronics correctly
    Actually I hate lame schematics lying around in internet.

    For relays use ULN2007 or similar ICs.

    For noniductive load use this simple schematic (or search for ICs). It should be robust enought:
    load_drive.png


    *) How much load? 10A without problems! Actually it depends on P-channel mosfet. Choose the right one! Not too big and not too small. I like VISHAY SILICONIX SI8429DB for small appications.

    *) If Load supply is the same as for MCU (+5 for arduino, +3.3V for propeller), you can ommit R1,R3 and NPN transistor.

    *) Increase R1 value to save power in battery-based apications applications.

    *)For production try to use SMT components.
    425 x 390 - 5K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-16 12:36
    Besides the programmable I/O nature and chip current there is also the voltage drop to consider because you are essentially dealing with a combined Ron of ~20 ohms at best. Assuming it would still draw 40ma after this voltage drop you would only have 2.5V at best for the GPS. You can power small chips and even low-voltage LCDs with a single I/O but it just isn't practical or recommended even for 10ma due to the voltage drop although LEDs are current devices so you can drive them hard and the only concern about the voltage drop then is to take that figure into account when setting the current limit resistor value.

    If you ever need a very compact component to handle small loads then consider dual N+P transistors with inbuilt bias resistors such as the PUMD10,115 which you can hook-up as a NPN to PNP for higher source voltages or just use it as suits. Just one tiny SOT pack. http://au.mouser.com/ProductDetail/NXP-Semiconductors/PUMD10115/?qs=sGAEpiMZZMshyDBzk1%2fWiyXIlDzPapKNsXf0xhRMDA0%3d
  • DomanikDomanik Posts: 233
    edited 2014-12-16 16:09
    A 2N3906 & 5K is all you need ----for a 0.12V drop (saturated) at 54ma load.
    Connect E to 3.3V, C to GPS-VDD, B to 5K and other end of 5K to prop pin.
    Low turns on and open (input Read) or high turns off.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-12-19 03:08
    Domanik is right about the 2n3906, but some relay coils want 60ma or more. I found it easier just to use the 2n2222 to be sure.

    The UNL2007 and 2008 devices are Darlington pairs and that means they have a double diode voltage drop. They also are limited to something like 60ma per channel, though I have seen devices that doubled up on the channels to get more output (my last air conditioner controller board did this and ran fine for 5 years until the cooling coils rusted out).

    Everyone grabs the UNL2007 or UNL2008 for the simplicity of the package and wiring, but a 2n3906 or 2n2222 may actually perform better. MOSfet can work, but nearly all the good ones are surface mount. BJTs are still offered in TO-92 packages, along with the 2N7000 (that might work).

    AND, I want to emphasis that the Propeller data sheet asserts 300ma maximum for the Propeller. Driving 8 pins at 40ma goes over that and into damage. Adding power drivers is really a requirement of long project life.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2014-12-19 05:33
    Somebody here giving "advice" (ha-ha) does not know or understand the difference between VBE and VCE.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-19 06:00
    Domanik is right about the 2n3906, but some relay coils want 60ma or more. I found it easier just to use the 2n2222 to be sure.

    The UNL2007 and 2008 devices are Darlington pairs and that means they have a double diode voltage drop. They also are limited to something like 60ma per channel, though I have seen devices that doubled up on the channels to get more output (my last air conditioner controller board did this and ran fine for 5 years until the cooling coils rusted out).

    Everyone grabs the UNL2007 or UNL2008 for the simplicity of the package and wiring, but a 2n3906 or 2n2222 may actually perform better. MOSfet can work, but nearly all the good ones are surface mount. BJTs are still offered in TO-92 packages, along with the 2N7000 (that might work).

    AND, I want to emphasis that the Propeller data sheet asserts 300ma maximum for the Propeller. Driving 8 pins at 40ma goes over that and into damage. Adding power drivers is really a requirement of long project life.

    Right about everyone grabbing ULN2008s that's for sure. The trouble is the double diode drop is only on the base emitter voltage, the problem is the saturation voltage is never going to be better than 0.8V and more often over 1 volt due to the fact that the base of the second NPN of the darlington has to be fed from its collector via the first NPN, it can never ever get below the second Vbe drop + Vce(sat) of the first transistor. The current ratings given for them are extremely misleading as they are package/chip limited. Typically the datasheet says "500ma per driver" which doesn't mean 7 or 8 outputs at 500ma at all, no not at all. Number one, the saturation voltage figure at 350ma is 1.3V typical, or worse. that means there is almost 1/2 a watt of power being dissipated at 350ma per driver and if all eight were doing the same then that would mean you would have 4 watts trying to be dissipated, so the chip would not live very long at all, seconds perhaps. DIP thermal resistance is 70'C/W so at 4 watts it's a total meltdown, forget about 500ma then! So the datsheet gives you the facts but not the complete picture, you have to connect the dots to see what that picture is yourself. The TI datasheet at least says "(single output)" after stating 500ma per driver, but who would twig to what that meant?

    They use these chips for things like unipolar steppers where only one output is on at a time but it's just as easy to use discretes and resnets when you do SMT, it's cheaper, takes about the same space although you can spread it out as you need to, and it can handle much higher currents on all channels at the same time.

    BTW, most decent MOSFETs aren't available in TO92, the low Rds(on) devices have a larger die which doesn't suit the TO92 leadframe so ones like the venerable 2N7000 are only good for around 100ma with a 3.3V gate voltage. Practically all the safe operating range parameters are spec'd for 10V gate drive. That is why I sometimes use BJTs instead of MOSFETs at these medium current ranges as the transistors are easily driven hard from 3.3V, none of this "gate threshold voltage" which is quoted at microamp loads!!!
Sign In or Register to comment.