Skip to main content
2 of 3
Fixed title typo
Adam Lawrence
  • 33.3k
  • 3
  • 60
  • 110

In a circuit being switched by an NPN transistor, do power supply and input need the same ground?

I'm trying to make a circuit that will allow me to switch on a relay that will turn on an LED. However, the relay is rated for 12 V, and I only have an input of 5 V, so I'm using an NPN transistor (data sheet) to switch the power to the relay on and off. Here's the circuit diagram.

However, I'm confused about a few things (Note the ground for both the 12 V power supply and the 5 V power supply are unspecified):

  1. If my 5 V power supply is an arduino, can I use the ground for that for the ground of the 12 V power supply?

  2. Is it okay for the base and the emitter to have different grounds on the transistor? Or do they have to be the same?

  3. If my 12 V power supply is 8 AA batteries (not sustainable, but I'm just using it for testing), how would I connect that to the same ground as the arduino, instead of the negative side of the batteries?

  4. How can I figure out what the R1 and R2 should be, based on the transistor? I read some things online, but am still confused.

  5. Are there any other things that I'm not taking into account that I should be?

I'm completely new to this, so any help is much appreciated.

Mason
  • 543
  • 2
  • 8
  • 15