# How to ground a arduino with an external power-source? [closed]

I have magnet hooked up to my arduino with a Darlington Transistor, like this:

The powersource is a 12V adapter

I'm pretty new to electronics but i'm told that the transistor won't work unless the ground on the arduino is the same as the ground on the external source. How do I do this in practice? Should I run a wire from the ardunio-ground to the negative pole on the powersource? How do I tell which one is the negative one?

Ground is usually (though not always, but in your case it is) the point of lowest potential in a circuit. In your circuit that is the "negative" connection of the power supply. Note that the "negative" isn't actually "negative", it is zero volts when measured from the reference point of itself.

So yes, you need to know which is the "negative" connection and connect that to ground on the Arduino.

Since you already have it wired up the negative is the one which connects to the emitter of your transistor. If you don't know which that is and you just randomly connected a random wire to a random pin then you need to investigate your power supply.

The simplest way is with a Digital MultiMeter (one of the most basic items you need to own if you are working with electronics - if you don't have one then go and buy one immediately). Set it to DC Volts in the right range then connect the two probes (correctly inserted into the right sockets on the DMM) to the power supply's output connections. If the voltage reads positive then the black probe is connected to negative. If it reads a negative value then the red probe is connected to negative.

If you cannot get a DMM but you have an LED (note: a bulb will not work) and a suitable resistor (say 2.2K) you can connect the resistor in series with the LED then connect the two to the power supply. The cathode of the LED (the pin with the flat side on the case) connects to negative. Connect the power both ways round. The way round that it lights the LED is the correct way round, and you know that the connection that goes to the cathode (flat side of the lip round the bottom of the LED) is the negative.

• “Since you already have it wired up the negative is the one which connects to the emitter of your transistor” – What's that mean? Anyhow, for a grounded-emitter low-side switch, either the battery or the transistor in the diagram in the question is backwards, an issue you might address with a correct diagram in your answer. – James Waldby - jwpat7 Nov 1 '16 at 3:01

Majenko explained how to figure out what is what. I'm just repeating the shematics again with "additional" description:

Current limiting resistor R1 is REQUIRED, if you don't want to destroy Arduino output by over current.