Author Options:

How to make arduino control transistor? Answered

My Arduino Leonardo needs to control some existing hardware. I have a digital output going to a 470 ohm resistor, connected to the base of an S9014 transistor. The transistor is connected in parallel with the hardware's normal switch. When the arduino should be triggering the switch, it's not. Where did I go wrong?


You need to know how the switch is connected in the circuit, so that you can connect the arduino ground to the circuit ground.

Actually, the safest method, is to use an "optoisolator" - which is essntially a box with an LED (driven by the arduino), and a transistor which is turned on by the LED.

Grounding isn't an issue, but you have to make sure the transistor is wired correctly in the other circuit - collector the most positive pin, emitter to the least positive pin.


The switch has one terminal to ground and one terminal to a microcontroller. I connected the transistor emitter to the ground pin and collector to the other pin.

I wasn't sure how to connect them, so I did nothing. Do I just connect the batteries ground to any arduino pin marked GND? Or are the arduino ground pins distinct?

I know that, but there are 3 GND pins. Does it matter which I connect to? And is it the negative battery terminal that I connect to?

No, any will do.

Yes, try battery negative BUT before connecting the transistor, check the relative voltage between the switch and your transistor.

If your just triggering a switch you need to use a relay not a transistor. A transistor will place a current across the contacts of the circuit your trying to trigger. This can damage or interfere with the circuit. With a relay all you need is the relay tied to ground and a pin on the arduino. When you want to activate the relay set the pin high and the relay will turn on your circuit.

The transistor does not generate a current any more than a relay so it will not interfere in any way differently to a relay. It will be acting as a switch. As long as there is enough base drive current to turn the transistor fully on it should be fine.

Use a mosfet, if that's an issue: it rarely is in these little battery systems.