I don't have much experience with electrical engineering and teachers have given us(mostly me, I'm the Software Engineer the rest are Media Designers) a pretty challenging task. We have been given a coffee machine and we need to connect that to an Arduino. They gave the tip to solder wires to connector to the buttons on the front panel. Now we spend a day dissembling the thing and have the buttons exposed. At this point we're clueless how to proceed.

The button itself is simple...

enter image description here

...but where do we need to solder the wires to? All four pins or just two of them? I have no documentation about what it's using(voltage wise ect.) and measuring them would be difficult since the thing is apart and we cannot power it. Could someone point me to the right direction and/or give me some on-topic reading?

  • \$\begingroup\$ But keep in mind that the buttons are already connected to the circuit of the coffee maker. The circuitry may interfere with your arduino when you power up the machine again. \$\endgroup\$
    – chrmue
    Jan 11, 2012 at 16:06
  • \$\begingroup\$ Has someone with some kind of experience/qualification actually assessed that this is really safe to do? That switch is clearly low-voltage, but that doesn't mean it's safely isolated from the mains. The world can probably spare a few media designers, but you may feel that you're more valuable. \$\endgroup\$
    – user1844
    Jan 20, 2017 at 22:50
  • \$\begingroup\$ Yes. We had a qualified teacher telling us that it was okay, then we messed up the soldering. We had access solder touching the metal frame causing a short circuit. We then had another teacher using his mad soldering skills to help us out. Connected to a relay and voila. \$\endgroup\$
    – Johan B
    Jan 23, 2017 at 12:39

2 Answers 2


This is going to take a lot of speculation on my part. There are a couple of ways of wiring up a push button (e.g. passively pulled-up, passively pulled-down) and how you "bypass" it depends a lot on the specific wiring and push button type (e.g. normally-open, normally closed). The switch looks pretty common though - like this one. That is to say it probably operates like this (schematically):

enter image description here

Start by getting a multimeter and doing a continuity check among the pins of the push button. I would venture to guess that the four pins of the push button are actually two electrical pairs (i.e. {T1,T2} and {T3,T4} in the schematic above). Without pushing the button you will probably get the two ringing pairs, and with the button pressed you will probably get all four to ring out to one another.

Lets go with that. You want to use the Arduino to "push" the buttons. You might be able to get away with connecting the Arduino GND to one side of the push button and a DIG pin to the other side, then setting the pin to LOW to "push" the button, and HIGH to "release" the button. It's hard to say without measuring how the push button is wired in circuit.

The most generic way to bypass a push-button and put it under electronic control by a microcontroller (like an Arduino), knowing nothing else about it, is (once you figure out which pins get shorted by the button press) to put a "pass gate" (aka transmission gate") in parallel with it and control it with two pins of the Arduino.

enter image description here

A pass gate is a PMOS transistor and an NMOS transistor with their drain and source pins (respectively) wired together. You turn "on" the pass gate by supplying the PMOS gate with a LOW and the NMOS gate with a HIGH. You turn "off the pass gate (surprise) by supplying the PMOS gate with a HIGH and the NMOS gate with a LOW.

The more sophisticated device to use would be an Analog Switch IC that fits your specific needs for number of switches, poles, and throws. A pretty neat little through-hole one that will handle up to four independent switches would be TI's CD4016BE.

  • \$\begingroup\$ More than likely, one side of each button already is grounded. In that case you need a common ground (just one for the whole board though, not one per button) and to connect a GPIO pin to the other side. And toggle the Arduino pin between input and low output. \$\endgroup\$
    – Ben Voigt
    Jan 10, 2012 at 23:44
  • \$\begingroup\$ @BenVoigt yes, that's what I was saying in my sentence that starts "You might be able to get away with..." \$\endgroup\$
    – vicatcu
    Jan 11, 2012 at 5:14
  • 1
    \$\begingroup\$ Yes, but the pin direction should be toggled, rather than the level. \$\endgroup\$
    – Ben Voigt
    Jan 11, 2012 at 6:07
  • 1
    \$\begingroup\$ When using buttons, ground one end then set the pin to input with the pull up enabled. This "inverts" the button logic but that's nothing a software engineer would be hindered by. Don't go toggeling the the pin between input/output, the pin is still floating and thus unknown. \$\endgroup\$
    – Faken
    Jan 11, 2012 at 17:29

Those are simple, common "tactile" buttons.

If you get a multimeter and set it to "continuity test" mode (the beep mode) and check the continuity of the pins with the button both pressed and released, you should find it is something like this:

enter image description here

I.e., when not pressed, the "top" and the "bottom" (with the switch as "portrait" - long sides top and bottom) the top two pins are connected, and the bottom two pins are connected. With the button pressed, you should find that all the pins are connected.

So, you can connect one wire to the top, and one wire to the bottom.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.