Tag Archive | "transistor"

Old Kit Review – Silicon Chip Transistor Beta Tester


After exploring a quiet , dusty electronics store in the depths of suburbia the other week, I came across this kit from Altronics (K2534) which is the subject of this review. The Transistor Beta tester is the second revision of a tester designed by John Clarke for the March 1991 issue of Silicon Chip magazine, and promises to offer a simple way of measuring the gain of almost any NPN or PNP bipolar transistor. But first some public answers to recent feedback…

John – Why do you publish these “Old Kit Reviews”?

They’re more of  a selfish article, like many electronics enthusiasts I’ve enjoyed kits for decades – and finding kits from days gone by is a treat. From various feedback some of you are enjoying them, so I’ll continue with them for fun and some nostalgia. If you’re not interested, just ignore the posts starting with “Old”!

Where’s the schematic?

After publishing a few kit reviews, people have been asking me for the schematics. For kits that are based on magazine articles from Silicon Chip and the like, the details are Copyright and I can’t legitimately give you a copy. You need to contact the magazine or kit supplier. The surviving electronics magazines often run “on the smell of an oily rag” so in order to support them I promote the idea of paying for copies which are obtainable from the magazine. Plus Australia is a small country, where people in this industry know each other through first or second connections – so I don’t want to annoy the wrong people. However Google is an awesome tool,  and if you want to make your own beta tester there are many example circuits to be found – so have fun.

Back to the review – what is “beta”?

Apart from a letter of the Greek alphabet and a totally-underrated form of VCR format, beta is a term used to define the amount of gain of a transistor. From the guide:

Silicon Chip transistor beta tester what is beta


Here’s our kit from 1991, rescued from the darkness of the store:

Silicon Chip transistor beta tester packaging

Which contained the nice box, plus all the required components except for an IC socket, and a few screws and mounting nuts that should have been included. The instructions looked to be a photocopy of a photocopy, harking back to the 1980s…

Silicon Chip transistor beta tester contents

Silicon Chip transistor beta tester components

Looks like an off-brand 555 has been used (or substituted), however a bit of research indicated that it is most likely from LG Semiconductor:

Silicon Chip transistor beta tester off brand 555

The PCB was made to the usual standard at the time, just drilled:

Silicon Chip transistor beta tester PCB rear

Silicon Chip transistor beta tester PCB front

The front panel was well done, and kindly pre-drilled by a previous customer. The kit came with a 3mm LED however this mystery person had drilled the hole out for a 5mm:

Silicon Chip transistor beta tester front panel

… but hadn’t cut the oblong for the slide switch wide enough. But the biggest problem was that the PCB was just a smidge too wide for the included enclosure:

Silicon Chip transistor beta tester PCB not fitting

Nevertheless it was time to get started, and the resistors were measured, lined up and fitted:

Silicon Chip transistor beta tester resistors lined up

Then the rest of the components fitted as normal, however they need to stay below the horizontal level of the slide switch bezel:

Silicon Chip transistor beta tester assembly 1

… which was somewhat successful. Then to fit the potentiometer, battery snap …

Silicon Chip transistor beta tester assembly 2

and the test leads:

Silicon Chip transistor beta tester assembly 3

 And we’re finished:

Silicon Chip transistor beta tester finished

How it works

Operation is quite simple, just wire up the test leads to the transistor’s base, collector and emitter – set the PNP/NPN switch and press test. Then you turn the knob until the LED just turns on – at which point the scale indicates the gain.

“Modern-day” replacements

Digital technology has taken over with this regard, and a device such as the one below can not only give the gain, but also the component details, identify legs, and much more:

Silicon Chip transistor beta tester modern tester gain

I’ll be sticking with this one for the time being. Jaycar have discontinued the analyser shown above, but Altronics have the “Peak” unit which looks even more useful.


Well… that was fun. A lot of promise, however with a few details not taken care of the kit was just a bit off. Considering this was around twenty years old and possibly shop-soiled I can’t complain. For the record the good people at Altronics have a great line of kits. Full-sized images and a lot more information about the kit are available on flickr.

