> -----Original Message----- > From: A.J. Tufgar [SMTP:tufgaraj@MUSS.CIS.MCMASTER.CA] > Sent: Wednesday, August 21, 2002 4:08 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: [EE]: Simple switching question. > > Hey all, > Simple question but it's bothering me. > > I've got a simple 2n2222a driving a coil from a pic pin. When I put > the coil between +5V and the collector, works fine turns the coil on > and off. But when I try to the coil between the emitter and ground it > doesn't work. A voltage appears across it, but it's only 3.6V. > > I'm trying to switch supplies to the coil so I have to use the emitter > ground set-up. What's wrong, why can't I use a set-up like this? > > I thought it might be due to internal resisitance of the transistor, > but this doesn't make sense because I tried it with a mosfet (IRF540) > and I only get 2.2V across the coil. > > Can anyone help me out in finding a way to switch the supply to the > coil? > > I'm using 5V and 1.2V if this matters. Both supplies share ground. > > Thanks in Advance, > Aaron > The difference is that you are using the transistor in two entirely separate configurations. The first, the the coil in the collector is called "common emitter" which gives high gain, and is very usefull for switching applications like you are using. When you connected it to the emitter, you have the transistor configured as an "emitter follower" which gives a voltage gain of around unity, and also introduces a voltage drop accross the base-emitter junction of around 0.6volts. You need to use a common emitter stage, but if you want to source current instead of sinking it, you need to use a PNP transistor. The PIC's operation will then be reversed i.e. you will need to sink current from the transistor base by driving your PIC pin low rather than high. As you are driving an inductive load make sure you have a diode or snubber accross your load to reduce the large induced voltages when you switch the transistor off. Failure to do so will kill the transistor and could possibly hurt the PIC. Regards Mike -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.