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

JohnInTX

Joined Jun 26, 2012
4,787
You don't have a pullup between the two inverter sections.
But your heating problem is that you don't have any current limit resistors on either the input or output of the demo optos on the right end of the first picture. That's why the inverter is getting hot, no current limiting.

To be clear, the DEK opto input has built in current limiting. Your demo optos have to have external current limit because they don't incorporate any internal limiting.

Replace two green wires feeding the LEDs of the demo optos with 150 ohm resistors to limit the current. Add 150 ohms to the LEDs in series on the opto outputs too for the same reason. You likely have smoked the inverter and the demo optos.

I am assuming that the demo opto LEDs are powered by +5V. 24V will smoke the LS04.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Ok everything works good now. Can you just explain how you can to 150 ohm resistor?

Also on a good note, I didn't smoke anything. It all still works!! =)

But when the inverter "inverts" the signal from high to low, the continuity is there, but the voltage is like 600 mv. I think 800 mv is the max for a low signal. Do you think this will be ok or is there a way to make the "low" even lower?

Also I added two LEDs to each opto to mimic the light stack and only one led lights up. Why is this? Is there not enough current? Would I have to change the resistor value?

I know I most likely won't have to worry about this with the final product, but I'm just curious

I received the 74LS06's yesterday. They are the 74LS06D's and they are super tiny. Looks like they're made for a printed circuit board. I noticed on the data sheet the 74LS06N's are the size I would be able to use on my circuit board. From the looks on the data sheet though, there is not much difference between the D and N model so I should be ok for the final product.

Thanks again!!
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
I just picked 150 ohms out of experience. How to do it exactly is to apply ohm's law in the circuit +5V ->R->LED->transistor collector->GND.
Starting with 5V supply, there are two voltage drops that are fairly constant, the low voltage at the inverter output (.6v you say, about right) and the forward voltage drop (Vf) of the LED when its on. Its specified but 1.5V is a good approximation. So in our circuit we have 'used up' .6+1.5 = 2.1V, leaving 5-2.1=2.9V across the resistor. That voltage will be pretty constant since the power supply and other voltages are relatively constant. So.. we can use 'constant' 2.9V to set the current through the circuit (and the LED) by Current = Volts/Ohms. In this case we have 2.9V/150 ohms = .01933 amps or about 20milliamps. With a guaranteed CTR of 80%, this means you'll get 20*.8 mA collector current on the output side of the opto - more than enough to turn on even the junkiest LED. Nice.

But when the inverter "inverts" the signal from high to low, the continuity is there, but the voltage is like 600 mv. I think 800 mv is the max for a low signal. Do you think this will be ok or is there a way to make the "low" even lower?
Its OK. The 800mv you see is the maximum that the voltage can be and still be considered a solid logic low by a TTL input connected to that output. The actual value is determined by the device and to some degree how much current its sinking (V=I*R ohms law again) so you can't do much about it. The LS06 has a beefier output state so it will likely have a lower voltage when sinking the same current.

Also I added two LEDs to each opto to mimic the light stack and only one led lights up. Why is this? Is there not enough current? Would I have to change the resistor value?
Does each parallel LED have its own resistor? That is necessary. Use 300 ohm (or something in that range) on each one.

I know I most likely won't have to worry about this with the final product, but I'm just curious
Yeah, its tempting to model it and see how its going to work - as long as doing so doesn't introduce more problems. In this case, its actually sufficient to know that the inverter outputs are switching. You could find this out with visible LEDs and series resistors that replace the opto inputs.

Yeah, that suffix on the part number determines the package. You now know that the same circuit is available in several different physical configurations. When you do a PCB layout AND create the Bill Of Materials - be SURE not only to specify the full and complete part number but also the package (DIP-14, SOIC-14 etc.) Usually, but not always, the circuit has the same specs for any package but there are some that don't. I think you are OK here. Obviously, when you lay out the PCB, you'll have to choose the package and stick with it. In general you pick a technology (through-hole or SMT) and do the whole board with it. Mixing through-hole and SMT requires 2 assembly steps and will drive up your cost.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
JohnInTx,

I was thinking, is there a need for the current threshold resistor for the opto? I was looking at the data sheet for the DAQ card that is supplying the signal and its a +/- 5mA current, which is much lower than the maximum input current for the PS2501-1's. I don't want to limit the current to much to not turn on the LED in the opto. Or should it stay just to be safe? What do you think? Thank you and have a great weekend!!! =)

upload_2015-6-5_8-24-58.png

upload_2015-6-5_8-25-34.png
 

JohnInTX

Joined Jun 26, 2012
4,787
If you are driving from a DAC card, you probably don't need the threshold resistor. The DAC has enough control over its output to reliably switch the LED on and off. As I said earlier, the threshold resistor comes in handy when the LED would be driven by some solid state output (as opposed to an open/close relay or in this case a regulated DAC output). Sometimes, a solid state output - particularly ones that can drive lots of current - will have enough leakage current when OFF to light the comparatively sensitive LED, causing false triggering.

I always come at these things from a belt and suspenders approach - make it as bulletproof and flexible as possible within reason. Today you are hooking to a controlled DAC output, maybe next year that gets replaced with something not as nice. Ask me how I know these things...

Something you'll need to be sure of is that the DAC actually swings between 0 and 5V. Its configurable for up to +/-10V. I'd definitely use the opto with the AC input - back to back LEDs. That way if you screw up the DAC programming and output a -10V instead of 0V it won't break the beacon input. Designer's Casebook rule #32.4: Programming mistakes are a lot easier to hide when not accompanied by sparks and smoke :)