And while you’re here – are you interested in Arduino? Check out my new book “Arduino Workshop” from No Starch Press.


In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in altronics, K2534, kit review, test equipment, tronixstuffComments (1)

Clock Kit Round-up – December 2011

Hello Readers

If there’s one thing that I really like it’s a good clock kit. Once constructed, they can be many things, including:

  • a point of differentiation from other items in the room;
  • a reminder of the past (nixie tubes!) or possible visions of the future;
  • the base of something to really annoy other people;
  • a constant reminder to get back to work;
  • a source of satisfaction from having made something yourself!

So just for fun I have attempted to find and list as many interesting and ‘out of the ordinary’ kits as possible, and ignored the simple or relatively mundane kits out there. If you are in the clock kit business and want a mention, let me know. So in no particular order, we have:

adafruit industries “ice tube” clock

Based around a vintage Soviet-era vacuum IV-18 type fluorescent display, the ice tube clock is a rare kit that includes a nice enclosure which keeps you safe from the high voltages as well as allowing the curious to observe your soldering skills. I reviewed this kit almost a year ago and the clock is still working perfectly. Here is a video of the ice tube clock in action:

After some travelling meeting various people it seems that quite a few of us have an ice tube clock. There is something quite mesmerising about the display, perhaps helping to recall memories of our youth in the 1970s and 80s.

nootropic design Defusable Clock Kit

As recently reviewed, this kit allows you to build a simulated ‘countdown’ timer for a hypothetical explosive device that also doubles as a clock with an alarm. For example:

Whatever you do, don’t make a ‘fake bomb’ and leave it out in public! Only bad things could happen 🙂

ogilumen nixie tube kits

Not a clock kit as such, however they have made doing it yourself very easy with their power supply and IN-12A nixie board kits. We made one ourselves in a previous review, as shown below:

Alan Parekh’s Multimeter Clock Kit

This is certainly one from left field – using the analogue multimeters to display hours, minutes and seconds. See Alan describe his kit in this video:

Certainly something different and would look great on the wall of any electronics-themed area or would easily annoy those who dislike the status-quo of clock design.

akafugu VFD Modular Clock

The team at akafugu have created a modular baseboard/shield kit which holds a shield containing four IV-17 alphanumeric nixie tubes to create your own clock or display system:


Unlike some of the other nixie tube kits the firmware has been made public and can be modified at will. In the future different display shields will be available to extend the use of the kit.

tubeclock.com kits

This site has two kits available, one using either four or six Soviet-era IN-12 type nixie tubes:


… and another kit using the Soviet-era IN-14 nixie tubes:

You have to hand it to the former Soviet Union – they knew how to over-produce nixie tubes. One rare example where we can benefit from a command economy!

evil mad science clocks

The certainly not evil people have two clock kits, the first being the Bulbdial Clock Kit:

This uses a unique ring of LEDs around the circumference of the clock face to create shadows to mark the time. It is also available in a range of housing and face styles. Their other kit of interest is the Alpha Clock Five:

The photo of this clock doesn’t do it justice – the alphanumeric displays are 2.3″ tall, making this one huge clock. It also makes use of a Chronodot real-time clock board, which contains a temperature-controlled oscillator  which helps give it an accuracy of +-/ 2 minutes per year. Furthermore you can modify this easily using an FTDI cable and the Arduino IDE with some extra software. Would be great for model railways (or even a real railway station) or those insanely conscious about the time.

Kabtronics Clock Kits

This organisation has several clock kits which span a range of technology from the later part of the twentieth century. These guys can only be true clock enthusiasts! Starting with the 1950s, they have their Nixie-Transistor Clock:


Look – no integrated circuits, leaving the kit true to the era. If you need to hide from someone for a weekend, building this would be a good start. Next we move onto the 1960s and the Transistor Clock:


The 1960s brought with it LEDs so they are now used in this kit, however the logic is still all analogue electronics. However next we can move to the 1970s, and finally save some board space with the TTL Clock:


This would still be fun to assemble but somewhat less punishing for those who don’t enjoy solder fumes that much. However you still have a nice kit and something to be proud of. Finally, the last in the line is the 1980s-themed Surface-Mount Technology Clock:


So here we have a microcontroller, SMT components, and a typical reduction in board size. Their range is an excellent way of demonstrating the advances in technology over the years.

The GPS FLW Display Clock

Wow – this clock makes use of huge Burroughs B7971 15-segment nixie tube displays and a GPS receiver to make a huge, old-style/new-tech clock. Check out the demonstration video:

This thing is amazing. And it is actually cheaper to buy a fully-assembled version (huh). The same organisation also offers another GPS-controlled clock using IN-18 nixie tubes:


Again, it isn’t inexpensive – however the true nixie tube enthusiasts will love it. This clock would look great next to a post-modern vintage hifi tube amplifier. Moving forward to something completely different now, we have the:

adafruit industries monochron®

Almost the polar opposite of the nixie-tube clocks, the monochron uses an ATmega328 microcontroller and a 128 x 64 LCD module to create some interesting clock effects. For example:

Many people have created a variety of displays, including space invaders and the pong game simulation. The clock also includes the laser-cut acrylic housing which provides a useful and solid base for the clock.

Spikenzie Labs Solder : Time™ watch kit

Technically this is a watch kit, however I don’t think that many people would want to walk around wearing one – but it could be used in more permanent or fixed locations. Correct me if I’m wrong people. However in its defence it is a very well designed kit that is easy to solder and produces a nice clock:

It uses a separate real-time controller IC to stay accurate, and the design However this would be a great suggestion as a gift for a younger person to help them become interesting in electronics and other related topics. The asm firmware is also available for you to modify using Microchip MPLAB software if that takes your fancy.

Velleman Kits

The Velleman company has a range of somewhat uninspiring clock kits, starting with the Scrolling/Rolling LED Clock:

… the 2¼” 7-Segment Digital Clock:

This clock includes the housing and also accepts an optional temperature sensor, and therefore can display this as well. There is also the aptly-named – Digital LED Clock:


It tells the time and would be useful in a 1980s-era idea of the future movie set. The final velleman clock kit is the Jumbo Single-Digit Clock:

In all fairness this one looks quite interesting – the LED display is 57mm tall and the time is display one digit at a time. It is powered by a PIC16F630 however the firmware is proprietary to velleman.

Nocrotec Nixie Clocks

This company has a range of kits using nixie tubes and numitrons (low voltage incadescent displays in tubes). One particularly lovely kit is their IN-8 Blue Dream kit:


The blue glow at the base of the nixie tubes is due to an LED mounted at the bottom of the tube. Another aesthetically-pleasing kit is their Little Blue Something nixie clock. Check out their demonstration video:


More IN-12 nixie clocks from Germany, the first being the Manuela_HR. You can buy the kit without an enclosure, or choose from the ‘office’ style:

… or this funky number:

You can specify it with RGB LEDs which colour-cycle to provide the effect shown above. For those not too keen you can also buy the kits pre-assembled. Their other kit is the Sven:


It is available with IN-8 or IN-14 nixie tubes. The design quality of the enclosure is outstanding, a lot of effort has been made to produce a complete kit that “won’t look like a kit” when completed.

Minty Time

This is a small binary clock kit that fits in an Altoids tin:

This is a nice little kit as it is inexpensive, easy to make and very well documented. You could also mount this in a variety of flat surfaces, limited only by your imagination.

The Chronulator

Here we find a unique design that uses analogue panel meters in a similar method to the multimeter clock detailed previously. Here is an example of the completed kit:


The kit contains the electronics and meters (or you can delete the meters for a discount if you already have some) however the housing is up to you. Furthermore, this kit has some of the best instructions (.pdf) I have ever seen. They are a credit to the organisation. Our final clock kit is the …


This is another clock kit in the style of ‘suspicious bomb timer’-looking – and it pulls this off quite well. Consider the following video demonstration:

