# Yet Another question on using GPIO to short a remote push button

OK, I bought this little remote-controlled Ac outlet thing for $1. It controls 3 outlets via RF. I didn't realize it was RF at first, but I currently have my BeagleBone Black doing a bunch of home automation stuff on my network anyway, and figure I can wire in the remote into the BBB via a couple transistors and be on my way. I can't read the chip in the remote, it's blank. Supply is a 3V coin cell battery, but I figure I can run it from the 3.3V supply of the BeagleBone (maybe with a resistor to drop the voltage? Or should it be okay at 3.3V? I'm thinking it should be okay at 3.3V). There are 6 buttons, 3 for on, 3 for off. There are two positive rails, one for all the on buttons, one for the offs. Each of these rails connects to a different pin. The buttons connect the positive rail to different pins. For schematic see @Transistor 's post below. Some of this is a bit sketchy and I purposely omitted what looks like a power supply cap, all the antennae stuff (P1 and P7 I think). Hopefully, it gives you an idea of what I'm looking at. So, if I drop a few GP PNP transistors over the ends of each switch, then connect base to different GPIO pins on the BeagleBone, then dropping the GPIO pin low should make the transistor conduct, right? The GPIO pins on the BBB are also 3.3V and current in minimal, so what sort of resistors am I looking at to avoid frying stuff? I'm a software guy, not a hardware guy. Any and all help is greatly appreciated!! Edit: Working now and Google Assistant can now control the AC outlets I bought (3 for$1). I have a purple livingroom light and a big fan connected right now. Not using number 3 (yet). Software will be made more robust later, but really cool to have it on my phone now 😃

• looks like you may have the connections to R2 and SW4, SW5 and SW6 incorrectly drawn Jul 8 '18 at 6:16
• Oh wow. You are right. R2 should be inline with the switches. Nice catch! I'll fix it when I get back to my desk in the am Jul 8 '18 at 10:06
• i think that @Transistor drew the correct diagram in the answer below Jul 8 '18 at 18:59
• there may be a way to use the BeagleBone instead of U1 to control the RF transmitter directly. ..... can you post a picture of the front and back of the transmitter circuit board Jul 8 '18 at 22:37
• @jstola Posted. Hard to read since its connected 😃 Jul 15 '18 at 8:04

simulate this circuit – Schematic created using CircuitLab

Figure 1. A redraw of the OP's suspect schematic.

Draw positive at the top and negative at the bottom. Try to keep it read from left to right with current flow from top to bottom.

Your reverse engineering looks suspect to me. I suspect that the chip is multiplexing the switches but that you have misread the board. See if they are connected as a 2 x 3 matrix.

simulate this circuit

Figure 2. A more likely multiplexed arrangement. The chip stobes columns 1 to 3 (Col1 to Col3) low (0 V) sequentially and reads rows 1 and 2 (Row1 and Row2) to see if any switches have been pressed. R1 and R2 are pull-ups and pull the rows high when no switch is pressed.

Supply is a 3 V coin cell battery, but I figure I can run it from the 3.3 V supply of the BeagleBone (maybe with a resistor to drop the voltage?

It should be fine at 3.3 V. The chip is probably designed to run from a couple of AAs and a pair of these could exceed 3.3 V when fresh.

There are 6 buttons, 3 for on, 3 for off. There are two positive rails, one for all the on buttons, one for the offs. Each of these rails connects to a different pin. The buttons connect the positive rail to different pins.

They're the rows with pull-ups on Figure 2.

So, if I drop a few GP PNP transistors over the ends of each switch, then connect base to different GPIO pins on the BeagleBone, then dropping the GPIO pin low should make the transistor conduct, right?

You haven't sketched a plan but this probably won't work well as you don't have a definite ground on Col1, Col2 or Col3.

Figure 3. The CD4016/4066 pinout. The switches are CMOS and behave like low value resistors when the respective control pin is pulled high. The control pin can be driven by micro-controller.

Your best option is Umar's suggestion of 1.5 CD4016 or 4066 quad switch chips. Check the datasheets carefully for the minimum operating voltage. (I haven't done that for you.)

The GPIO pins on the BBB are also 3.3V and current in minimal, so what sort of resistors am I looking at to avoid frying stuff?

Direct drive to the CMOS control inputs is fine.

• Yup. Your diagram is correct. I botched it. Lack of sleep Jul 10 '18 at 10:48
• See the update. Jul 10 '18 at 17:33

CD4066B is one example of a simple quad switch. It has four switches in it which can be controlled independently.

If you drive control signal A, the IC will establish a connection between Pin 1 and 2. Do nce, you can connect two points of earlier switch position to pin 1 and 2 of the IC and control it via CONTROL A signal.

The price is just 13 cents for 1k units.. Or I expect less than a dollar for single IC..

On resistance is 125 ohms but should be okay as long as fast switching isn't needed.

Typical quiescent current is less than 1 uA.

I am just giving one example of such IC and I don't insist to go only for TI IC as such.

Simple way to go if you can buy the ICs.

https://www.ti.com/switches-multiplexers/analog/products.html#p1143=1:1%20SPST

You can explore some more in the above link.

You want a cmos analog transmission gate.

74HC4066 gives you 4 separate "switches"

The separate switches of the 4066 are very easy to understand, and you don't need a correct schematic to make it work.

Using transistors is always theoretically possible, but always seems to have one problem or another. Transmission Gates just work like you would expect.

• That's two votes for a 4066, and if it's that easy to use - no extra parts needed, it looks exactly like what I need. I ordered 5 for \$3, price included shipping :) Jul 10 '18 at 10:53