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

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
You might consider PC2501-1. 4 of these individual opto pairs will stack in the same 16 pin DIP pattern the -4s do.
I ordered some of the 4N38's that AnalogKid recommended. I suppose these will work the same way as the PS2501-1's. I will give it a shot when they arrive.

Again I just want to be certain. I know you already explained it, but after the inverter logic, would you suggest using another opto to eliminate a voltage onto the ground of the DEK Phoenix relay? This would just closed the logic and complete the circuit
 

JohnInTX

Joined Jun 26, 2012
4,787
I ordered some of the 4N38's that AnalogKid recommended. I suppose these will work the same way as the PS2501-1's.
More or less. You'd have to pull the datasheet to see what the CTR is. I would hesitate to change optos just because of smoking the PC2501's. If you are killing them, as opposed to just having defective ones, you'll kill the 4n38's too. As written, the schematic I posted will work. AK's will as well but he used additional optos to do the inversion function - I used 'LS04s.

You shouldn't need any additional optos driving the relays - their inputs are already isolated from their output. But looking at the 11ma current the relays want, the LS04 is a little light as a driver.

Get the input section decided and working - so that any 5Vin gets the optos' collector node pulled low - and we'll look at the relay drive.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
More or less. You'd have to pull the datasheet to see what the CTR is. I would hesitate to change optos just because of smoking the PC2501's. If you are killing them, as opposed to just having defective ones, you'll kill the 4n38's too. As written, the schematic I posted will work. AK's will as well but he used additional optos to do the inversion function - I used 'LS04s.

You shouldn't need any additional optos driving the relays - their inputs are already isolated from their output. But looking at the 11ma current the relays want, the LS04 is a little light as a driver.

Get the input section decided and working - so that any 5Vin gets the optos' collector node pulled low - and we'll look at the relay drive.
Thanks John! I'll reply sometime next week. Have a good holiday weekend!
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
You too.
Just finished dry-rubbing the brisket....
Here is a few pictures of the circuit I wired. The resistors that are not connected are the 700 ohm that get connected to power when I want them to "switch". They all worked and had the same voltages and resistances, except for the fifth one from the left. I think there is at least one diode/transistor defective on each chip. Because I did nothing wrong to burn it out. Every chip thus far has had a defective section. But I did order some of the PS2501-1's, should be here after the holiday. Also bought some LEDs too just so I can visibly see how the lights will react.

I added one opto after the inverter chip to mimic the "5v-24v" optos. Just to get an idea of that the final result would be.

I forgot to add the voltage drop across the 700 ohm resistors. its a voltage drop from 5.00v -> 1.139v. Is this sufficient enough for the LED? Given I'm not sure how my final source will be, but its definitely not a power supply, but according to the data sheet of the software, its pretty similar (output current and voltage wise (current drive = +/- 5mA, 0v-5v signal)) .

Also, the "defective" channel on the middle chip, the voltage drop across the resistor is 5.00v --> 2.594v. Much higher than the other channels. Other than that, the circuit works great.

