Maker Pro
Maker Pro

Need of a common ground???

tilup367

Mar 3, 2014
13
Joined
Mar 3, 2014
Messages
13
Hi all,
I am doing a PCB and before finally making it, i would like to know something. I have a PIC giving some amount of Ampere at 5v to the Base of a NPN bipolar transitor. And from collector (and additionnally to emitter) i have a coil working with a different power supply of 5v. My question is : Do I need to link both ground (ground1 from 5v(usb) supply, and ground2 from 5v(12v through 5v regulator) supply) together to get the transistor do his job?

thanks a lot! :)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes. I would expect they would already be connected.

The transistor responds to current from the PIC that enters the base and comes out the emitter. The transistor switches current that comes in the collector and out the emitter. The emitter is the common point for those two currents, hence the name "common emitter configuration". So the 0V returns of both systems (the PIC and the relay) need to be connected together.

You have a current limiting resistor between the PIC and the transistor, right?

If you post a full schematic, we can get a better understanding of how the supply rails in the circuit are structured, and we can double check that you've done everything right.
 

tilup367

Mar 3, 2014
13
Joined
Mar 3, 2014
Messages
13
So, here is a hand-draw blueprint. There is 3 main section on this circuit : 1. The PIC 2. The relays 3. The accessories connected to the relays. Then, just to refresh the question, do i need to link ground from section1 and section2?
 

Attachments

  • 20140501_063446.jpg
    20140501_063446.jpg
    100.3 KB · Views: 143

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
1. Yes, those grounds do need to be linked. Instead of just joining them together, I would use a ground symbol on all points that connect to the second ground - that is the transistor's emitter, the 7805's ground pin, and the connector pin.

2. The 7805 needs decoupling capacitors. See the data sheet.

3. The relay coil must have a diode reverse-connected across it to suppress the back EMF from the coil when the transistor turns off (unless the relay has one built-in, in which case you should show it on the diagram), otherwise the transistor will be damaged. See the left hand circuit in the diagram at http://3.bp.blogspot.com/-JrM7nJaKl4Y/UFJ7bxCiBOI/AAAAAAAAALE/VhMXoWO1r_Q/s1600/fly-back.png

4. You seem to have calculated the transistor's base current limiting resistor based on the relay coil current and the transistor's gain. In a switching application like this, you should ensure the transistor is saturated when it's turned ON. To saturate a transistor you need several times the calculated base current. If current consumption is not an issue, I would use around about 1/20th of the relay coil current; if the coil is going to draw 81 mA at 5V, make the base current 4 mA, i.e. use a base resistor of around 1k. If you're worried about current consumption, use an N-channel MOSFET such as a BS170 or 2N7000. You won't need any resistors if you use MOSFETs.
 

tilup367

Mar 3, 2014
13
Joined
Mar 3, 2014
Messages
13
T
1. Yes, those grounds do need to be linked. Instead of just joining them together, I would use a ground symbol on all points that connect to the second ground - that is the transistor's emitter, the 7805's ground pin, and the connector pin.

2. The 7805 needs decoupling capacitors. See the data sheet.

3. The relay coil must have a diode reverse-connected across it to suppress the back EMF from the coil when the transistor turns off (unless the relay has one built-in, in which case you should show it on the diagram), otherwise the transistor will be damaged. See the left hand circuit in the diagram at http://3.bp.blogspot.com/-JrM7nJaKl4Y/UFJ7bxCiBOI/AAAAAAAAALE/VhMXoWO1r_Q/s1600/fly-back.png

4. You seem to have calculated the transistor's base current limiting resistor based on the relay coil current and the transistor's gain. In a switching application like this, you should ensure the transistor is saturated when it's turned ON. To saturate a transistor you need several times the calculated base current. If current consumption is not an issue, I would use around about 1/20th of the relay coil current; if the coil is going to draw 81 mA at 5V, make the base current 4 mA, i.e. use a base resistor of around 1k. If you're worried about current consumption, use an N-channel MOSFET such as a BS170 or 2N7000. You won't need any resistors if you use MOSFETs.
Thanks, but i don't understand why i need to drive the transistor to its satured limit. I'll try of course, but i will look at the maximum current the pic can give before doing has you said and because the transistor i have in hand have a limit of 100mA from C to E. And for the decoupling capacitor for the 7805, you mean between its output and the ground? Even if the source on its input is a battery?
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I assume the relay has a 5V-rated coil? To activate the relay properly, you need to apply the full rated voltage across the coil. The transistor should be in saturation so its collector-emitter voltage is as low as possible, leaving as much of the 5V supply voltage across the relay coil. The current is limited by the resistance of the relay coil, which you can calculate using R = V / I = 5 / 0.081 = about 62 ohms. So imagine the transistor as a switch that should be either fully OFF or fully ON. When it's fully ON the relay coil sees 5V across it and the current is limited to 81 mA. With a supply voltage of 5V and a coil resistance of 62 ohms, it's impossible to exceed the 100 mA maximum collector current rating.

Yes, the 7805 needs decoupling capacitors on its input and output (to ground). Read the data sheet!
 

tilup367

Mar 3, 2014
13
Joined
Mar 3, 2014
Messages
13
Ok, finally, just to grab what you said: are you saying that i must add a resistor (62kohm) in line with the coil relay and the collector pin or are you talking of the resistance of the coil itself? PS : thanks a lot!
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I'm talking about the resistance of the coil itself.

If you want to make the relay pull in, you need to connect a DC voltage across the coil, equal to the rated voltage of the coil as marked on the relay. When you do that, a certain amount of current will flow in the coil, limited by the coil's resistance.

For this relay, it seems that V=5, I=0.081, and therefore R=62 ohms (not kilohms). This is the DC resistance of the relay coil. If you measure it with a multimeter on resistance range, you should measure about 62 ohms.
 
Top