One mechanical switch controls multiple different signals.

Thread Starter

AVZ2203

Joined Oct 24, 2018
7
Hello there!
I'm new to this forum. Don't know if it's common over here introducing yourself on your first post, so I'll do just in case.

INTRO
My name is Alex, and I'm (milimeters close to become) a Mech Engineer. I'm based in Madrid, Spain. I'm quite interested in 3Dprinting and manufacturing proccesses in general. My main interest among the topics shared in this forum is digital electronics, but also have tried some stuff in analog, audio operational amplifiers and similar components, but not really complex stuff. I'm not particularly happy with my university when it comes to electronics.

TOPIC ITSELF

I opened this thread because within the past few days I've been designing a "breakout board" to connect a few switches to an Arduino-type microcontroller. As you can see, I have three buttons (switches A, B and C). All three buttons are momentary NO (normally open) push buttons, but I want both outputs to be NC and low active. The circuit is supplied with 12V and 5V are obtained by using a 7805 voltage regulator.

What I want the circuit to do:
Case 1:
No button is pressed. Both transistors must work within saturation region.
For both transistors, 10k pull up resistors set collector voltage to nearly 5V (GND). Additionally, base is supplied with 5V. For that transistor, VBE(sat) is 0.85V (at iB=1mA, iC=10mA). 3k9 resistors are meant to limit base current (iB) to that mentioned 1mA. Don't know if I should make 3k9 resistors a bit smaller, since 3k9 is the threshold value I got by using the formula.

Outcome for case 1:
Both outputs are "shorted" to ground, so the signal would equal GND for both cases.

Case 2:
A button is pressed. The related transistor must work within cutoff region.
For that transistor, base voltage is nearly equal to GND, so it should behave as an approx open switch.

Outcome for case 2:
The transistor in cutoff region makes the output read 5V (because the controller board has internal pull up resistor for its input pins).

How I want the switches to control the outputs:
Transistor #1 must "open" if either A or B switches (or both) are closed. If both A and B are open, transistor1 must remain closed (saturation).
Transistor #2 must "open" if either B or C switches (or both) are closed. If both B and C are open, transistor2 must remain closed.
(See Boolean attachment for clarification)

Some additional comments
1) B switch is shared between both circuits. Single mechanical switch for that, multiple signals which depend on it. That makes the whole thing a bit trickier.
2) The board has a procedure to check input pins out. No matter what the value is at other pins, no matter if other pins change. If the board is taking a step which reads output1, it sticks just to output1. That makes things way easier for me.

Sooo... what should I add in the blank space in order to make my circuit work as desired? I've been thinking about placing a couple of diodes (see proposed solution in attachments) facing inwards, but not really sure if that will work.

Thanks in advance for reading this, and sorry for abusing transistors on that way :D
 

Attachments

danadak

Joined Mar 10, 2018
4,057
D1 and D2 should be schottkys, low Vf parts, to insure Q1, Q2
can be cutoff.You want Vbe << .6 V

The problem if using standard diodes -


Or use 2N7000 or like part, MOSFET, Q1, Q2.


Regards, Dana.
 

AnalogKid

Joined Aug 1, 2013
12,045
You are close. Easy parts fist:

1. R1, R2, and R3 can be eliminated. A 0 ohm path to GND is ok, and is in fact better.

2. By your description, if only switch B is closed, both transistors will be off. Is this ok?

3. The 10 K resistors you mention are not shown. Please update the schematic.

4. Gold star for having reference designators on all components.

ak
 

eetech00

Joined Jun 8, 2013
4,704
Hi

Referring to your proposed circuit.
Use all Schottky diodes.
Replace R1 and R3 with diodes (Cathode thru switch to gnd)
Remove R2.

eT
 

Thread Starter

AVZ2203

Joined Oct 24, 2018
7
I made some changes following your suggestions. Attachments :)

D1 and D2 should be schottkys, low Vf parts, to insure Q1, Q2
can be cutoff.You want Vbe << .6 V

The problem if using standard diodes -


Or use 2N7000 or like part, MOSFET, Q1, Q2.


Regards, Dana.
Hmm there's still a lot I can learn about MOSFETs, For now I'm trying to fully understand BJTs. I was reading a few days ago but still must spend some time getting familiar with their datasheets. That 2N7000 you said... is it meant for switching just a few mA?

Thanks!

You are close. Easy parts fist:

1. R1, R2, and R3 can be eliminated. A 0 ohm path to GND is ok, and is in fact better.

2. By your description, if only switch B is closed, both transistors will be off. Is this ok?

3. The 10 K resistors you mention are not shown. Please update the schematic.

4. Gold star for having reference designators on all components.

ak
1. Hmmm I added them to limit current a little bit more, and that value was chosen in order to still keep Vbe below transistor Vf.
What are the main advantages of removing those resistors? All I can see is that current would be a tiny bit higher and Vbe lower if I do so, but I don't really know the difference among different operating points within the same region (cutofff in this case).

2. Yes, that's my goal!. I want the Dupont headers to behave as a normally closed switched controlled by whatever I do in those normally open push buttons. And in case I press switch B, both transistors should open.

3. I'm kinda confused right now about how I should add those pull up resistors. I've just updated the diagram removing the mentioned resistors, replacing regular diodes by Schottky ones (though this is not really a high speed switching application), and also adding those pull up resistors (which I'm not sure if I wired correctly, I hope I did).

4. I really like EAGLE.

Thanks!

Hi

Referring to your proposed circuit.
Use all Schottky diodes.
Replace R1 and R3 with diodes (Cathode thru switch to gnd)
Remove R2.

eT
Hmmm I don't understand how this works. I feel like diodes in the push button branches (A, B, C...) won't make a difference (aside Vf drop) since they will never be backward biased. They will be either closed, which means having GND in the cathode of those diodes you say, or open, which means having 5V at the node where ABC branches meet the rest of the circuit.

Thanks!
 

Attachments

eetech00

Joined Jun 8, 2013
4,704
I made some changes following your suggestions. Attachments :)
Hmmm I don't understand how this works. I feel like diodes in the push button branches (A, B, C...) won't make a difference (aside Vf drop) since they will never be backward biased. They will be either closed, which means having GND in the cathode of those diodes you say, or open, which means having 5V at the node where ABC branches meet the rest of the circuit.

Thanks!
Here is what I meant. See below.
The diodes just form a diode "OR" function.

BJTLogic-New.png
 

AnalogKid

Joined Aug 1, 2013
12,045
Something to keep in mind for bipolar transistors is that the Vf rating of the base-emitter junction is not a firm number. Something like a 3904 can start collector current conduction with Vbe at 0.4 V or less. And, Shottkey diode Vf isn't always as low as the "standard" 0.2 V (certainly not Shottkey rectifiers). So it is possible that even with the transistor base tied directly to GND through a Shottkey diode, there still might be a small amount of collector current depending on the exact parts used, and the amount can vary from part to part. Simulation programs can NOT be trusted to show this accurately. I will yield to others if they say a small-signal Shottkey diode will guarantee BJT turn-off, but I wouldn't trust it without trying real parts first.

OTOH, a small MOSFET like a 2N7000 will be completely off with a Shottkey diode from the gate to GND.

ak
 

eetech00

Joined Jun 8, 2013
4,704
Simulation programs can NOT be trusted to show this accurately. I will yield to others if they say a small-signal Shottkey diode will guarantee BJT turn-off, but I wouldn't trust it without trying real parts first.

OTOH, a small MOSFET like a 2N7000 will be completely off with a Shottkey diode from the gate to GND.

ak
HI

No one suggested relying on a simulation. The circuit in post #6 is only meant to convey an idea.
The TS's original question was regarding BJTs. However, I concur with your comments regarding use of mosfets.

eT
 

Thread Starter

AVZ2203

Joined Oct 24, 2018
7
Something to keep in mind for bipolar transistors is that the Vf rating of the base-emitter junction is not a firm number. Something like a 3904 can start collector current conduction with Vbe at 0.4 V or less. And, Shottkey diode Vf isn't always as low as the "standard" 0.2 V (certainly not Shottkey rectifiers). So it is possible that even with the transistor base tied directly to GND through a Shottkey diode, there still might be a small amount of collector current depending on the exact parts used, and the amount can vary from part to part. Simulation programs can NOT be trusted to show this accurately. I will yield to others if they say a small-signal Shottkey diode will guarantee BJT turn-off, but I wouldn't trust it without trying real parts first.

OTOH, a small MOSFET like a 2N7000 will be completely off with a Shottkey diode from the gate to GND.

ak
Then it could be interesting moving to mosfets. I got a few of them today just in case. For now I will try 2N3904 (BJT NPN) and Schottky diodes, I'm curious about this.

Another issue is that I'd like one of the switches to be an optocoupler phototransistor. The equivalent of pressing the button would be turning on the led inside the opto (4N35) and thus setting the phototransistor inside in saturation region. The problem is that its Vf is about 1.3V, so there would be no way to turn off the NPN, Vb would be waaaay higher than its Vf.
So definitely BJTs are not the way to go for this project. For now I'll be happy if I get it to work with push buttons (for learning purposes).

Thanks!
 
Top