I'd consider laying out the board to allow the threshold Rs but specify them as 'no-stuff' on the BOM.

Looking good!
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
If you are driving from a DAC card, you probably don't need the threshold resistor. The DAC has enough control over its output to reliably switch the LED on and off. As I said earlier, the threshold resistor comes in handy when the LED would be driven by some solid state output (as opposed to an open/close relay or in this case a regulated DAC output). Sometimes, a solid state output - particularly ones that can drive lots of current - will have enough leakage current when OFF to light the comparatively sensitive LED, causing false triggering.

I always come at these things from a belt and suspenders approach - make it as bulletproof and flexible as possible within reason. Today you are hooking to a controlled DAC output, maybe next year that gets replaced with something not as nice. Ask me how I know these things...

Something you'll need to be sure of is that the DAC actually swings between 0 and 5V. Its configurable for up to +/-10V. I'd definitely use the opto with the AC input - back to back LEDs. That way if you screw up the DAC programming and output a -10V instead of 0V it won't break the beacon input. Designer's Casebook rule #32.4: Programming mistakes are a lot easier to hide when not accompanied by sparks and smoke :)

I'd consider laying out the board to allow the threshold Rs but specify them as 'no-stuff' on the BOM.

Looking good!
You make a very solid point!!! The Optos with the back to back leds, are they interchangeable with the PS2501-1's? Meaning they have the same specs? I'll have to check out the data sheet to confirm. Thanks again and have a good weekend!
 

JohnInTX

Joined Jun 26, 2012
4,787
The Optos with the back to back leds, are they interchangeable with the PS2501-1's?
Yep. The difference is what happens when the input polarity is reversed. In the 2501, the LED gets unhappy, in the back to back LED one, it will turn on. That may or not be a desirable thing since it makes it so your DAC has to be around -Vf < DAC output <+Vf to make the LED off but it doesn't break the single LED. It could become an issue for diagnostics - setting the DAC to 0 turns it off, setting the DAC to less than 0 turns it back on... what??? If you think that's an issue, revert to the single LED and add a blocking diode 1N5819 in series to keep inadvertent negative voltages from turning it on. Just depends on what makes the most sense in your mind.
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
Yep. The difference is what happens when the input polarity is reversed. In the 2501, the LED gets unhappy, in the back to back LED one, it will turn on. That may or not be a desirable thing since it makes it so your DAC has to be around -Vf < DAC output <+Vf to make the LED off but it doesn't break the single LED. It could become an issue for diagnostics - setting the DAC to 0 turns it off, setting the DAC to less than 0 turns it back on... what??? If you think that's an issue, revert to the single LED and add a blocking diode 1N5819 in series to keep inadvertent negative voltages from turning it on. Just depends on what makes the most sense in your mind.
That makes sense. is this how it would be in series? It would block the reverse polarity and also fail to turn the opto on (unlike the 2505, which would turn it on when reverse polarity occurs). This gives a little extra circuit protection. Thanks again JohnInTx!! Have a great weekend!!
 

Attachments

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
I talked with National Instruments and they suggested I use a 500 ohm resistor in series with the PS2501-1, given the output of the DAQ is -13mA and the operating current of the opto is 10mA. Does this seem ok? will this change the value of the current threshold resistor?

Can't go wrong with left over brisket sandwiches!!! =)
 

JohnInTX

Joined Jun 26, 2012
4,787
I talked with National Instruments and they suggested I use a 500 ohm resistor in series with the PS2501-1, given the output of the DAQ is -13mA and the operating current of the opto is 10mA. Does this seem ok? will this change the value of the current threshold resistor?
I'm puzzled by that. The spec in post #85 says that the output of the voltage DAC is 0-10V OR +/-10V presumably according to some configuration setting. The spec for current is its compliance i.e. what load the DAC will drive. It will drive 10V into a 5ma load like an LED but it won't drive 10V to start your car. I figured the values for a 5ma load as spec'd so I'd stay with that for now. If you have the DAC set up, I'd write some test code and see how it drives the proto LED setup. You only need one channel to test it. In fact I'd test it at the +/- 10V extremes with whatever diode protection you put in (the 1N5819) and hammer away. Better to find out problems on the bench..
 

Thread Starter

MichiganWolverine5974

Joined May 13, 2015
68
I'm puzzled by that. The spec in post #85 says that the output of the voltage DAC is 0-10V OR +/-10V presumably according to some configuration setting. The spec for current is its compliance i.e. what load the DAC will drive. It will drive 10V into a 5ma load like an LED but it won't drive 10V to start your car. I figured the values for a 5ma load as spec'd so I'd stay with that for now. If you have the DAC set up, I'd write some test code and see how it drives the proto LED setup. You only need one channel to test it. In fact I'd test it at the +/- 10V extremes with whatever diode protection you put in (the 1N5819) and hammer away. Better to find out problems on the bench..
Ya I'll try it out and let you know!

I must have been looking at the analog output settings

upload_2015-6-8_13-41-52.png
 

JohnInTX

Joined Jun 26, 2012
4,787
Ahhh... that explains a lot.

I think you are ready to go. You don't need the 1N5819 diode since the digital output doesn't swing negative. You still can use the AC input version of the opto if you want - makes the input polarity-insensitive as we discussed. Plenty of current compliance. Voltage levels look good.

Ship it!
 
Top