As well as a normal clock it can function as an alarm, stopwatch, countdown timer and lap counter. The instructions (.pdf) are well written and easy to follow. Furthermore the Denkimono is also well priced for the kit and delivery.

Hopefully this catalogue of clock kits was of interest to you. If you have found some other kits to add to the list, or wish to disagree or generally comment about this article please do so via the comment section below. This article was not sponsored in any way.

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in clocks, kit review, nixie, review, TTL, VFDComments (8)

Tutorial: Arduino and TFT LCD

Old and now unsupported tutorial for 4D Systems 1.44″ TFT serial interface LCD.

Update 20/04/2013 

The Arduino library for this module hasn’t been updated to work with Arduino v1.0.1+ – so you need to use Arduino IDE v22 or v23. And the module itself has been discontinued. For the time being I’m leaving the tutorial here until a more suitable item can be used. We can’t help you with the 4D module

Nevertheless – if you have one – here’s the subject of the tutorial- the 4D Systems 1.44″ TFT serial interface LCD:

The LCD is an LED-backlit thin-film transistor type, resolution is 128 x 128 pixels, with an RGB colour range of 65536.

As an aside, this is a very powerful piece of hardware. The module not only contains a 1.44″ square TFT LCD, there is also a dedicated graphics processor and a microSD card interface. One can program the display processor in the same manner as another microcontroller platform for incredibly interesting results. For more information, please visit:


However in the spirit of keeping things simple, this article will focus on driving the LCD directly using our Arduino or compatible boards. There are two firmware versions of this module – the GFX and the SGC. We need to have the SGC firmware, as this allows control via the serial TX/RX pins from our Arduno board. If you have purchased the SGC module, you’re ready to go. Scroll down until you see “And we’re back…”. However if you have the GFX version, please read the following instructions on how to change your LCD’s firmware from GFX to SGC…

Changing the firmware from GFX to SGC

  • At the moment this process only seems available to users of Microsoft Windows. All complaints to 4D Systems.
  • Unfortunately this process may not work with an Arduino Mega board.
  • First of all, remove the ATmega328 from your Arduino board. Please be careful, use a chip puller if possible. We are going to use the board as a simple serial-USB converter;
  • Insert your LCD module into a solderless breadboard;
  • Connect Arduino pin 0 (RX) to display pin 7 (RX); connect Arduino pin 1 (TX) to display pin 8 (TX). [Yes – TX>TX, RX>RX];
  • Connect Arduino 5V to display pin 9; connect Arduino GND to display pin 6; your LCD should display the following:


  • Visit http://www.4dsystems.com.au/prod.php?id=46, download and open the PmmC Loader application; visit http://www.4dsystems.com.au/prod.php?id=120 and download the .pmmc file to your local drive;
  • Connect your Arduino board via USB to the computer; then run the PmmC loader application;
  • Select the appropriate COM: port, load in the .pmmc file, then click Load. The firmware update should take less than sixty seconds;
  • When finished, you will be presented with the following on the computer:


… and the following on your LCD:


  • At this point unplug the USB lead from your Arduino board and all leads into the Arduino board;
  • Re-insert the ATmega328 back into your Arduino board;
  • Reconnect the wires from the LCD module to the Arduino, but this time connect Arduino TX to LCD RX; and LCD TX to Arduino RX.
  • Now you have  the serial-interface SGC firmware model LCD.

And we’re back…

To control this LCD, it requires commands to be sent via Serial.write(), and such commands are in the form of hexadecimal numbers. (You see something new every day). You can download the reference book with all the commands:


and bypass the library by directly writing the hexadecimal numbers directly to the module.

However, to get up to speed as fast as possible we can use a library with more of the popular functions included. Kudos and thanks to Oscar Gonzalez for writing a very useful library. Download the library from:


and install into your ../Arduino-002x/libraries folder, then re-start the Arduino IDE if you had it running. You may be wondering why the library is named displayshield4d – the LCD manufacturer sells this LCD on an Arduino shield. Although that would be great for experimenting, one would need to purchase another standalone LCD if their project moved forward – myself included. So that’s why we’re using the bare LCD board.

