Using TTL Gates from computer software to control a light, current limiting? Pull up resistors?

JohnInTX

Joined Jun 26, 2012
4,787
If the photocoupler is on (5v), then the +5v logic will go to logic ground and not the inverter?
Technically, when the phototransistor is ON (input LED is lit) the circuit applies a logic 0 to the input of the first inverter. That inverter will respond by making its output '1' (5V). At that point, the 'OK' relay will turn OFF (5V on both of its inputs - a net 0 volts). The '1' from the first inverter is also applied to the input of the second inverter. That inverter will respond by making its output a logic 0 (0V). It does this by turning on an internal transistor to ground - so it sinks current. That ALARM relay will then have 5V on its + input and ground on its (-) input (through the inverter's output transistor), a net 5V and it turns ON.

Also, would I be able to add another opto at the end of the inverters to output the final 24vdc I need? Just wire the logic signal to the ground and have the positive signal as +24vdc from a power supply?
The 24V stuff happens at the relay outputs as in your original drawing. Presumably, when the relay is ON, a 24V (from a separate 24V supply) light/buzzer etc. gets turned on. You need the relays as the logic is 5V only - attempting to switch 24V with TTL logic lets the smoke out.
 

AnalogKid

Joined Aug 1, 2013
11,055
The schematic in post #17 has n error. The input to the non-inverting buffer (far right, center) should be connected to the left side of the pullup resistor Rpull-up.

Also, with optocouplers on each input you no longer need OR gates, or any logic gates. All logic can be implemented in one transistor. Schematic to follow.

ak
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Technically, when the phototransistor is ON (input LED is lit) the circuit applies a logic 0 to the input of the first inverter. That inverter will respond by making its output '1' (5V). At that point, the 'OK' relay will turn OFF (5V on both of its inputs - a net 0 volts). The '1' from the first inverter is also applied to the input of the second inverter. That inverter will respond by making its output a logic 0 (0V). It does this by turning on an internal transistor to ground - so it sinks current. That ALARM relay will then have 5V on its + input and ground on its (-) input (through the inverter's output transistor), a net 5V and it turns ON.


The 24V stuff happens at the relay outputs as in your original drawing. Presumably, when the relay is ON, a 24V (from a separate 24V supply) light/buzzer etc. gets turned on. You need the relays as the logic is 5V only - attempting to switch 24V with TTL logic lets the smoke out.
I know its difficult to convert 5v to 24v. But the LEDS I have to use are 24v. That's why I wanted to use that optocoupler as in my original drawing (Phoenix contact, Part no. DEK-OV-5VDC/24VDC/3). It is expensive, but it allows you to convert 5vdc to 24vdc. Is there any other way I can convert the voltage?

I could always use the PS2501-4 for the 5v switches, as in your drawing, and then just use the Phoenix octos to trigger the 24v?

What is your thoughts?
 

JohnInTX

Joined Jun 26, 2012
4,787
I could always use the PS2501-4 for the 5v switches, as in your drawing, and then just use the Phoenix octos to trigger the 24v?
What is your thoughts?
Those are actually my thoughts too. The PS2501s don't replace the Phoenix Opto Relays - they just protect the inputs and perform the OR logic function due to the way they are wired. Of course, you still need the Phoenix relays to drive the heavier 24V load. The Phoenix Opto Relays are denoted on the sketch as the ALARM/OK relays (only the input side is shown, the 24V output side is as per your original drawing).

Gotta go to juries and a performance. Prototype or simulate the sketch and see what happens.

Good luck
 

AnalogKid

Joined Aug 1, 2013
11,055
Here is a schematic of the simplified logic. If any or all of U1 through U6 are activated, then U7 is on. If all of U1 through U6 are off, then U7 is off and U8 is on. U1-U8 can be segments of quad devices such as a PS2501-4. If U7 and U8 are external DEK opto-relays, then R1 and R3 are not required.

The DEK parts are very expensive. Two questions:

1. What is the current required for the external LED's?

2. Does the control circuit we're working on have to be isolated from the LED's, or can we replace the two DEK parts with power transistors?

ak
 

Attachments

AnalogKid

Joined Aug 1, 2013
11,055
Yes it is an inverter. A 7404 will work, but why use a 14 pin part when a 3 pin smaller cheaper more reliable part will work?

Attached is a modified schematic with direct drive to the LED loads. Same basic idea, the input optos wire-OR into one load switch, and an inverter stage drives the other load switch. Having the logic run on 5V and the load run on 24V is not a problem, but in this version the two power source grounds must be connected. If you want to use power darlingtons to replace the DEK relays but keep the ground isolation, that is an easy combination of my -1 and -2 output stages.

ak
 

Attachments

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Last version. DEK devices are replaced by optocouplers and power darlington transistors. $5 instead of $140.

ak
I just noticed you put one more drawing up. So in the third drawing, I can just connect the 24vdc source that's connected to the LED to the octo and it will be fine? So would I still have to do some type of isolation between the two voltages?
 

AnalogKid

Joined Aug 1, 2013
11,055
The isolation question can be answered only by you. It's your project, and we don't know all the details. An overall system wiring diagram would help.
-1 is isolated, expensive, and is the least amount of circuit assembly.
-2 is non-isolated and much lower cost than -1.
-3 is isolated, still much lower cost than -1, but more work than -1 because you are building your own isolated relays.

ak
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
The isolation question can be answered only by you. It's your project, and we don't know all the details. An overall system wiring diagram would help.
-1 is isolated, expensive, and is the least amount of circuit assembly.
-2 is non-isolated and much lower cost than -1.
-3 is isolated, still much lower cost than -1, but more work than -1 because you are building your own isolated relays.

ak
thank you for all your help!! its greatly appreciated!!!
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
The module that will input into the circuit (0-5v dc signal) is the NI SCB-68. The software will output to this device and then input the signal into the circuit you guys have been helping me with. Not knowing how much current will output from this device can make it difficult to determine resistor values.

If you guys have any more suggestions please let me know. Thanks!
 
Last edited:

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Hey guys, I hope you can help me with one more question...

This is the details of the 5v power source from each station that will be used. What would be the best way to determine the resistors?

JohninTx - In your example you had stated the source was 5v @5mA, so given these values would there be no change?


Output coupling...............................DC
Output impedance............................0.1 Ω max
Current drive....................................±5 mA max
Protection.........................................Short-circuit to ground
Power-on state .................................0 V (± 200 mV)


Output low voltage
(IOL = 24 mA)
0.4 V
Output high voltage
(IOH = –13 mA)
4.35 V


Also I wired JohninTx example first. (I'm still waiting on Analogs parts to arrive). The circuit worked good, but the high output of the inverter chip was only 4.35v. I know I am supposed to hook that line up to the negative line (just for logic purposes), but I still don't understand how inputting 5v into the positive side and then 4.35v into the ground side can be good for the LED.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Those are actually my thoughts too. The PS2501s don't replace the Phoenix Opto Relays - they just protect the inputs and perform the OR logic function due to the way they are wired. Of course, you still need the Phoenix relays to drive the heavier 24V load. The Phoenix Opto Relays are denoted on the sketch as the ALARM/OK relays (only the input side is shown, the 24V output side is as per your original drawing).

Gotta go to juries and a performance. Prototype or simulate the sketch and see what happens.

Good luck
JohnInTx,

In the diagram you gave me, I wired it and I have blown two channels on two different chips thus far. I don't know if its a coincidence, but it was the same "diode and transistor" but on different chips. I have three "channels" hooked up to each chip and both sections of each chip have went out.
upload_2015-5-21_8-2-48.pngIt was pins 1,2,16,15 that went out on both chips. I wired exactly as you said with the resistors and everything. The power supply I'm using is 5v to power everything. Please let me know what you think
 

Attachments

JohnInTX

Joined Jun 26, 2012
4,787
Are you sure its wired correctly? It shouldn't blow anything if so. Be sure that the opto package is in the right way - IIRC, the markings for pin 1 are faint.
Can you post a schematic drawn from your actual circuit with pin numbers/values etc. or better - take a decent photo of the wiring to take a look at?

On the original sketch, the pin numbers should be:
LED
1 top +5V
2 bottom GND
PHOTOTRANSISTOR
16 collector to 33K resistor
15 ground
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Are you sure its wired correctly? It shouldn't blow anything if so. Be sure that the opto package is in the right way - IIRC, the markings for pin 1 are faint.
Can you post a schematic drawn from your actual circuit with pin numbers/values etc. or better - take a decent photo of the wiring to take a look at?

On the original sketch, the pin numbers should be:
LED
1 top +5V
2 bottom GND
PHOTOTRANSISTOR
16 collector to 33K resistor
15 ground
John, Thank you for all your help. I have determined I believe the chips are defected. I've wired four PS2501-4's thus far and all the 1,2,15,16 pins don't seem to be working. But all the other pins are ok. This is strange, but at least some on the "channels" work. Thanks again for all your assistance!!
 
Top