Change which circuit connects to ground...

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
Screenshot_2015-11-15-00-22-03-1.png

Sorry about the ASCII art, I'm on my phone and its the best I can do.

Whilst the above circuit simulates well, I really want to only use 1 pin to select the circuit to ground.

At the moment, pins 6 & 7 are used, but in my design they are mutually exclusive, I was wondering if it was possible to trigger them so that when Pin 6 is high the circuit follows 1 path, and when low follows the other?

I want to use as few components as possible and if there is a ready made IC I would be interested.

Thanks.
 

Attachments

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
Is a PNP transistor and a resistor too many components?

If you really want an IC, then use an inverter.
Nope, that's absolutely fine.

But how do I configure it?

I have been playing around with a circuit simulator and getting nowhere.

Pin 6 will go between +5v or 0v.

In one state (high) it needs to trigger one of the two bottom transistors in my "diagram", in the other state (low) it needs to trigger the other one.

But neither must be triggered at the same time.
 

WBahn

Joined Mar 31, 2012
29,976
The answer is staring you right in the face. Consider the voltage at the LED anodes (the collector of the PNP transistor you have there). When Pin 0 is LO, the anode voltage is HI and when Pin 0 is HI, the anode voltage is LO. Sounds sorta like what you are looking for, doesn't it?
 

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
Sorry. I'm still confused, possibly because it is late....

Pin 0 toggles whether LED's light or not.

At the moment pin 6 and 7 then toggle which of the 2 banks of LED's are lit.

So pin 0 basically splits into 2 identical outputs, and I want pin 6 on its own to toggle between the parallel outputs from pin 0, rather than using both pins 6 & 7.

Consider the following...

Screenshot_2015-11-15-01-13-55-1.png

When high, this will make a connection between A and C.

When low, the connection will switch over to between B and C.

Is that clear, or an I confusing things?
 

WBahn

Joined Mar 31, 2012
29,976
I'm not saying that you USE Pin 0. I'm saying that the functionality associated with the circuitry at Pin 0 is what you are looking for. You ADD another PNP transistor and associated base resistor. You use the output of this transistor to drive the Pin 7 signal line. You then use your signal at Pin 6 to not only turn on the pair of LEDs that it currently turns on, put you also use it to turn off the new PNP transistor. When you turn off the LEDs with Pin 6, it also turns on the PNP transistor which turns on the Pin 7 signal line.
 

Alec_t

Joined Sep 17, 2013
14,280
If it were me I'd simply connect the base of the second transistor (both assumed to be NPN) via 22k or so to the collector of the first transistor. The LEDs driven by the first transistor would glow very faintly when supposedly 'off', but perhaps you could live with that?
 

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
I'm not saying that you USE Pin 0. I'm saying that the functionality associated with the circuitry at Pin 0 is what you are looking for. You ADD another PNP transistor and associated base resistor. You use the output of this transistor to drive the Pin 7 signal line. You then use your signal at Pin 6 to not only turn on the pair of LEDs that it currently turns on, put you also use it to turn off the new PNP transistor. When you turn off the LEDs with Pin 6, it also turns on the PNP transistor which turns on the Pin 7 signal line.
I'm still not understanding this. Maybe a schematic?

If it were me I'd simply connect the base of the second transistor (both assumed to be NPN) via 22k or so to the collector of the first transistor. The LEDs driven by the first transistor would glow very faintly when supposedly 'off', but perhaps you could live with that?
Firstly, yes they are NPN - sorry I didn't make that clear above.

And thank you, this seems to be working. I have created a simplified version with only 2 LED's and replaced the NPN at pin 0 with a switch.

Oh, and I installed every circuit on my phone too... No more dodgy ASCII!

Screenshot_2015-11-15-12-21-52.png Screenshot_2015-11-15-12-21-59.png Screenshot_2015-11-15-12-22-12.png Screenshot_2015-11-15-12-22-20.png

Here is the circuit to play with, if you can improve it.

http://everycircuit.com/circuit/5541165758676992
 
Last edited:

MikeML

Joined Oct 2, 2009
5,444
Assuming the that input signal can source and sink the LED currents (~10mA), then you can use a much simpler circuit. I even tailored the current-limiting resistors to reflect that Vf of a Red LED is different than for a Green LED...

301.gif
 

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
Unfortunately this is only a fraction of the LED's that will be used.

There will be, at most, 24 LED's active at the same time. Which is why I'm looking at a transistor based switching circuit.
 

dl324

Joined Mar 30, 2015
16,841
Unfortunately this is only a fraction of the LED's that will be used.
Many find it annoying when relevant details are omitted, causing them to waste time coming up with a solution that didn't satisfy the unmentioned requirements....

Rearranging the existing components and removing the desired switch:
upload_2015-11-15_9-21-41.png
The saturation voltage of Q1 needs to be low enough to insure Q2 is off. If not, a diode can be placed on the emitter of Q2.

Note how I avoided wire crossings which would obscure circuit intent. Kudos to WBahn for trying to decipher your ASCII schematic. I lost interest after a couple seconds...

EDIT: I just noticed that Alec_t had provided a similar solution. I didn't read the text closely and didn't look at the pictures you posted because I didn't care for the lack of contrast.
 
Last edited:

WBahn

Joined Mar 31, 2012
29,976
I'm still not understanding this. Maybe a schematic?

I've been trying to get you to look at your own circuit and understand how it works and how to figure out how to exploit that to change its behavior. The key is to understand that a transistor can be used as a simply logic inverter.

Alas, it wasn't to be.

upload_2015-11-15_13-36-0.png

R1 and Q3 are the added components.

When the input is HI, Q3 is off and so there is no base drive for Q1 and so L1 is OFF. But Q2 does get base drive and so L2 is ON.

When the input is LO, Q3 is on and so there is base drive for Q1 and so L1 is ON, but Q2 does not get base drive and so L2 is OFF.
 

dl324

Joined Mar 30, 2015
16,841
Alas, it wasn't to be.
It didn't seem like a homework problem, so I just threw a schematic at him...:rolleyes:

FWIW, your solution doesn't pull current through the off LED and has no dependency on NPN saturation voltage. My solution depends on enough diodes being in series that the drive current won't be an issue; a compromise for using only the existing components...
 
Last edited:

WBahn

Joined Mar 31, 2012
29,976
I don't know if it's a homework problem or not so I'm not saying anything about whether anyone else should have just given a solution to the problem or not -- it's all fair game. But it was still a missed opportunity to learn something valuable about circuits by discovery as opposed to revealed knowledge, but the TS didn't seem willing or capable of going there. That's a shame since the former is always more satisfying and usually sticks with you better. But the latter has its value, too.

What troubles me about your solution is that when Q1 is off, the base circuit for Q2 is the 220 Ω resistor, LED1, and Vbe of Q2. That should turn on LED1 pretty solidly and place Q2 is hard saturation which will also turn on LED2. I fail to see the purpose of R4. Also, I'm pretty sure that the TS's signals are logic level signals and not a switch, so he needs a circuit that allows him to apply a logic level signal to the input.
 

dl324

Joined Mar 30, 2015
16,841
What troubles me about your solution is that when Q1 is off, the base circuit for Q2 is the 220 Ω resistor, LED1, and Vbe of Q2. That should turn on LED1 pretty solidly and place Q2 is hard saturation which will also turn on LED2. I fail to see the purpose of R4.
He said in post #10 that there could be up to 24 LEDs "active at the same time". I assumed they would be in series and that R4 (of a different value) would be providing most of the base drive.

R3 could be connected to allow a logic level input. I used a switch because that's what was used in the redrawn schematic.

It really depends on the OP's definition of minimum component count and trade-offs he's willing to accept.
 

WBahn

Joined Mar 31, 2012
29,976
He said in post #10 that there could be up to 24 LEDs "active at the same time". I assumed they would be in series and that R4 (of a different value) would be providing most of the base drive.

R3 could be connected to allow a logic level input. I used a switch because that's what was used in the redrawn schematic.

It really depends on the OP's definition of minimum component count and trade-offs he's willing to accept.
Since the original schematic showed two sets of LEDs with each set consisting of two LEDs in parallel, I took the "active at the same time" to mean that there might be 24 LEDs in each parallel set.

But you're missing the big point. How is your circuit going to ever turn LED1 off?
 

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
Right, I'm sorry for the lack of information and my lack of understanding.

No, this is not homework. I am neither studying electronics not have I ever formally studied electronics bar the very few lessons I had in science or design and technology twenty years ago.

I'm also sorry for providing such poor diagrams. Thank you to those who took the trouble to try and understand them.

Right now my laptop is dead (needs a new AC socket) and I only have my phone.

"Every circuit" automatically crosses wires (I don't like it either) and doesn't have a big enough workspace to show the entire circuit.

Also, I drive a bus for ten hours a day, six days a week. When I am at home, SWMBO complains any time I turn my computer/phone on to do anything other than pay her attention - and if I do get to do something, she never let's me actually concentrate on it enough to take it all in.

I thought (mistakenly, obviously) that by showing one part that was going to be replicated in parallel wouldn't be an issue - OK there might be done adjustment with component values, but in my head I thought it was a good place to start.

Yes, the circuit is logic controlled. I'll try and explain it in a minute.

I need to have two separate LED colours at the same position, so my plan was to use common anode bi-colour LED's.

Due to their tripodic nature, they're impossible to connect in series to have them all show the same colour at the same time.

On to the circuit.

There will be six banks of four LED's - hence the total of twenty-four.

Due to the nature of by-colour LED's, in each bank of four they are all in parallel.

This has the advantage of not having to supply a higher voltage and stepping it down for the PIC, however it also has the disadvantages of higher overall current draw and requiring transistors to protect the PIC.

Each bank has three states, off, red or green. All the LED's in the bank share the same state. Also, all six banks share the same colour. They are either all red or all green, no mixture.

Six pins control the six individual banks on/off status.

Pin seven controls the colour of all six banks.

I'm sorry if that is meaningless, but that is the best I can explain it.
 

WBahn

Joined Mar 31, 2012
29,976
I think that gets the idea across fairly well.

Since only one of the two LEDs in a package will be on at a time, you can get by with a single current limiting resistor at the anode instead of two separate resistors in each cathode -- unless you need the values to be different for intensity matching.

I think the circuit I provided will scale well for the size system you are describing.
 

Thread Starter

Jonathan David Bond

Joined Nov 10, 2015
25
@dl324 - your circuit doesn't seem to work, in Every circuit, with the switch closed L1 uses 13.4mA and L2 0mA.

But with the switch open, L2 gets 13.5mA but L1 still gets 10.1mA.

http://everycircuit.com/circuit/5478307704340480

@WBahn - Thank you, that appears to be working.

There is one thing is puzzling me. All the transistors for the "switches" are in parallel. So why does turning them on one at a time decrease the current draw across the LED's that are lit?

http://everycircuit.com/circuit/6146264910528512
 
Top