Using the 4066 IC bilateral switch to simulate pushing buttons

//Using the 4066 IC bilateral switch to simulate pushing buttons

Make your Arduino click external switches using the 4066 IC bilateral switch


Have you ever wanted to connect your Arduino to another device and simulate pushing the buttons on it?

By itself the Arduino can’t really achieve that, since the buttons are on another device that uses it’s own voltage and ground.

You could use a relay to connect the pins on the button together, simulating pressing the switch (button) but you would need one relay for every switch you want to press.

In this tutorial we will look at the 4066 IC bilateral switch which enable you to control up to 4 switches.  If you want more you can just use more 4066 IC’s.

Simple to use and inexpensive, this little IC is great when you want to control another device using it’s own buttons.


Pin 7 of the UNO is connected to Pin 13 of the 4066 IC which controls Pin 1 and 2 on the 4066 IC.

5V and Ground from the UNO goes to Pin 14 (VDD) and Pin 7 (GND) of the 4066 IC.

Pin 1 and 2 of the 4066 IC are connected to each leg of the arcade button.

One leg of the arcade button is connected to the external 5V and the other goes to the Vpin of the LED.

The external ground is connected to the ground pin of the LED.


Using the 4066 IC with an Arduino is very easy.  All we have to do is make the digital pin of the Arduino that is connected to one of the 4066 input “HIGH” and it will trigger the corresponding output.

In this simple sketch, we are just making the pin go from “HIGH” to “LOW” with a small delay between the two to make our LED flash.

As always you can have a look at the tutorial video for more information.

/* Arduino Button Press 4066 IC

Created by Yvan /
This code is in the public domain...
You can: copy it, use it, modify it, share it or just plain ignore it!


#define buttonclick 7  // Pin 7 connected to Pin 13 of 4066 IC
int clickspeed = 25;  // Controls speed of button click

void setup() {
  pinMode(buttonclick, OUTPUT);
  digitalWrite(buttonclick, LOW);

void loop() {
    digitalWrite(buttonclick, HIGH);
    digitalWrite(buttonclick, LOW);

Copy the above Sketch code in your Arduino IDE software to program your Arduino.

You can download the Datasheet (PDF) of the 4066 IC here:  Download 4066 IC Datasheet

By | 2018-02-23T17:07:48-05:00 January 12th, 2016|Tutorials|


  1. Brian Sturk August 1, 2020 at 8:49 pm - Reply

    I’m experiencing the same thing as the above 2 posters. My LED goes from on, to brighter.

  2. Bernardo Ruiz April 30, 2019 at 8:38 pm - Reply

    I bought this switch and it doesn’t work as you say. My LED when deactivated by the switch/code, doesn’t turn off completely. It does turn on and “off” but never fully off.
    What is wrong? Thanks 🙂

  3. Marc October 19, 2018 at 9:00 am - Reply

    Hello, I really enjoy your tutorials. I bought some of these 4066 IC and they all read as an open on the OHM meter across each pair of switches (I am probably not using the right terms so by that I mean each pin pair 1/2, 3/4, 11/10, 9/8) but when I apply 5v for my LED the voltage passes through and the LED stays on continuously. This is with the IC completely disconnected from anything other than the positive side of the power supply and the positive side of the LED. I have 5 ICs and they all do this, any ideas? Thanks again for your great tutorials!

Leave A Comment