Driving Relays with TTL logic
« on: July 10, 2018, 01:25:50 PM »
Trying to wrap my head around using a uln2803 or uln2003 to control a series of normally open relays.
I need to energize the relay from a TTL low signal (0V).
TTL output is normally 5v but goes low when activated . Anybody have a schematic where something like this is done?

I'm trying to avoid using more components to invert the TTL signal.

Thanks!


ruffrecords

Re: Driving Relays with TTL logic
« Reply #1 on: July 10, 2018, 01:34:08 PM »
TTL outputs are normally high for true and low for false. What exactly are you driving the ULN2003 with?

A high output will turn on the Darlington and energise the relay.

Cheers

Ian
www.customtubeconsoles.com
https://mark3vtm.blogspot.co.uk/
www.eztubemixer.blogspot.co.uk


'The only people not making mistakes are the people doing nothing'

squarewave

Re: Driving Relays with TTL logic
« Reply #2 on: July 10, 2018, 01:40:08 PM »
Have you considered using digital drive? I have used L9823 in two projects with great results. It is 5V with sinks like you're looking for. But it is SPI so you would need a controller. But if you have more than 20 or so relays it's almost a must because you can control many relays from one bus which drastically cuts down on control lines. I use little 8 conductor FPC cables for data (not the fat IDC ones) and it's all very compact.

Re: Driving Relays with TTL logic
« Reply #3 on: July 10, 2018, 01:53:26 PM »
Thanks guys.

Control unit is a for remote control. The receiver uses TTL but is low activated. I'm trying to control an system that is -15v activated. Seven relays total.   I just threw a schematic together of what I was thinking but I don't think it's that simple.

JohnRoberts

Re: Driving Relays with TTL logic
« Reply #4 on: July 10, 2018, 02:06:11 PM »
you could drive the low side of a 5V relay...  so logic high is off, logic low is on.

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...

Re: Driving Relays with TTL logic
« Reply #5 on: July 10, 2018, 02:20:39 PM »
you could drive the low side of a 5V relay...  so logic high is off, logic low is on.

JR

Ok, that's kind of what I was thinking. Would that be accomplished like the schematic I posted or am I just way off base here?

JohnRoberts

