 Hi, today we'll be learning about transistors built from sand. Billions of these transistors power the computer or the mobile phone you're watching this video on. What's really cool about transistors are that they're actually semiconductors. Semiconductors are basically materials that can be both conductive or non-conductive depending on their state. Let's think of transistors as switches. Instead of being physically on or off or like relays where they physically move to be on or off transistors are like digital or like electronic switches they don't the solid state in nature that means they don't physically move but they can electronically turn on or off that means they can electronically become conductive or non-conductive because transistors are digital switches they can turn on or off incredibly fast. Furthermore being a digital switch allows them to emulate binary. Binary is basically zeros and ones in a computer right that's the most fundamental part about a computer zeros being off ones being on so if a transistor is on it's basically emulating a one and if it's off it's a zero so having billions of these transistors in your computer switching incredibly fast allows them to basically emulate binary. Another huge advantage of transistors is that they require very little power or very low signal to be activated. This allows them with a low signal to control high power loads such as running a big motor, driving huge speakers or even turning on very bright lights. Now let's learn about how transistors actually work. Transistors are made from silicon and silicon is made from sand. Silicon isn't conductive in its pure form but by adding a few impurities to it we can make it partially conductive. Doing so we can create negative and positive type silicon. By sandwiching three of these positive and negative silicon types we can actually create transistors. If we sandwich positive negative positive silicon types we get PNP transistors and if we sandwich negative positive negative silicon types we get NPN transistors. In an NPN transistor we have the emitter base and collector pins. By applying a small positive voltage to the base pin we can actually make the transistor conductive between the collector and the emitter pins. Some of you might be wondering if we can reverse the polarity of the collector and emitter pins that means switch them around and expect it to work. Actually we cannot just change the orientation of the pins or reverse the polarity as the transistor only works in one direction. If you look carefully at the transistor diagram you will see this arrow sort of like a diode arrow to denote the direction. So power sources negative or ground terminal will connect to the emitter pin of the transistor while your load like the device that you're driving like a motor or LED will connect to the collector pin of the transistor. This technique is called sourcing the load. PNP transistors are different than NPN transistors in the sense that they firstly require a negative current or voltage to the base to make the transistor conductive and they will connect the positive power supply terminal to your positive load rather than connecting the negative power supply terminal to the negative terminal of your load like in an NPN transistor. Next let's actually do a test circuit of an NPN transistor. We'll use it to turn on our load of an LED. I have my Raspberry Pi plugged in so I'm just going to use that but this circuit works with the Arduino as well. Using the pin out on the screen I'm going to go ahead and wire up this transistor here. So firstly we're going to connect the collector of the transistor which is this pin here to our load which is the ground cable of the LED. So I'll go ahead connect that then I'm going to connect the other side of this so the emitter of the transistor I'm going to go ahead plug it in and simply connect to the ground connection two three of the Raspberry Pi. Next what I'm going to do is I'm going to connect my power source for the LED that's a direct connection to 5 volts. Lastly I'm going to wire up this resistor to the base of my transistor so this will plug in to a 3.3 volt power rail on the Raspberry Pi and then the other side will plug in to our transistor to the base of our transistor. As soon as I plug it in you can see it's turned on the LED. If I unplug the base that means I'm no longer giving a small current to the transistor you can see it turns off. I plug in our base again turns on unplug it turns off. This short video is just to give you a gist of how transistors work and how you can use them in circuits. For a more detailed explanation of the different types of transistors and how to use them in circuits do check the description below. If you have any questions you can drop them in the comments and if you want to watch more tutorials like this coming out in the future do subscribe. Thanks!