2

I'm just beginning to understand a bit about transistors and wanted to build my own NOT gate with what i thought was an NPN Transistor. When it didn't work I thought maybe i had the pins mixed up and tried every configuration possible to no avail, so I thought maybe it's a PNP transistor. When i was trying to create it, I had an input led to make sure i was getting good contact through my switch when I realized it was actually functioning as a NOT gate. So here's my schematic, if someone can tell me how this thing is actually working, I would appreciate it. Thanks in advanced. Text Text

  • 1
    So you don't know if you have an NPN or a PNP and you are connecting the 3-pin device up in random ways trying to work out "what works the way you want it to work" without much else going for you? Is that about right? Can you think of a way to test the BJT and work out which pins are which and if it works, at all? Before we try and help you understand a behavior, it would really help narrow things down if you would first work out what you have and how you've wired it up. Otherwise, we have to examine all permutations and see if any match up with your writing. – jonk Aug 29 '20 at 00:10
  • 1
    Worse, we don't really know what your latest observations are. Or, at least, I can't tell. So I'm not sure what I'd try and explain, or if by the time I tried to explain it, you'd have modified the wiring again and be on some other behavior you wanted explained. So I think first thing is to work what you have, if it works, and which pins on it are which. I can assume, I suppose, that there's no numbering on the device? – jonk Aug 29 '20 at 00:11
  • 2
    The BJT in your circuit is irrelevant for your use case. When A is on, you are shorting your LED. When A is off, you have a power path from 5V through the LED with the resistors. All the BJT does is change the current. – Nino Aug 29 '20 at 00:13
  • 1
    Yes, this is what I first tried...5v to 220ohm. 220ohm to collector and anode of led. Cathode of led to ground. 5v to switch. Switch to base. Emitter to ground. Then when I was trying pnp configuration...5v to 220ohm and collector. 220ohm in series with 1k ohm to base. Base to switch with testing led hooked up. Emitter to anode of led. Cathode of led to ground. – Jeffery Springs Aug 29 '20 at 00:19
  • 1
    Ok nino, that makes sense, but how come this didn't work? Http://maker.pro/storage/DDk1M60/DDk1M60hQF5VyBPhWt7MObiUdh2k8rQVJltHsz1k.jpeg – Jeffery Springs Aug 29 '20 at 00:24
  • 2
    The circuit in that link would work, but your switch needs to switch the input to 5V, not ground. – Nino Aug 29 '20 at 00:41
  • 1
    oh hmm ok, no voltage drop between base and emitter – Jeffery Springs Aug 29 '20 at 00:41
  • 1
    yea when i tested it the first time as a npn i had the switch connected to 5v, i only switched it when i tried it as a pnp. But I'm pretty sure the transistor is bad – Jeffery Springs Aug 29 '20 at 00:48
  • 1
    Congratulations on trying. However, you are "lashing out wildly" without enoughh attempt to understand what you are doing. The operation of the LED in the circuit shown has nothing to do with the transistor - but with a high power su[ply you MIGHT destroy the transistor. The NOT gate link you show should work - work on making it work without changing the basic topoloy. Place LED either in series withj collector R or from collector to ground. 5V via R to base to turn on. Rb around 1K to 10K. RLED maybe 100-300 Ohms. – Russell McMahon Aug 29 '20 at 04:00
  • 1
    Remember that all common emitter switches are inverting and mechanical switches may be inverted on input by switching input high thru Rb to V+ or low with current amplification around 30 using Ohms Law and Vbe diode drop to get reasonable low Vce – Tony Stewart EE75 Aug 29 '20 at 12:58

1 Answers1

3

When you're using a transistor in a circuit, whether it is a BJT (npn or pnp) or mosfet, the first thing you need to do is figure out what transistor you have. Virtually all transistors that aren't from a suspicious source have markings on them that tells you the model. From there, your first step is to google the datasheet. The datasheet will tell you whether the transistor is a BJT or MOSFET, whether it's an npn or pnp BJT or an n-channel or p-channel mosfet. Furthermore, it will show you the different pins and how to identify them. Once you understand what your mystery transistor is, only then can you start designing your circuit.

Since you're trying to build a logic gate, you want to operate the BJT as a switch, in other words, you want it to operate in either the cut off region or saturation region. Once again, referring to the datasheet, you can figure out what voltages are needed to do just that.

Here is a video that goes over how various logic gates using npn BJT transistor work. https://www.youtube.com/watch?v=sTu3LwpF6XI

Once you understand how it works, you simply need to figure out what transistor you have and bias it correctly.