Mastering Arduino
上QQ阅读APP看书,第一时间看更新

Transistor

Transistors are tiny switches that can be triggered by an electric signal. Transistors are the building blocks for the digital world that we live in today. Integrated circuits are made up of many tiny transistors. The transistor gives up the digital on/off a signal that all digital devices rely on.

A transistor has three connectors, which are known as the collector, base, and emitter. For NPN transistors collector is the leftmost pin followed by the base and emitter. For PNP transistors the leftmost pin is the emitter followed by the base and collector. The collector should be connected to an input power source. The emitter should be connected to a common ground in the circuit. The base, when a certain amount of voltage is applied, triggers the flow of electricity through the transistor. The base is what acts as a switch to turn the flow of electricity on or off.

For a DC circuit, like the ones we will be using in this book, all of the components need to be connected to a common ground. For example, if you have a battery that powers the Arduino and a battery that powers the DC motors, the ground (negative) terminals will need to be connected together so all of the components are connected to the same ground. This is known as having a common ground in the circuit.