Transistor people, HELP! Basic question. I have a bunch of 2N2222 transistors interfaced to an analog mux/dmux (74HC4051N). I know that a base resistor is needed to limit the current to the base. The question is:
Do i have to use a current limiting resistor on each channel like this:
Or can I get away with one current limiting resistor at the input like this:
Because the dmux is analog, the transistor base will see the appropriate voltage (dropped by Rb at the input), but does that mean that there will not be too much base current in the one resistor design? I built the circuit using the one resistor design and it works fine. My concern is that I am stressing the transistors and they will eventually fail in the one resistor configuration. The input signal is a digital 0-5 volt signal. Its really not a big deal to have to use 3 more resistors to do it right, Im just wondering if it is necessary.
You'll more than likely end up overstressing the demux outputs first - a high out will be like driving a diode to Gnd.
You should also use a resistor with each diode to ensure even brightness as they turn on or off.
CrossRoads:
You'll more than likely end up overstressing the demux outputs first - a high out will be like driving a diode to Gnd.
You should also use a resistor with each diode to ensure even brightness as they turn on or off.
I considered that. With a 1.8K base resister, the base current is only about 2mA with a 5volt source. The mux/demux is a 74HC4051 and capable of sinking/sourcing 25mA, so that shouldn't be a problem. Also, due to the operation of the demux, only one LED transistor can be switched at a time which is why I reduced the resister count to 1 for all 4 LEDs.
I am new to analog mux's I am thinking of them like a digital mux, which may be my problem. With a digital mux, the output is sinked or sourced from the VCC/Gnd inputs by the output gate and triggered by the input gate as the output can only be HIGH or LOW (Ie: the actual input does not propagate to the output, rather it triggers output gates). However, if i am understanding analog mux operation correctly, the original input does propagate to the output and therefore current limiting effects before the input are preserved at the output.
I think the best thing to do is actually build the circuit and measure the base current out of the mux to the transistor with a 1.8K resister at the mux input and a varying 0-5 source. If it varies from 0-2mA after the mux like it does before the mux, I will have my answer!
Something like this:
If both meters react the same, that should prove it right!?
Why are you using a demultiplexer to drive outputs like this in the first place. It is not the wisest of things to do. By doing this it means you have to have the overhead of multiplexing the outputs if you want more than one to appear on at any one time. There are other output latch chips that will make your design so much simpler, like a 74HC259. Or even a shift register 74HC595.
Grumpy_Mike:
Why are you using a demultiplexer to drive outputs like this in the first place. It is not the wisest of things to do. By doing this it means you have to have the overhead of multiplexing the outputs if you want more than one to appear on at any one time. There are other output latch chips that will make your design so much simpler, like a 74HC259. Or even a shift register 74HC595.
Why on Earth would this not be wise? Its a signal directing device that operates as I need it to. From what I can tell, the 74HC259 in demux mode does the same thing as what I am doing with the 74HC4051. The reason I am using the 74HC4051 in the first place is because I already had one. We seem to be getting a little off topic here and Im sure there are other ways to do this. Maybe it would be beneficial to include my entire system schematic to illustrate what I am doing and why.
I have a SlingBox that I use to get my HD cable TV service to my cabin over the internet, where TV services are limited but decent speed DSL is available (go figure). At home, where the Slingbox resides, I have 4 DVR units that I wanted to have access too. I have a nice IR controlled component video and audio switch that I use to direct the desired audio/video feed to the Slingbox. I have programmed it to recognize signals from the slingbox and can remotely control the switch to change the video feed. The issue was that if I had the IR blasters going to all the DVR's in parallel, I would be controlling the DVR I was using AND all the other DVR's at the same time (which my roomates might not be happy about). So I needed to develop a way of being able to also switch between IR blasters, based on what DVR I was using at any given time. Here is my system:
The top part includes the DVR's and the IR controlled component A/V switch going to the Slingbox. Below that is my design to decode the IR from the slingbox and relay control signals to individual DVR's. The arduino decodes the IR signals and if it is a signal to change the input on the component switch, is selects the appropriate channel on the Demux so that the IR control signals can be reproduced using the 555 timer and send to only that DVR. The timer is configured in astable mode to produce a 38Khz signal when IR is detected by the IR receiver. Because the IR diodes I am using need to be high power (for the range I need) I need to supply them their nominal forward current of 100mA. This is why the transistors (MPQ2222) are needed as HC devices can only source/sink 25mA.
To repeat, I have bread boarded this, and everything works just as expected. The bi-directional mux/demux sends the 38Khz signals to the appropriate DVR's allowing me to control only one at a time (the one im viewing). I was just concerned with the robustness of using a single current limiting resister for the transistor bases at the input of the analog mux.
Im not sure you understand the function correctly. The LS42 simply sets an output LOW based on the address lines. I need to switch a 38Khz signal to one of four outputs from the 555 timer. I cant think of an easier way to do that than with a Demux.
Anyway, I think I answered my own question. I built a test circuit (the one I suggested above):
When I vary the input voltage to Rb from 0-5v, Va changes from 0-5v (duh), and Vb changes from 0-.9v. The current through Rb also varies from 0-2.4mA. So far so good. If the demux is passive then Vc should mimic Vb and both current meters have the same reading.
Sure enough, that's exactly what happed! There is a slight difference in Vb anc Vc (about .1v) which makes sense as the demux has an ON resistance of 180 Ohms. Also the current is slightly less (also expected) but only by .2 mA or so. I examined the diagram of the demux in the datasheet and it seems that the Q I/O and D I/O are connected by FET's. This is what gives the device its analog capabilities and why input current and voltages are preserved.
Im not sure you understand the function correctly. The LS42 simply sets an output LOW based on the address lines. I need to switch a 38Khz signal to one of four outputs from the 555 timer.
I do, if you want it modulated then you simply apply the modulation to the D input. That switches the selected output from low to high.
Anyway you have a workable circuit.