How should I wire a CD4066BE (bilateral switch) so that the outputs aren't floating?

Thread Starter


Joined Dec 17, 2011
[UPDATE: I figured it out. I answered my own question. I powered the 4066 by an external 5v and it worked just fine, whether or not the computer was powered. That makes sense now that I see it.]

Preface: I've got a lot of gaps in my electronics knowledge, so please bare with me

Goal: to simulate button presses on an external device by way of a single board computer

I've got a C.H.I.P. computer ($9 linux computer similar to raspberry pi zero, which is why I used that in the image) that I'm trying to hook up to a device and simulate physical button presses programically (ie. I tell the computer to press the buttons instead of me physically pressing them). I'm using a Texas Instruments CD4066BE bilateral switch to help in this. As far as I understand, I have the computer GPIO apply HIGH to the control pins of the 4066, and the associated I/O pins are connected, and when LOW they are HI-Z.

Setup: I wired everything up as shown in my Fritzing (I laid it out exactly as I did physically... I hope it isn't too confusing to read). My Fritzing skills are limited. At the bottom of the picture there are 4 i/o pairs that go to the 4 buttons of the device. Note that I measure 5V between each pair at the device (which I suspect may be my issue but my brain hits a wall on what that's doing)

Problem: It works fine. so long as the computer is powered. If the computer is off, the pins are undoubtedly floating and the device goes haywire.

But I can't understand WHY... or what to do to fix it. I've put 4 pull down resistors on the control pins... so to me, when the computer is off those controls should be LOW and the I/O should be in HI-Z, thereby NOT "pressing" the buttons. But that's not the case.

If I disconnect everything and simply touch the button wires to the I/O with the 4066 on its own... it simulates a button press. But... if I use my multimeter I can confirm the I/O pin pair are not shorted. So that really confused me. When I finally thought to measure the voltage between the buttons' pins (each going to an input and output on the 4066), I started to suspect perhaps that voltage going to the unpowered 4066 messes things up.

I don't know where to go from here. Yes, I can just ensure the computer is powered prior to the device turning on, but I'd like to make it more robust than that.



ps. oops. I just realized I totally gimped the image. I didn't connect the 4 inputs to the VCC rail lol. That was a drawing oops. they go to the opposite side of their respective resistors.


Last edited: