I soldered a cable to the button of a remote control and I want to simulate that button press by setting the pin to input mode and back to output (LOW) again.

For this to work I connected the ground of the battery (black wire) to the GND of the arduino.

Is this 100% safe if I hook the arduino up to the power grid or to my pc?

I also disconnected the ground pins and had my arduino connected to my pc and suddenly it worked too. I got a BSoD shortly after.

  • What is the voltage of the power grid? – VE7JRO Feb 7 '18 at 22:42
  • I think the battery has like 17,5 volts. – Tvde1 Feb 7 '18 at 22:52
  • 1
    had my arduino connected to my pc and suddenly it worked too ... what worked? – jsotola Feb 8 '18 at 5:55
  • 1
    what kind of a remote control? ... you have provided almost zero information in your post. – jsotola Feb 8 '18 at 6:02
  • The remote has a battery and buttons and an antenna. My goal is to be able to simulate a button click with an arduino. I also was able to simulate the button press without the two grounds connected. – Tvde1 Feb 8 '18 at 6:24

All grounds should be connected to provide a common reference point.

| improve this answer | |
  • 2
    Unless you use galvanic isolation. – Majenko Feb 8 '18 at 10:39

Based on your comments, I have 2 suggestions.

  1. Unfortunately, when you say "I think the battery has like 17,5 volts.", that can cause an issue. A 5V Uno can handle a maximum of 5VDC on any input pin. If you connected the ground to the "power grid" and applied 17.5VDC to an input you may have damaged it. The best advise I can give you is to use a volt meter to verify exactly what voltage you are working with and know the min / max voltage specs of the Arduino you are using.

  2. If you power a 5V Uno using 17.5VDC through the power jack for example, you can damage it. You can look up the exact specification for your Arduino but for a 5V Uno, I recommend a minimum of 7.5VDC to a maximum of 12VDC supplied to the power jack.

The higher the input voltage, the lower amount of current the on board voltage regulator can provide.

Here's what happens when you power an Uno with 14.8VDC and draw 650mA from the Uno's 5V pin How to kill an Arduino.

| improve this answer | |
  • I assume resistors have been placed on the power cirquit of the buttons. I don't sense any damages. – Tvde1 Feb 7 '18 at 23:34
  • Maybe the voltage is not high enough? What voltage does it put out when you press the button and when it's released? – VE7JRO Feb 8 '18 at 0:05
  • I don't know, haven't tried using a voltmeter yet. I'll see if any of my friends have one. – Tvde1 Feb 8 '18 at 0:15

Unless you use galvanic isolation (see below) then yes, you must connect the grounds together. That is vital (see here).

The main concern though is the voltage you are switching. The Arduino cannot connect any of its IO pins directly to any voltage over 5V. Doing so will most likely damage your Arduino.

Instead, you need to use the Arduino to switch a device that will switch the button for you. The simplest is a BJT or MOSFET:


simulate this circuit – Schematic created using CircuitLab

But there are a couple of other caveats you should consider. The most important one is to do with how far away the remote device is, and how it is powered. Connecting the grounds of two devices that are very distant can get quite messy, since "ground" at different points may be at completely different potentials, and the voltage drop across the "ground" wire (wires don't have zero resistance) coupled with the existing ground connection through the power supplies creates a ground loop and introduces massive amounts of interference. For this kind of arrangement, it is good to introduce ...

Galvanic Isolation

This electrically separates the two circuits completely. There is absolutely no electrical connection between your Arduino and the device you are switching.

The most common way of achieving this in low powered digital circuits is to use an opto-isolator (also called an opto-coupler). This is basically an LED and photo-transistor together in a single package. Turn the LED on and the phototransistor turns on. The basic arrangement is exactly the same as the circuit above, but the wire going in from the Arduino is connected to an LED:


simulate this circuit

Now you really don't care what ground potential is at the other end, nor how it is powered. As long as the opto-isolator can cope with the voltage it has to switch all will be good. Nothing in the remote circuit can do any damage at all to the Arduino since there is no way for current to flow back from that circuit to the Arduino.

| improve this answer | |
  • But I should not be scared that connecting the grounds and powering the arduino by pc or by dc will in any way damage the battery or do something to the power cirquit in my house? – Tvde1 Feb 8 '18 at 11:02
  • Just connecting grounds? No. That can't hurt anything. Connecting 17V to the Arduino's GPIO pin will kill the Arduino, but nothing else. – Majenko Feb 8 '18 at 11:03

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.