Re: Driving Relays with TTL logic
« Reply #6 on: July 10, 2018, 03:10:46 PM »
Ok, that's kind of what I was thinking. Would that be accomplished like the schematic I posted or am I just way off base here?
did you try reading the data sheet for the uln2003?   It is inverting  (that's what the little circle means after the triangle). So logic low input would he high impedance (off) output.

You mention TTL logic, what is the impedance of your relay? You might be able to drive it directly with TTL as I first posted if it only draws modest coil current.

JR

John Roberts
http://circularscience.com
Tune it, or don't play it...

Re: Driving Relays with TTL logic
« Reply #7 on: July 10, 2018, 03:52:02 PM »
did you try reading the data sheet for the uln2003?   It is inverting  (that's what the little circle means after the triangle). So logic low input would he high impedance (off) output.

You mention TTL logic, what is the impedance of your relay? You might be able to drive it directly with TTL as I first posted if it only draws modest coil current.

JR

I did look at the data sheet but I didn't realize the uln2003 is inverting. That makes more sense and should work for my needs. I should probably just pick up a few and experiment.

I tried to drive the relay with the TTL output but it didn't work. 

I really appreciate the help.
Thanks,

Audio1Man

Re: Driving Relays with TTL logic
« Reply #8 on: July 10, 2018, 09:42:32 PM »
Put a PNP in the low side of the relay (Emitter), Base with resistor to the TTL, Collector to ground.
Duke.

Re: Driving Relays with TTL logic
« Reply #9 on: July 11, 2018, 10:05:52 AM »
Interesting but I was hoping to avoid the discrete approach since ultimately there will be 7 relays.
Frustrating thing about this is I know as soon as I settle on a design, I'll discover a chip that does exactly what I need.

Anyway, if the 2003 is connect at the common to +5v, when the input goes low the output should go high, correct?

Which was what I was originally planning but then I realized that chip can only sink current so I'm not sure if the 2003 can handle the task of driving the high side of a relay. I'm not sure where to look in the data sheet for that info.

This sort of design is new territory for me.
 I ordered some uln2003s and will be experimenting. Luckily they are about $1/piece!


JohnRoberts

Re: Driving Relays with TTL logic
« Reply #10 on: July 11, 2018, 10:36:31 AM »
do some more research, there may be a cheap non-inverting relay driver (where second inversion is built in).  Alternately you can drop a simple inverter in front of your inverting driver.

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...


squarewave

Re: Driving Relays with TTL logic
« Reply #12 on: July 11, 2018, 11:25:08 AM »
Maybe a more direct approach:



Yes, it's descrete but is that not better than using a bunch of ICs and relays?

I have not even sanity checked this circuit. It could be horribly wrong. This is just a dirty EagleCAD sketch. An opto isolator in place of the PNP would probably important.

UPDATE: p-chan mosfet is drawn upside down and R2 should be more like 22K or mosfet could spuriously flip off if there were a burst of EMI like from a flourescent light switching on.
« Last Edit: August 15, 2018, 10:11:03 PM by squarewave »

JohnRoberts

Re: Driving Relays with TTL logic
« Reply #13 on: July 11, 2018, 11:44:08 AM »
Maybe a more direct approach:

===

Yes, it's descrete but is that not better than using a bunch of ICs and relays?

I have not even sanity checked this circuit. It could be horribly wrong. This is just a dirty EagleCAD sketch. An opto isolator in place of the PNP would probably important.
Modern manufacturing math has flipped the calculus where more complex ICs can be cheaper to use than inexpensive discrete devices.  Consider a $0.05 cost per pop (touch)...   The 7x5 pops could easily be more expensive than a single driver IC.

For hobby DIY there is a different calculus... the 7x5 discrete components become almost 100 solder connections and opportunities to fail.

The OP is doing the right thing for a different right reason.

JR

PS: I love discrete design and have done tons of it over the decades but then was then and now is now.
John Roberts
http://circularscience.com
Tune it, or don't play it...

squarewave

Re: Driving Relays with TTL logic
« Reply #14 on: July 11, 2018, 12:07:11 PM »
Modern manufacturing math has flipped the calculus where more complex ICs can be cheaper to use than inexpensive discrete devices.
It's not about expense. Are you really recommending that he use a mechanical relays where simple mosfet would work fine?

JohnRoberts

Re: Driving Relays with TTL logic
« Reply #15 on: July 11, 2018, 12:22:40 PM »
It's not about expense. Are you really recommending that he use a mechanical relays where simple mosfet would work fine?
I am not designing a circuit for him....  he wanted to drive relays from TTL...

JR
John Roberts
http://circularscience.com
Tune it, or don't play it...

Re: Driving Relays with TTL logic
« Reply #16 on: July 11, 2018, 04:09:44 PM »
Thanks for all the input! I'm sure there is more than one way to skin this cat.

I am using relays mainly because I understand them a little better. I'm open to other suggestions as this is a learning experience for me.

Newmarket

Re: Driving Relays with TTL logic
« Reply #17 on: July 18, 2018, 10:51:10 AM »

I tried to drive the relay with the TTL output but it didn't work. 

I really appreciate the help.
Thanks,

Cheap and 'dirty' but you can simply parallel logic to increase output drive - literally solder ics on top of each other. Though not so easy if SMT rather than thru hole. You probably 'shouldn't' - current sharing etc etc but you can  :o

Scodiddly

Re: Driving Relays with TTL logic
« Reply #18 on: August 15, 2018, 08:14:44 PM »
If you don't explicitly need a relay, then a solid state approach can save space, power, and money.   8)

A year or two ago I built a simple little battery-backup sump pump controller based on a microcontroller. Spent some time struggling to get a relay to work, then finally switched to a MOSFET which worked much better in the application. I was able to switch that with an optoisolator and avoid dealing with all the crap that happens when you switch a big inductive load on and off.

Scodiddly

Re: Driving Relays with TTL logic
« Reply #19 on: August 27, 2018, 10:38:49 PM »
So now I've put my foot in a little far... next project is a microcontroller-controlled lamp using those LED "filaments" found in vintage-style bulbs. They run at 80vdc or so, and in the typical bulb there's a bridge rectifier on the 120vac (USA power) producing some 160vdc, into two filaments in series.

In a nutshell, I'm going to want to have a FET switching 160+ DC volts, really not very much current at all (maybe 10 watts = 62mA), at PWM dimming speeds, and from a 3v logic output.  I guess the party starts with an optoisolator.


 

Related Topics

  Subject / Started by Replies Last post
9 Replies
1360 Views
Last post April 10, 2005, 09:34:59 AM
by VacuumVoodoo
12 Replies
1857 Views
Last post July 11, 2005, 03:40:16 PM
by CJ
15 Replies
4344 Views
Last post August 14, 2012, 02:40:40 AM
by Andy Peters
8 Replies
3283 Views
Last post November 12, 2012, 10:33:01 PM
by PRR