# Using transistors to replace push buttons

I'm looking for a little help designing a transistor circuit. I have a small LCD (I took from an after-market car backup cam system), and I’m trying to control its built-in menu using the buttons of an old handheld game system. The LCD has 3 buttons to navigate its menus which are on a separate PCB with a single 3.3V signal line. The way it works is each button shorts the line to ground through a different resistor.

My idea was to just rebuild that circuit and replace the buttons with NPN transistors, then connect the base of each transistor to the output of a logic gate, which would detect when two of the game system’s buttons were pressed simultaneously.

The problem I seem to be having is the transistors aren't being triggered, and I don't really know enough about them to know if I've designed this wrong (the logic gate seems to be outputting correctly, so I must have done something wrong with the transistors).

The parts I’m using:

simulate this circuit – Schematic created using CircuitLab

• For starters, move the resistors "above" the transistors, ie to the collector side. Also add base resistors. Mar 25 '18 at 21:17

Your circuit forces 5-0.6 = 4.4V onto the end of R, regardless of which switch is used.

To work you need a high value R in series with the base, and better to have emitter to gnd, and R to collector. An N-fet would be easier, but still has to be S to gnd

simulate this circuit – Schematic created using CircuitLab

Bipolars will always be adding current/switching voltage, and making the apparent resistance wrong.

Cmos transmission gates are best for this job. 74HC4066.

As an add on, you can connect them to the circuit directly in place of switches, or across existing switches, without re-wiring the resistors, and without regard to polarity, multiplexing arrangements etc.

You can also use them for logic functions e.g in series to get the AND function i.e. the 4th one is in series with LCD_CTRL and controlled by _Mode.

simulate this circuit

• Hello Henry, thank you for the response. I gave the solution you (and others) suggested a try but didn't have any luck. I moved the R2 resistor (4.7K) to the collector and tried using 22K's at the base, as well as a range of higher and lower values, but I just can't seem to get it to reach saturation. I also tried swapping out the transistor itself (I have a few), but no success. It will take a week to get the parts, but I'm going to try your 74HC4066 idea and see if I have better luck with this. Thank you again! Mar 25 '18 at 22:46
• If you use the arrangement shown as Q1 above you should get saturation i.e 0.15 - 0.4V. Do you have E and C swapped? (still works, but hfe is very low). Is there really 5V at the NOR1/R1 junction? Have you really connected the ground of your circuit to the ground of the other circuit? i.e. Is the point on your schematic mark GND, actually GND? (and not a 1k resistor for sensing, for example). Is voltage from emitter of Q1 to GND of NOR1 actually 0? Mar 25 '18 at 23:09
• Hello, voltage at NOR output measures ~4.6V (actual NOR Vcc is ~4.9). I made sure C and E are on the right side (I tried flipping it anyway, but no luck). I checked voltage across Q1-E and several ground points, its definitely ground. I did try shorting C to E with a piece of wire, and that successfully triggered the LCD function like it was supposed to, so I wonder if maybe the NOR gate output just isn't strong enough to drive the transistor somehow? Mar 26 '18 at 0:12
• The analog switch ended up being a much simpler solution than trying to use BJT's, thanks again! Mar 30 '18 at 3:06
• OptoFet couplers are another option, where being totally isolated from the circuit is a plus. But you can't beat 4066's for price. Actually you should always have 74hc4066 and 74hc4052 on hand, they are super versatile Mar 30 '18 at 20:05

The outputs of your logic gates already have output transistors to ground. That's how a logic gate produces the low on the output.

Use a NOR gate with open drain output, e.g. a 74LS33.

simulate this circuit – Schematic created using CircuitLab

If you can't find a NOR with open drain, you could try placing diodes between the output and the resistors, so current can only flow into the output (to GND).

• Unfortunately the only open-drain NOR's I can find are SMDs, too small for me to work with by hand digikey.com/products/en/integrated-circuits-ics/… Thank you, though. Mar 26 '18 at 19:14
• Then try with the diodes. They add a small voltage drop, maybe you have to adjust the resistor values accordingly. Mar 26 '18 at 19:40

simulate this circuit – Schematic created using CircuitLab

Figure 1. The OP's hardware seems to consist of a game controller with four buttons, pull-up resistors and connected to four individual controller inputs. The LCD module appears to use a single analog input with pull-down resistors to create different voltage levels for each button or combination press.

simulate this circuit

Figure 2. The OP's NPN transistor is wired on the "high side" of the load resistor and acts as an emitter follower.

• The emitter voltage will be about one diode voltage drop below the base voltage. When the NOR gate output goes high the input to the LCD will be high and will not give the required response.
• Because $V_b$ > $V_c$ the collector voltage will also be at 4.3 V independent of the value of R1. It will also overdrive the LCD analogue input which is probably 3.3 V max.

simulate this circuit

Figure 3. A simple diode connection arrangement.

• Since the LCD module senses buttons by ratiometric voltage division from its internal pull-up and the external pull-down resistors we can generate any voltage in a similar fashion externally.
• Note that the R2, 3 and 4 are in a (roughly) 1, 2, 5 ratio and so each button or combination can be differentiated by the ADC.
• This arrangement uses diodes D1, 2, 3 & 4 to prevent feeding +5 to the LCD as this may damage it. This creates a small problem as there will be a voltage drop across it.

Setup and calibration:

Measure the voltage at CTRL+ for each button press and combination to be simulated:

0    0    0      __     __
0    0    1      __     __
0    1    0      __     __
0    1    1      __     __
1    0    0      __     __
1    0    1      __     __
1    1    0      __     __
1    1    1      __     __
• Connect diode D1 and R9. Press LEFT and adjust R9 to get the required voltage.
• Power down and measure the resistance of R9 and record on the table.

When complete replace R9 and add R10, 11 and 12 with the required values.

• Hello Transistor, thank you for the response. I gave the solution you (and others) suggested a try but didn't have any luck. I moved the R5,6,7 resistors (2K) to the collector and tried using 1K's at the base, as well as a range of higher and lower values, but I just can't seem to get it to reach saturation. I also tried swapping out the transistor itself (I have a few), but no success. Mar 25 '18 at 22:45
• Did you connect the ground of your control circuit to the ground of the unit being modified? Mar 25 '18 at 22:46
• I did, Vce measures 3.3v, so I know the LCD control line is connected. Mar 25 '18 at 22:56
• OK. It's time for you to provide a full schematic. I used the built-in editor. You can (pretend to) edit mine and copy and paste it (to save time) into your question and add in the circuit that's driving the transistors. A decently cropped good-quality photo of a neat hand-drawn schematic would also suffice. Show the grounds and power supplies. Mar 25 '18 at 22:58
• See my schematic edits above Mar 25 '18 at 23:31