To connect the LCD to our Arduino is very simple:

  • LCD pin 5 to Arduino RST;
  • LCD pin 6 to Arduino GND;
  • LCD pin 7 to Arduino D1;
  • LCD pin 8 to Arduino D0;
  • LCD pin 9 to Arduino 5V.

In the following examples we will demonstrate the various functions available in the library. As this is chapter 29, I will no longer explain the more basic functions or ideas that you should know by now, instead relying on comments within the sketch if it feels necessary. It can take a short moment for the LCD controller to process, so always put a short delay between functions.

When uploading a sketch to your Arduino you may need to disconnect the LCD from Arduino D0/D1 as it can interfere with the serial process.

Firstly we will demonstrate text display. Initialising the display requires a few functions:

The second line creates an instance of lcd to be used with the relevant functions. Next, within void setup():

To write text to the LCD, the following function is required:

This line sets the font transparency. If we use the parameter OLED_FONT_TRANSPARENT the unused pixels in the character area will be transparent and continue to show what they were set to before the text was over-written with. You can also use OLED_FONT_OPAQUE, which blocks the item displayed “behind” the text.

Whenever a function requires a colour parameter, we use:

where x, y and z are numerical values (between 0 and 255) for the red, green and blue components of the required colour. If you need an RGB numerical reference, download this handy chart. Finally, to display some text we use the following:

The parameters required are:

  • a – the x-position of the first character. E.g. if this was a zero, the top-left pixel of the first character would be on the left-most pixel column of the LCD;
  • b – the y-position of the first character. e.g. if both a and b were zero, the text would start from the top-left of the LCD;
  • c – numerical code for the font to use: 1 is for 5×7 pixel characters, 2 for 8×8 and 3 for 8×12;
  • the three values within the lcd.RGB() function determine the colour of the text;
  • d – x-axis resolution multiplier. E.g. if you double this and use the 5×7 font, the characters will be double-width;
  • e – y-axis resolution multiplier.

Now let’s see this in action with the following sketch:

And a short video clip of the example in action: – http://www.youtube.com/watch?v=t3yypXL022w

As you can see the display update speed is much better than the LCD from the previous chapter. Although this example was short, don’t be afraid to try out your own parameters in the example sketch.

Next we will demonstrate the various graphics functions in the library. Creating graphics isn’t rocket science, it just takes some imagination (something I admit to lacking) and following the parameters for each function. Our first is

which places a pixel on the screen at location x,y of colour described using lcd.RGB(). Next we have

which draws a line from x1, y1 to x2, y2 of colour rgb. One can also create rectangles and so on using

This will create a rectangle with the top-left point at x,y; width is l pixels, height is h pixels, and a new parameter z. If z is 0, the function will draw a solid shape, if z is 1, it will display only a wire-frame rectangle with a pixel width of one. Circles are created using

where x and y are the coordinates for the centre of the circle, r is the radius, and z is the solid/wireframe parameter. And finally – triangles:

This will draw a triangle with the corners at the coordinate parameters; z again is the solid/wireframe parameter. However you need to order the corners in an anti-clockwise order. This will become evident in the example sketch below. In this example we run through the graphical functions described above. By following through the sketch you should gain an idea of how the graphical functions are used, in order to create your own displays.

And here is the video of example 29.2 in action … brought to you by Mr Blurrycam: – http://www.youtube.com/watch?v=BKy-GuKWGZ8


Posted in 4d systems, arduino, education, LCD, learning electronics, lesson, microcontrollers, TFT, tutorial

Education – the Bipolar Transistor – part two

Hello readers

Today we continue with the second in a series of articles about the bipolar transistor. The first section is here. In this article we look at using the bipolar transistor as an amplifier. That is, change a very small alternating-current signal and make it larger, increasing the amplitude of the signal. Although originally it would seem to be rather simple, perhaps it is not. There are many, many ways to construct a transistor amplifier circuit, but I hope this introduction helps your basic understanding of the process.