Enjoy the long weekend and your brisket! (I'm very jealous, brisket is very very delicious) !!!
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
I added one opto after the inverter chip to mimic the "5v-24v" optos. Just to get an idea of that the final result would be.
You have a couple of problems there. Keep in mind that the LS04 sinks current, it won't source much. To make the demo opto work connect the anode (pin 1,3,5, or 7) to +5V through a resistor (700 ohms will work). Connect the cathode (2,4,6, 8 respectively) to the output of the LS04. That way, when the inverter output goes low, it will provide a sink path to ground and turn the opto LED on. But you don't need the whole opto here, just use a visible LED (hooked up the same way). When the LED lights, consider the relay ON.

I forgot to add the voltage drop across the 700 ohm resistors. its a voltage drop from 5.00v -> 1.139v.
If the 1.139V is across the LED (pins 3-4 et al), that's correct. You are measuring the forward voltage of the on LED. Keep in mind that the LED is a current operated device. You have to apply enough voltage to make Vf but after that its current that does the work and Vf is relatively constant. That's why you need the 700 ohm series resistor, to limit the current to the LED. The 2.594V value is about what you'd expect if the LED were open. In that case, the two resistors just form a simple voltage divider.

FWIW On the resistors across the LEDs you can make it easier if you stand them up i.e. bend one lead back over the R so that both leads are on the same end and closer together. Less chance of a short.

I scratched out some notes on your drawing. Hope you can read them.

Enjoy the long weekend and your brisket!
Thanks! You too.
 

Attachments

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
You have a couple of problems there. Keep in mind that the LS04 sinks current, it won't source much. To make the demo opto work connect the anode (pin 1,3,5, or 7) to +5V through a resistor (700 ohms will work). Connect the cathode (2,4,6, 8 respectively) to the output of the LS04. That way, when the inverter output goes low, it will provide a sink path to ground and turn the opto LED on. But you don't need the whole opto here, just use a visible LED (hooked up the same way). When the LED lights, consider the relay ON.

If the 1.139V is across the LED (pins 3-4 et al), that's correct. You are measuring the forward voltage of the on LED. Keep in mind that the LED is a current operated device. You have to apply enough voltage to make Vf but after that its current that does the work and Vf is relatively constant. That's why you need the 700 ohm series resistor, to limit the current to the LED. The 2.594V value is about what you'd expect if the LED were open. In that case, the two resistors just form a simple voltage divider.

FWIW On the resistors across the LEDs you can make it easier if you stand them up i.e. bend one lead back over the R so that both leads are on the same end and closer together. Less chance of a short.

I scratched out some notes on your drawing. Hope you can read them.

Thanks! You too.
Thank you for the feedback. The demo optos are there just to see if I'm getting a good connection to ground (or turning on the circuit). I did a rough draft of the whole drawing as a whole. The second set of optos will be the DEK Phoenix relays. Again thank you so much for your help! You don't know how much I appreciate it!!!!
 

JohnInTX

Joined Jun 26, 2012
4,787
I checked with Phoenix about some confusion I had re: the inputs of this thing. They are voltage inputs with internal current limiting so you don't need R4 - just apply 5V and it turns on.
The outputs are not correct. The marked up diagram shows the necessary changes.

Are your indicators really incandescent bulbs as shown? If so, you might need to consider a small series resistor or a keep-alive resistor to help limit inrush current. Phoenix says the outputs are protected but I didn't think to ask them about inrush/overcurrent protection.

EDIT: Reviewing the spec, you are OK. Typ. inrush for a small bulb is maybe 10X the operating current. For your 80ma bulb a 800ma inrush is way below the 10AMP rating so - no worries. Since an incancescent is its own current limter, you don't need a series resistor like you do with an LED.

According to Phoenix's docs, the output connections are 14 to ground, 13+ to the load side.

Have fun.
 

Attachments

Last edited:

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
I checked with Phoenix about some confusion I had re: the inputs of this thing. They are voltage inputs with internal current limiting so you don't need R4 - just apply 5V and it turns on.
The outputs are not correct. The marked up diagram shows the necessary changes.

Are your indicators really incandescent bulbs as shown? If so, you might need to consider a small series resistor or a keep-alive resistor to help limit inrush current. Phoenix says the outputs are protected but I didn't think to ask them about inrush/overcurrent protection.

EDIT: Reviewing the spec, you are OK. Typ. inrush for a small bulb is maybe 10X the operating current. For your 80ma bulb a 800ma inrush is way below the 10AMP rating so - no worries. Since an incancescent is its own current limter, you don't need a series resistor like you do with an LED.

According to Phoenix's docs, the output connections are 14 to ground, 13+ to the load side.

Have fun.
Sorry for the confusion with my drawing. They are LED lights, not incandescent.
 

JohnInTX

Joined Jun 26, 2012
4,787
If you were using it with a voltage source drive i.e. switch the 5V instead of ground, the A2 pins would allow daisy-chaining of the grounds from section to section. Since we are using a sinking drive, the extra pin is not much use.

Depending on the current actually drawn by the relay input, you may want to use something a little bigger than the LS04. We can kick that around...
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
If you were using it with a voltage source drive i.e. switch the 5V instead of ground, the A2 pins would allow daisy-chaining of the grounds from section to section. Since we are using a sinking drive, the extra pin is not much use.

Depending on the current actually drawn by the relay input, you may want to use something a little bigger than the LS04. We can kick that around...
what would be a similar part to the LS04 that could be used? What would be able to handle the current? The data sheet doesn't give that much information. The maximum continuous load current in 3A, but it doesn't say anything about the "diode" side.
 

JohnInTX

Joined Jun 26, 2012
4,787
How about a 74LS06 or 74LS16? These are inverters like the '04 but have open collector outputs that handle up to 30V at 40ma. Same pinout. Since they are open collector, add a 33K pullup resistor from +5V to the junction between the output of the first one and the input of the 2ed one. That will work fine.

BTW Pull up the unused inputs of the inverter package to +5V by connecting them together and pulling up to 5V with another 33K.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
BTW Pull up the unused inputs of the inverter package to +5V by connecting them together and pulling up to 5V with another 33K
What do you mean pull up the "unused inputs of the inverter package"? Isn't there only two signals going to the inverter?

and is this what you mean by add a 33k pullup resistor in between the inverter stages? (attached file)

Also do you think 40ma open collector output is safe enough for the part its going to be connected to?

Thank you JohnInTx!!!!
 

Attachments

JohnInTX

Joined Jun 26, 2012
4,787
You're using 2 of the 6 inverter sections in the LS06/16. Its always a good idea to tie unused inputs to something legit so that they don't float around. For TTL, its best to tie them high through a resistor.
You put the 33K pullup in the right place.
The 40ma is fine. Phoenix says that the 5V version of the DEK-OV requires about 11ma so the 40ma output won't be loaded too much. That's what you want. Keep in mind that the current in the DEK input is set by the DEK's input circuitry. We just have to ensure that our driver will handle i.e. sink the current it requires. The LS04's max current is close to the 11ma so the 06/16 is a better choice. BUT, since the 06/16 is open collector it won't source ANY current to push the input of the 2ed inverter to a logic '1' like the '04 did. So we add the 33K to supply the input bias current to the 2ed inverter when the output of the first one is OFF.

Nice.
 

Attachments

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
You're using 2 of the 6 inverter sections in the LS06/16. Its always a good idea to tie unused inputs to something legit so that they don't float around. For TTL, its best to tie them high through a resistor.
You put the 33K pullup in the right place.
The 40ma is fine. Phoenix says that the 5V version of the DEK-OV requires about 11ma so the 40ma output won't be loaded too much. That's what you want. Keep in mind that the current in the DEK input is set by the DEK's input circuitry. We just have to ensure that our driver will handle i.e. sink the current it requires. The LS04's max current is close to the 11ma so the 06/16 is a better choice. BUT, since the 06/16 is open collector it won't source ANY current to push the input of the 2ed inverter to a logic '1' like the '04 did. So we add the 33K to supply the input bias current to the 2ed inverter when the output of the first one is OFF.

Nice.
JohnInTx,

I can't explain enough how helpful you have been with me during this project. And thank you for being so patient! I have learned so much and I can't say thank you enough!!! Once I receive all the parts, I will keep you updated. Thank you so very much!!! Again, I hope you have a great weekend and enjoy that brisket!!!
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
One last question though, you have that resistor in series in between the LED and the 24v supply. Would 300 ohm be sufficient to achieve the 80ma current we want?
24v/80ma = 300 ohm? Is this correct for both LED's? Thanks again!
 

JohnInTX

Joined Jun 26, 2012
4,787
You're welcome.
BTW Was just thinkin' and if you used PS2505 as the input opto, you wouldn't have to worry about input polarity. They have 2 back to back LEDs on the input so one will get lit with either polarity. Makes wiring less error-prone - pin compatible too.

Have a good weekend!
 
Top