Shop OBEX P1 Docs P2 Docs Learn Events
ULN2003 confusion — Parallax Forums

ULN2003 confusion

henrytjhenrytj Posts: 90
edited 2013-04-18 13:29 in BASIC Stamp
Thought I had my circuit worked out. I had watched a YouTube video where someone was driving relays directly from a UNL2003 without any resistor between them. So thinking that was correct and what the UNL2003 was made to do, I connected the UNL2003 outputs directly to my connectors for my old photo flash units. Testing out each connection one at a time with just one flash unit, it seemed to work great. But when I found my other working flash unit, and connected two flash units, each to separate UNL2003 channels, the flash units were both being triggered together, which is not what I wanted. After adding just a 100-ohm resistor (because I had a pack of them handy) it worked just fine. The flash units then triggered separately. So I apparently misunderstood the ULN2003 and how it's used. Now worried I may have risked some damage to the ULN2003 or Stamp, which seem to still work fine.

But, is 100-ohms enough? Problem is, I will likely be mixing different brand flash units on different ULN2003 outputs. My old flash units have 15V trigger circuits. Other newer, digital camera flash units will likely have 3-5V trigger circuits. A quick calculation, based on my limited recall of electronics, and guessing at the flash unit specs make me wonder if I should be using a 330-ohm resister on each output. I seem to recall when trying this project years ago I experimented with several resistor values when doing this with straight NPN switching transistors, that too high (like 1K ohm) resistors on the (collector, I believe) kept one of the old flash units from triggering reliably. So my old notes seemed to indicate that between 100 and 500 ohms worked, but this as based on experimenting and not on circuit calculation.

Also I am connecting the UNL2003 inputs directly to the Stamp I/O pin connections. Is that bad as well?