When we used the transistor as a switch in part one, we were concerned about the amount of current that flowed between the base and the emitter – that it did not exceed the maximum rating for the particular transistor. When a transistor is allowing the most amount possible of current to flow, it is saturated – the point where the transistor cannot handle any more current. However, to use a transistor as an amplifier we need to bias the transistor so that it is passing current, but not saturated. The procedure of setting the output DC level is known as biasing. The procedure for biasing is outside the scope of this article.

When selecting transistors one needs to take note of the hFE (DC current gain), as variations in this will require a complete recalculation of the values for the bias resistors. Even a common model such as the BC548 is available with hFE ranges between 110~520.


one transistor amplifier

Consider the example schematic above. The transistor is not saturated, due to the bias being set by the two 10k ohm resistors, which drops the voltage over the base by around half. In this case with our 6V supply this drops to around 3V. When power is applied, the transistor is biased and allows a small amount of current to flow, but it still has a lot more current-handling capacity. In testing this example, without an input the base current Ib is 0.32 milliamps, and the collector current Ic is 19.9 milliamps . These amounts of current are known as the quiescent current values.

The purpose of the 0.1 uF capacitor is to block DC current and only allow AC current to flow. When the AC current passes through the 0.1 uF capacitor, it is combined with the DC quiescent current running through the base and rides the stronger current out of the emitter. At which point the 100 uF capacitor before the speaker stops the DC current and only allows the AC signal through to the speaker, but amplified. The level of amplification is dependent upon the gain of the transistor, and the amount of base current. Let’s have a look at the behaviour of the current as it passes through the example circuit above:

At the end stage of the video clip we increased the input signal greatly. Did you notice the clipping at the output? This occurs when the voltage is too great for the transistor, and therefore it cannot pass the complete signal through to the emitter. In an audio signal situation, this will cause distortion. That is another reason to check the specification of the transistor against your requirements.

Moving along. You can also connect more than one transistor together to increase the amplification, for example:


two-transistor amplifier

The left half of the circuit above should be familiar. The 10uF capacitor at the bottom is to stop the DC current being passed through to the base of the BC548 transistor. The second transistor, the BC558 is a PNP transistor, and amplifies the signal at the collector of the BC548. Finally, the 1uF capacitor blocks the DC current from reaching the output. However in using two or more transistors in such a method, you need to ensure the emitter current rating of the second transistor is much higher, as the gain of two transistors is the product of the individual transistors’ gain.

As stated at the beginning, this is only an introduction. There are literally hundreds of thousands of pages of material written about the use of transistors, so don’t stop here – experiment and do your own research and learning!

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group.

Posted in amplifier, education, learning electronics, lesson, transistor, tutorialComments (9)

Education – the Bipolar Transistor

Hello readers

Today we continue with the series of articles on basic electronics with this introductory article about the bipolar transistor, and using it as a switch.

What is a transistor?  It is a semiconductor with three leads, with which a small voltage or current applied to one lead can control a much larger current flowing through the other two leads. A transistor can be used as either a switch or an amplifier. Furthermore, there are two main types of transistor – the bipolar and the field-effect transistor. This article will examine and refer to bipolar transistors as transistors. Let’s go!

A transistor consists of three layers of silicon, P- and N-type in fact. Do you recall the diode article? A transistor is basically two diodes connected together in a Y-formation, in one of two ways as shown below:


Also notice the circuit symbols for NPN and PNP-type transistors. Transistors can be found in many shapes and sizes, the size usually being directly proportional to the amount of current the particular transistor is designed to handle. Thankfully the physical shape or package design has been standardised, and each casing type has a designation. Let’s look at some of the more common ones now:

TO-92 casing. When the flat-side is facing you, the pin numbering is 1-2-3. This casing style is for transistors that usually handle up to 100 mA. Unfortunately there are three varieties with regards to which pin is the base, collector and emitter – so always check your data sheet if in doubt.

