0
\$\begingroup\$

I wanted to use a transistor to switch a circuit that has its own power source (a battery).

It appears you could do something similar if you had two battery power sources, but in simulators, it doesn't seem to be the same for an Arduino connected to the USB port's ground.

This seems to work as best as I can tell. The attempt is to simulate a battery powered Arduino switching the transistor with an output pin.

schematic

simulate this circuit – Schematic created using CircuitLab

This doesn't seem to work but I don't know why. The intent is to simulate connecting the negative terminal of the battery to the Arduino ground. In the simulator I have that shows current flow, this is a no-go.

schematic

simulate this circuit

Is this just generally a bad idea? Should I use a relay instead? Or an optocoupler?

\$\endgroup\$
3
\$\begingroup\$

You must connect the grounds together, since that is the only way to relate the signal coming into the base with the voltage on the emitter.

\$\endgroup\$
  • \$\begingroup\$ And that's OK to do? To connect the battery's negative terminal to the USB's ground through the Arduino? Are there any "gotchas" I need to worry about there? \$\endgroup\$ – D. Patrick Mar 21 '15 at 16:30
  • 1
    \$\begingroup\$ A circuit as simple as this won't cause issues. Only when there are isolated grounds, high voltages, or mains connections can they crop up. \$\endgroup\$ – Ignacio Vazquez-Abrams Mar 21 '15 at 17:11
1
\$\begingroup\$

Connect circled 1to an arduino output pin and the ground symbol to arduino GND and it will work fine. Maybe R3 is a little low. 1000 Ohms is more conventional.

\$\endgroup\$

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.