Shop OBEX P1 Docs P2 Docs Learn Events
High signal to low signal using ULN2803A darlington array? — Parallax Forums

High signal to low signal using ULN2803A darlington array?

BlakeBlake Posts: 74
edited 2011-08-12 13:01 in Accessories
Hey,
I just want to make sure this is right before I destroy anything:

I have often used the ULN2803A darlington array chip to trigger a 24V relay from a 5V stamp signal. No problem here. Now I want to do it the other way: 24V to 5V. I did this on a breadboard and it seems to work. A 24V signal to trigger a 5V output. I just hook up 5V to COM and 0V to GND, send 24V on the input side, and sink 5V on the output.

The datasheet (http://www.ti.com/lit/ds/symlink/uln2803a.pdf) says max input is 30V and collector-emitter max is 50V so my setup seems okay. But I haven't been able to find any sources talking about using this chip to go from a high signal to a lower output. Is this really okay?

Thanks,
Blake

Comments

  • alex123alex123 Posts: 102
    edited 2011-08-10 10:52
    It seems ok to me too. The 12V is not even close to the maximum input rating. I would live the COM open (unless it's some inductive part you're driving e.g. relay) and add a pull-up if it's not only to sink current. If the 5V input is low current (like a digital input pin) I'd just use a 2 resistor voltage divider and a zener diode for protection.

    Other than that you're good... :D
  • BlakeBlake Posts: 74
    edited 2011-08-10 11:02
    good point. I guess it just seemed safer to have another whole chip between 24V and my microcontroller, but that's illogical, and the resistor voltage divider is easier to implement.
  • ercoerco Posts: 20,255
    edited 2011-08-10 11:03
    Or if you need high current, just feed your 24V into a 7805 vr and be done with it.
  • alex123alex123 Posts: 102
    edited 2011-08-10 11:14
    That's 24V. I lost my reading glasses....

    You're close to 30V rating then. Is the chip getting hot when 24V is on for a long time? Verify that. You're using just one input so you should be fine.

    Funny idea about the voltage regulator btw. Would it be slow like hell? I wonder what would happen on the output when the 24V rise time is slow too. Just courious...
  • BlakeBlake Posts: 74
    edited 2011-08-10 11:17
    don't need to pass current, just a voltage signal to a microcontroller input. I was wondering about the speed of sending it through a regulator like erco said. Alex, the ULN does not seem to be getting hot. But I'm not really passing any current.
  • alex123alex123 Posts: 102
    edited 2011-08-10 11:20
    To combine the regulator idea, safety and simplicity I would use a series resistor and 4.8V zener to ground.... Just a thought...
  • alex123alex123 Posts: 102
    edited 2011-08-10 11:24
    You're right. I noticed the speed issues with 7805 and maybe some instablity on the output during the 24V transitions.

    How about an optocoupler? That's really safe and cheap...
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-08-10 11:41
    Voltage divider
    +24---220KΩ---47K---Gnd
    Output across 47K = 4.2V
  • alex123alex123 Posts: 102
    edited 2011-08-10 11:47
    I was talking about the chip getting hot because of the bipolar transistors there not the output current. I hardly use bipolars nowdays but I remember from school that the BE junction will never go above 0.7V. Hence the series resistor on the base. The higher the voltage on the base the bigger the resistor to drop the voltage to .7. The base current is the gain (beta or h21 - don't remember) less than the current sinked in the collector. This is how you calculate that resistor on a single bipolar transistor for a simple on/off switch... It's getting even more interesting with a darlington pair...

    If it's not hot you're good to go...
  • alex123alex123 Posts: 102
    edited 2011-08-10 11:52
    Now I lean more toward the optocopuler idea as a safer solution PJ. The one that has a transistor on the output will work just fine. Need to calculate the photodiode series resistor based on the part's datasheets. The pullup of 10k should work fine with the CMOS input on the transistor side.

    Actually, that same approach will work perfectly in the other direction 5->24....
  • alex123alex123 Posts: 102
    edited 2011-08-10 12:28
    Blake, One more thing...
    Now that I know that you're feeding a digital input with this thing I would recommend to use the 10k pullup to 5V. Since you connected the COM pin to 5V it gave you some weak pullup and therefore you test circuit worked. The diode is too weak though. It will give you something like 10M Ohm or more. That's an order of magnitude too high. If you touch this input with your finger it my transition back to logic '0'. Use 10k there unless you're sure that your digital part has an internal pullup...
  • BlakeBlake Posts: 74
    edited 2011-08-10 12:55
    Thanks for the advice Alex. I'll have to think about it some more and decide which way to go. The ULN2803A seems like overkill now for just one input.

    Thanks,
    Blake
  • alex123alex123 Posts: 102
    edited 2011-08-10 13:04
    Yup, it pays off to ask questions... Go for the logic output optocoupler - DIP-6 like this:

    http://www.fairchildsemi.com/ds/H1/H11L1-M.pdf
  • ercoerco Posts: 20,255
    edited 2011-08-12 09:54
    For input to a uC, the simplicity of the suggested resistor voltage divider makes perfect sense.
  • alex123alex123 Posts: 102
    edited 2011-08-12 13:01
    I suggested the voltage divider but an optocoupler seems safer unless you can guaratee that the 24V is always 24V and not 2000V because of an ESD or a storm in the area. It all depends where is the 24V is coming from, how long is that wire etc. It's easier (and cheaper) to replace an $1 opto IC than a Propeller chip for example...
Sign In or Register to comment.