TO-220 casing. When the metal tab is at the rear (above), the pin numbering is 1-2-3. The metal tab acts as a heatsink, and the hole enables one to bolt it to a larger heatsink, metal chassis, etc. This casing style is for transistors that usually handle up to around 8 amps.

TO-3 casing. These are all metal in order to dissipate heat – as they can handle up to around 75 amps of current. The entire metal case and ends are pin 2; pins 1 and 3 are the usual leads. Check your data sheet for pins 1 and 3! There are many other types of casing, but the three above are usually the most common.

How do transistors work?

For current to flow from the base of a transistor to the emitter, it needs to be forward-biased by at least 0.6 volts. In other words, there must be a potential difference between the base and emitter by 0.6V. If the base is connected to ground, the transistor will not let current pass from the collector to the emitter:


The transistors in the circuits above are NPN transistors. The current that flows from the base to the emitter is known as base current or Ib. The current that flows from the collector to the emitter is known as the collector current, or Ic. An interesting property of the transistor is this: the ratio of Ic to Ib is constant, and Ic is always larger than Ib. The ratio of Ic/Ib is known as the gain of the transistor. When reading a data sheet, gain is usually defined as hFE. This formula also proves that if there is no base current, there will be no collector current – you can’t divide by zero.

Using the transistor as a switch

To use a transistor as a switch, we need to know several things to be successful. For example:

To use the transistor to turn on the “load” we need to:

  • know the current drawn by the load. This is also the transistor’s Ic (collector current). Or the load’s resistance, as Ohm’s law can be used to calculate the current
  • know the transistor gain (hFE)
  • calculate Ib (base current)
  • use the above data to find a value for that lonely resistor

Let’s do that now with a contemporary problem… we have an Arduino that needs to turn a relay on and off at certain times. However you can only source up to 20 mA from a digital output on the Arduino, so we want to use it instead to switch a transistor which can control the relay coil. The problem is, what value resistor to use to control the base current?


First of all, let’s note what we do know. The relay (data sheet) coil requires 60 mA of current to activate, it is a 5 volt relay, and the coil has a resistance of 83 ohms. The transistor (data sheet) is a BC548 NPN transistor, very cheap and easy to find. It can handle a collector/load current of 100 mA, and the hFE (gain) is 110.  That diode is there to loop back pulse current when the relay is switched off. The supply voltage is 5 volts, and the digital output from the arduino is also 5 volts when active. There is also one more thing to take note of – the base-emitter junction is a diode, and therefore has a voltage drop of 0.7 volts. When you are switching large voltages, this is not an issue – however as we are working with a small voltage, the drop needs to be taken into account.

So, let’s calculate Ib, the base current. If hFE = Ic/Ib then 110 = 0.06 A/Ib; which translates to Ib = 0.06/110 = 0.0005 A. Which is basically nothing, so we’ll round it up to 1 milliamp.

Next, the resistor value. Using Ohm’s law (voltage = current x resistance):

Voltage = (5-0.7) = 4.3 volts (we need to take into account the voltage drop over the base-emitter junction of the transistor)

Current = 0.005 A (Will use a slightly higher current just to be on the safe side)

So, resistance = 4.3/0.005 = 860 ohms. For such a tiny current and small voltage, a 1/4-watt resistor is fine. (power = volts x current; = 4.3 * 0.005 = 0.0215 < 0.25)

If we didn’t have an 860 ohm resistor, a little higher is OK. I have used a 1k ohm resistor and it has worked nicely.

And there you have it – a transistor used as a switch. As stated at the beginning, this is only an introduction. There are literally hundreds of thousands of pages of material written about the use of transistors, so don’t stop here – experiment and do your own research and learning! In the next few weeks we will look at using transistors as amplifiers.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group.

Some information for this post is from: historical info from Wikipedia; various technical information and inspiration from books by Forrest Mims III;  TO-3 package photo from Farnell Australia.

Posted in education, learning electronics, lesson, transistor, tutorialComments (4)

Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: