917Views10Replies

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?

Discussions

0
None
steveastrouk

Best Answer 6 years ago

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.

Steve

0
None
4lifenerdfightersteveastrouk

Answer 6 years ago

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.

0
None
4lifenerdfightersteveastrouk

Answer 6 years ago

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?

0
None
4lifenerdfightersteveastrouk

Answer 6 years ago

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?

0
None
steveastrouk4lifenerdfighter

Answer 6 years ago

No, any will do.

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

0
None
mpilchfamily

6 years ago

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.

0
None
butemanmpilchfamily

Answer 6 years ago

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.

0
None
steveastroukmpilchfamily

Answer 6 years ago

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