Yes, I'm doing too many things right now, being out of work and looking for a job, writing a sci-fi novel (I already have 10 short sf stories circulating the publishers) also trying my hand at screen plays (I have 2 registered screenplays now,) and trying to get a demo-reel short movie project going, all the while keeping a vigil to try to keep a mean-spirited neighbor (who can't seem to be reasoned with) from disappearing the couple semi-stray cats that I care for. Actually a third one, that I got fixed last year, has already gone missing. Thus my life is already filled with chaos, and trying to re-re-figure out this electronic stuff that I used to do.

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-09 18:00
    2003's have a built-in bias network, so they're OK for direct connection to a Stamp.
    (So, you can cross that off your worry list.)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-09 18:02
    The 2003's pin 9 needs to be connected to your flash tubes' +V, too.
  • henrytjhenrytj Posts: 90
    edited 2013-04-09 18:42
    PJ Allen wrote: »
    The 2003's pin 9 needs to be connected to your flash tubes' +V, too.

    That's the protection diode. But, not sure how to do what when I am using multiple flash units at the same time, which may have widely different voltages ranging from 3V to 15V, or even higher.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-09 18:50
    Maybe you could do that, but not with the pin 9.
    Probably just a separate diode for each across the relay to whichever supply.
    Those are Darlington outputs, they may not work out so well with lower voltage devices. Their collector-emitter saturation's being "1V" can take the P out of a 3V device.
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-10 06:44
    First off, resistors on the ULN outputs are not necessary for it to function properly. Secondly, if you are going to have multiple voltage requirements for the flash units just use another 4 CH relay board like the ones you were looking at on eBay. Power the ULN2003 (pin 8 GND, pin 9 V+ ) with whatever you are using to powering the STAMP and connect the ULN outputs to the relay board. Use the N.O. contacts of the relays for your flash units.
  • davejamesdavejames Posts: 4,047
    edited 2013-04-10 08:16
    Hey Henry - any chance of a schematic so we can "see" what you're attempting?

    Just for clarity's sake...
  • henrytjhenrytj Posts: 90
    edited 2013-04-10 16:28
    First off, resistors on the ULN outputs are not necessary for it to function properly. Secondly, if you are going to have multiple voltage requirements for the flash units just use another 4 CH relay board like the ones you were looking at on eBay. Power the ULN2003 (pin 8 GND, pin 9 V+ ) with whatever you are using to powering the STAMP and connect the ULN outputs to the relay board. Use the N.O. contacts of the relays for your flash units.

    First that doesn't seem to be the case. Without output resistors, one 15v flash unit was triggering another that was one, or two, channels over. So there is some kind of crossover going on somehow. Adding just a 100 ohm resistor on each output stopped that from happening.

    I am trying to keep the control box as simple as possible. As I am really in abject poverty. Right now, I have under $10 to my name until the next unemployment payment happens, which is a weak from now. My utilities are on the verge of being shutoff. It's the way my life seems to go. This is also why I never completed this project when I first started it almost 10 years ago. I just happen to find the box of that early effort recently when looking for something else. When I saw the ULN2003, I figured it would considerably simplify the completion. Like driving 7 channels for 50-cents total, rather than $5 each channel. I have looked for opto-isolators back then, but seemed I had trouble finding them.

    The other thing is that I also found two more old flash units I had actually forgotten about. These are portible flash units (Norman 200C) that are probably 20+ years old. Unfortunately they are large NiCad battery powered, and the one battery is dead, and the other had started to melt a decade ago when I last tried to charge it. So I will also be trying to figure out an improvised means of powering them. If I had money, I'd just buy all new stuff and be done with it, and not be here asking questions. But, my destiny seems to be a life of poverty. I have a degree in science, yet my last several part-time temp jobs have been warehouse labor. Go figure.
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-10 20:22
    First that doesn't seem to be the case. Without output resistors, one 15v flash unit was triggering another that was one, or two, channels over. So there is some kind of crossover going on somehow. Adding just a 100 ohm resistor on each output stopped that from happening.

    I'm not the type of person who claims to know everything about everything but I can tell you that resistors are not needed on the outputs of a ULN for it to function properly. The output pins of a ULN are all ACTIVE LOW, meaning the pin connects to GND when active. I have absolutely no idea how you wired everything up and what your loads are on the ULN. I suspect maybe your flash units are too much of a load for the ULN to handle. Typically a single output can sink up to 500mA but the more outputs that are active simultaneously decrease this limit exponentially. The maximum total limit of the ULN is around 1200mA for simultaneous pins that are active. Relays are the way to go when you need to drive a load that is too much for the ULN.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2013-04-11 09:35
    PropNut1960 is right. Resistors on the output are not necessary. There is 500mA per output available, however you cannot exceed max power dis. for the package. In other words, you cannot run all the outputs at max. As for alternatives, besides relays you could also use a FET. A FET would also negate any issues of voltage drop with the Darlington array, if that's causing your problems.

    P.S. - A chematic of what you have now could answer a lot of questions from those trying to help.
  • henrytjhenrytj Posts: 90
    edited 2013-04-12 11:26
    Alright, using my old copy of Adobe Illustrator, I did my best effort at a schematic. Not sure how clear it is as to what I'm doing. On unemployment, I really can't sink more than about $25 a month into this. I had hoped that the ULN2003 would save me by not having to resort to a relay or TIP120 ($4) for each channel. (50-cents for all 7 channels seemed maybe too good to be true.)

    Anyway, will try to link/load the schematic I tinkered together.

    Flash unit 1 is a Norman 400, unit 2 is a Norman 200C, and the 3rd is an older Canon Speedlite that usually attaches to the top of the camera. So far the resistors on the right-hand-side seem to work with 100-ohm.
    Schematic 1A6.png
    928 x 385 - 20K
  • henrytjhenrytj Posts: 90
    edited 2013-04-12 11:34
    As for diodes. I went to Radio Shack, and they have several kinds of diodes in their drawer. Zenier, rectifying, switching, etc. What kind is best to use for "protection" diodes?
  • henrytjhenrytj Posts: 90
    edited 2013-04-12 11:53
    As for the other part of this project of controlling several movie lights, would this kind of SSR work? (of course, one relay per light.) The auction claims free shipping, so I might get a couple next payment to see how they work.

    http://www.ebay.com/itm/Solid-State-Relay-SSR-25DA-25A-3-32V-DC-24V-380V-AC-for-Temperature-Controller-/400401748678?pt=LH_DefaultDomain_0&hash=item5d39cdd2c6
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-12 12:25
    No offense but you are not listening to what we are telling you. Your schematic shows 3 different voltages for the flash units with all of the positive sides connected to the ULN outputs. This is wrong. I stated in an earlier post that the ULN outputs are ACTIVE LOW which means they connect to GND when active, not positive voltage. You need to have separate power supplies for each of the different voltages you are using and connect the positive of each power supply to the corresponding flash unit. Connect all of the GND's together, including the Stamp and ULN. Make sure the current draw of your flash units doesn't exceed the limit of the ULN or you will need relays or some other means.
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-12 12:31
    As for the other part of this project of controlling several movie lights, would this kind of SSR work?
    Yep, those will work.
  • henrytjhenrytj Posts: 90
    edited 2013-04-12 12:54
    No offense but you are not listening to what we are telling you. Your schematic shows 3 different voltages for the flash units with all of the positive sides connected to the ULN outputs. This is wrong. I stated in an earlier post that the ULN outputs are ACTIVE LOW which means they connect to GND when active, not positive voltage. You need to have separate power supplies for each of the different voltages you are using and connect the positive of each power supply to the corresponding flash unit. Connect all of the GND's together, including the Stamp and ULN. Make sure the current draw of your flash units doesn't exceed the limit of the ULN or you will need relays or some other means.

    I think there is still a misunderstanding. For example, for Flash Unit #1 (the highest voltage unit) the 15V is not the power supply to the flash unit. That one is 120V-AC powered. It is the sync connector voltage. The flash unit maintains a voltage on the sync circuit, such that when the (+) of the sync circuit is grounded, then the flash fires. That is how the flash unit detects that it should fire. So when the STAMP raises its output pin to HIGH, then the ULN2003 darlingtion pair conducts the flash sync (+) to ground, and the flash fires so that it fires.

    This is different that the other application of controlling movie lights, which in the next project that I have planned. So I think the confusion is that there are two distinct and separate projects being discussed at the same time, which is my fault.
  • henrytjhenrytj Posts: 90
    edited 2013-04-12 12:56
    Sorry that I am confusing people by talking about two different application projects at the same time. They are both lighting oriented, but one uses flash units for still photography., the other movie lights for video. Sorry about that.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-12 15:33
    henrytj wrote: »

    Watch your pocketbook -
    Those solid-state relays are AC output devices (as in AC Output ONLY).
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-12 16:17
    The flash unit maintains a voltage on the sync circuit, such that when the (+) of the sync circuit is grounded, then the flash fires.


    All well and good but that means you have positive voltage going to the output pins of the ULN, not good. You need to isolate those circuits from the ULN, again, small relays will do the job for example. The 4 channel relay boards you referred to earlier (around $5 on eBay) would work nicely.
  • SapphireSapphire Posts: 496
    edited 2013-04-12 18:28
    All well and good but that means you have positive voltage going to the output pins of the ULN, not good. You need to isolate those circuits from the ULN, again, small relays will do the job for example. The 4 channel relay boards you referred to earlier (around $5 on eBay) would work nicely.

    Not true. The ULN2003 has an open-collector output, which can sustain up to 50V. This device doesn't source any current, it can only sink current through its outputs.

    Also, pin 9 can be left open if none of the outputs are connected to inductive loads.
  • PropNut1960PropNut1960 Posts: 23
    edited 2013-04-13 05:04
    Sapphire wrote: »
    Not true. The ULN2003 has an open-collector output, which can sustain up to 50V.

    I agree, but the fact that Henry was having issues before he added resistors to the ULN outputs shows that something isn't quite right here. Maybe it's slight overkill but personally, I would isolate those circuits. It's cheap and easy to do. I'm not saying there aren't other ways to make this work properly, I'm just saying it's the way I would do it.
  • henrytjhenrytj Posts: 90
    edited 2013-04-13 10:21
    Again, I apologize for the confusion that I am causing. I shouldn't be discussing two different projects at the same time. I was planning to use the Stamp/uln2003 combo for multiple applications. If the projects get too much more expensive than what they are, I may have to shelve the project again, to wait for better times (which hasn't happened for years now.)

    Anyway, I'll just resort to my old test and go with whatever seems to work, rather than cause an argument.
  • henrytjhenrytj Posts: 90
    edited 2013-04-13 10:46
    If I had the funds, I would be doing this differently, and probably not be on here asking questions at all. The reason why I'm here is because I have to improvise as much as possible.

    I returned home 15 years ago at my elderly mother's request and became her caregiver. It became a nightmare as her health got worse, and I discovered what a labyrinth it is to get assistance from the government. I wore myself out physically and mentally. Since her passing several years ago, I have been unable to get my life restarted again. So everything I do is 90% improvising. I actually built the project that I am working on now, the first time 10 years ago with a box full of TTL chips (counters, flip-flops, AND gates, etc.) I had when I was a kid, but my circuit maxed out at controlling only 3 flash units. (I should take a picture of it and post it.) Then when I bought the Basic Stamp kit at a Radio Shack store that was closing, I realized that I could do it so much better with a micro-controller. But I was smarter back then. I think I might have suffered a minor stroke near the end of being the caregiver for my mother as I was so totally stressed and exhausted. In going through some of my old math books I recall have once knowing how to do calculus, and frustrated as it seems so difficult to me now. It really is like I lost some of my faculties. And last couple years I can seem to find only part-time temp warehouse work. *shrug*

    Again, I am sorry for the confusion. And this is becomming more involved that I had hoped. I really thought the uln2003 would greatly simplify what I had tried to do in the past.
  • davejamesdavejames Posts: 4,047
    edited 2013-04-14 16:10
    Henry - I certainly sympathize with your apparent frustration, but do not feel poorly about asking questions; it's how we learn. And for not remembering past school work? DUDE! I find prior calculus homework papers in old text books with my name and my student number - and for the life of me - I have no idea what all the scribbles mean!

    Rest assured, the people here want to help so don't give up.


    Hang in man,

    DJ
  • henrytjhenrytj Posts: 90
    edited 2013-04-17 13:33
    Thanks for all the help. Last question (I hope.) What are the ideal diodes at Radio Shack to use for "protection" diodes? RS has rectifying, zeiner, switching, and a couple other kinds that I can't recall at the moment, in their DYI parts bin drawer.
  • henrytjhenrytj Posts: 90
    edited 2013-04-17 13:36
    And I'm trying to put together a KickStarter project for the art cost of doing a project. Hate that they you have to use some kind of transaction only through Amazon. Been fighting to get that set up. Seems they don't like something about my financial information. (Is it cause I'm in poverty?) I guess artists aren't supposed to be poor. Reminds me of the old bank loan joke that "you can't get a bank loan, unless you first prove that you don't really need it." But, hey, the give hundreds of billions of dollars to millionaire bankers. *shrug*
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2013-04-17 17:34
    henrytj wrote: »
    Thanks for all the help. Last question (I hope.) What are the ideal diodes at Radio Shack to use for "protection" diodes? RS has rectifying, zeiner, switching, and a couple other kinds that I can't recall at the moment, in their DYI parts bin drawer.

    Rectifier diodes.
    1N4000-type (1N4001, 1N4002, etc.) are fine.
  • henrytjhenrytj Posts: 90
    edited 2013-04-18 13:29
    PJ Allen wrote: »
    Rectifier diodes.
    1N4000-type (1N4001, 1N4002, etc.) are fine.

    Thanks.
Sign In or Register to comment.