🐸 Tutorial 14 - Transistors

Transistors are electronic devices that are used to amplify or switch electronic signals. There are two main types of transistors: NPN and PNP.

An NPN transistor, such as the S8050, consists of a layer of N-type semiconductor material sandwiched between two layers of P-type semiconductor material. When a small current is applied to the base of the transistor, it allows a larger current to flow from the collector to the emitter. NPN transistors are commonly used in amplifiers and switching circuits, and are often used as the switching element in digital circuits.

A PNP transistor, such as the S8550, consists of a layer of P-type semiconductor material sandwiched between two layers of N-type semiconductor material. When a small current is applied to the base of the transistor, it allows a larger current to flow from the emitter to the collector. PNP transistors are also commonly used in amplifiers and switching circuits, and are often used as the switching element in power supplies and voltage regulators.

Both NPN and PNP transistors are commonly used in electronic circuits and devices, providing reliable and efficient signal amplification and switching. The S8550 and S8050 transistors are two common examples of NPN and PNP transistors, respectively, that are widely used in a variety of applications.

Components Needed

ComponentQuantity
Raspberry Pi Pico W1
Micro USB Cable1
Breadboard1
WiresSeveral
S85501
S80501

Fritzing Diagram - NPN S8850

Code - NPN

import machine
button = machine.Pin(14, machine.Pin.IN)
signal = machine.Pin(15, machine.Pin.OUT)

while True:
    button_status = button.value()
    if button_status== 1:
        signal.value(1)
    elif button_status == 0:
        signal.value(0)

Code Explanation

Fritzing Diagram - PNP S8050