# How to use the BC547 Transistor (NPN) (with examples)

Learn how to use the BC547 NPN transistor as a switch. In this post we’ll go over how to use the BC547 transistor to switch a bright LED Flash on and off. We will first switch the BC547 using a push button, and then will transition to test with an Arduino.

The BC547 is an NPN bipolar junction transistor (BJT). BJTs can be used to amplify analog signals, but they can be used as switches as well. Here we’ll show how to use as a switch.

The example to show this will be based on lighting a bright LED that will need a voltage and current larger than what an Arduino UNO IO pin can supply. Transistors operating as switches work by allowing a large current to flow through the collector when a small current flows through the base. In this example the LED operates between 9V – 14.8V at a current of 15mA, which is above the voltage and current of the Arduino UNO (see below).

LED Specs:
Voltage: 9V – 14.8V
Current when lit: 15mA

Arduino UNO Specs:
I/O Pins Voltage: 5V
Current per I/O Pin: 20mA

## BC547 Standalone application

Before jumping to wiring the transistor to an Arduino, let’s try it on a standalone application where we activate the transistor with a push button. The circuit and beard board diagram below show how we’ll setup our circuit.

In this example, the current ib represents the current that will be pulled from the Arduino UNO, while ic will be the current pulled from a separate power source. For this specific example, a 4.7kohm is being recommended and we’ll use a standard 12V voltage source to power the LED. Before doing some math to show why we are using that resistor, let’s check some specific specs of the 2N2222 transistor.

*Note that the LED flash used in this example is a ready-to-use component with a built-in resistor, which is why a separate resistor is not needed.

## BC547 Transistor Specs

Minimum current gain = 110
*The gain factor (also known as Beta) is the factor by which ib will be amplified.
*Note that Beta = ic/ib.

Min Saturation voltage VBE = 0.7V

Max Saturation voltage VCE = 0.6V

### Now let’s do some math!

Let’s first assess the voltage drop from 12V to GND, and determine the minimum LED voltage we should expect based on the maximum expected voltage between the collector and the emitter (VCE ).

Let’s first assess the voltage drop from 12V to GND, and determine the minimum LED voltage we should expect based on the maximum expected voltage between the collector and the emitter (VCE ).

After solving for VLED_Min, we saw that the result was within the bounds of the LED operating voltage (9V – 14.8V), so we are good. Now, let’s assess the voltage drop from 5V to GND, and determine the value of the current ib.

We can see that the current ib is less than the maximum that the Arduino I/O pins can support, which is good. Now, let’s confirm the minimum current that we will be able to flow through the resistor based on the minimum current gain (remember this was 35 from the transistor specs).

The value above is higher than the current stated in the LED specs (15mA), this means that even at the lowest transistor current gain, we can still pull the required current to light up the LED.

## BC547 Testing

Now, let’s actually test this and setup a multimeter to compare the calculated values to actual values.

Base Current
Measured value: 0.89mA
Expected value: 0.915mA
*Close enough

Collector Current
Measured value: 19.4mA
Expected value: 15mA
*Still acceptable. LED is pulling what it needs (LED spec sheet might not be super accurate).

## Testing BC547 with Arduino

Components used in this example

*As an Amazon & Ebay Associate I earn from qualifying purchases.