• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Electrical Engineering News and Products

Electronics Engineering Resources, Articles, Forums, Tear Down Videos and Technical Electronics How-To's

  • Products / Components
    • Analog ICs
    • Battery Power
    • Connectors
    • Microcontrollers
    • Power Electronics
    • Sensors
    • Test and Measurement
    • Wire / Cable
  • Applications
    • 5G
    • Automotive/Transportation
    • EV Engineering
    • Industrial
    • IoT
    • Medical
    • Telecommunications
    • Wearables
    • Wireless
  • Learn
    • eBooks / Handbooks
    • EE Training Days
    • Tutorials
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • White Papers
    • Design Guide Library
    • Digital Issues
    • Engineering Diversity & Inclusion
    • LEAP Awards
    • Podcasts
    • DesignFast
  • Videos
    • EE Videos and Interviews
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Bill’s Blogs
  • Advertise
  • Subscribe

Microcontroller Power Switching With Transistors

January 23, 2018 By Zach Wendt and Jeremy Cook

Microcontrollers—such as the ATmega328P chip that powers the venerable Arduino Uno as well as the Nano—allow you to take input from sensors, power LEDs, and send signals to other devices over protocols such as I²C. If, however, you need to control a larger load, like a large array of LEDs or a DC motor, microcontrollers alone don’t have enough power to directly control any of these devices.

For example, per the Arduino Uno’s tech specs, the board is only capable of generating 20 mA per I/O pin, with an absolute maximum of 40 mA each. This, along with further restrictions when certain pins are used together, doesn’t give you a lot more power than what’s needed for basic communication tasks. Fortunately, transistors present an excellent solution to higher power needs. This article will introduce you to the world of transistors, or re-acquaint you a tech that you may have some familiarity with.

Transistors

Versions of the transistor, which form the building blocks of all modern computing devices, were conceived of and patented in 1922 by Julius Edgar Lilienfeld, and separately by Oskar Heil in 1935. However, the device wasn’t fully recognized until 1947, when physicists John Bardeen, Walter Brattain, and William Shockley produced a functional device while working at AT&T’s Bell Labs. They shared the Nobel Prize in 1956 for this revolutionary device. While it was named an IEEE Milestone in 2009, it wouldn’t be an exaggeration to call it the IEEE Milestone, as nearly all of the modern electronic devices that we use today wouldn’t be possible without it.

Transistors come in different forms, but they all take a small signal, and amplify it between a pair of terminals. These terminals are known as the emitter, base, and collector in the case of bipolar junction transistors (BJT), and source, drain, and gate in the case of field-effect transistors (FET). Among those broad categories, BJTs can be further divided between NPN and PNP (for Negative-Positive-Negative and Positive-Negative-Positive) variations, and FETs can be either JFETs (junction field-effect transistors) or MOSFETs (metal-oxide-semiconductor field-effect transistors).

Breaking that down even further, there are numerous part numbers of each type, with different voltage, current, and temperature ratings. This variety is excellent if you know what transistor characteristics you need, but if you want to jump in and try switching a motor or similar load with a one, knowing what to buy can be daunting. Fortunately, with a quick web search, you can find assortments of transistors with a variety of part numbers and construction, allowing you to jump into experimentation without yet being an expert.

A Simple Circuit

(Image Credit: Jeremy Cook and Zach Wendt)

If you’d like to try your hand at using these devices, the simplified circuit pictured above and outlined here will give a quick introduction. In it, a common 2N2222 NPN BJT transistor is used to switch the load of a PC fan with the yellow signal wire running from the positive voltage to the middle or base transistor pin. An output from a microcontroller could be substituted for the yellow wire for control. Since the fan is labeled as requiring .2 amps at 12 volts, this is well beyond the recommended 20 mA (.02 A) for an Arduino board, and a transistor is used to amplify the output effect.

In this NPN transistor setup, when positive voltage is applied to the base, it lets electricity flow through the load, attached between the supply voltage and collector pins, to the emitter, attached to the ground pin. Note that in practice, you’d want to use the appropriate resistor between the signal voltage and transistor base, not pictured above.

​Other Transistor Uses

While turning a load on and off is interesting, there are many other things you can accomplish using a microcontroller/transistor arrangement.

  • PWM Control of RGB lighting: As shown in this write-up, you can power multi-colored LED strips using a power NPN transistor or N-Channel MOSFET. While you can do this with a single LED using a microcontroller directly, by varying PWM signals, transistors cause this action to be multiplied. This controls the current necessary to power a full strip of LEDs, incrementally taking them to full brightness all the way to an off state. Another alternative is programmable RGB LEDs, which are able to interpret digital signals on each module individually. This gives a huge amount of control, and lets you forgo using individual transistors to switch the power outputs. On the other hand, each RGB LED module uses tiny transistors to control brightness of each element, reinforcing the idea that nearly all electronics use them in one form or another.

 

  • Relay Control for Extreme Loads: Relays perform a similar function to transistors, allowing a separate electrical signal to be controlled by an output. As noted here, while they can sometimes be controlled by a microcontroller directly, they can require current to operate that’s at the fringes or out of the range that these chips can handle. Transistors are used to multiply the microcontroller signal controlling the relay, which can then switch an even larger load. While transistors and relays are interchangeable in some situations, relays present some unique pros and cons. They can entirely isolate one circuit from another, meaning if you have a device you know nothing about and simply want to substitute a relay output for a button, you can do this. They can’t switch as fast as transistors, however, making them inappropriate for PWM control in most situations.

 

  • Audio Amplifier: Perhaps the most common usage for the word “transistor” in modern—or perhaps recent past—vernacular is as part of the term “transistor radio.” While they are used in many other applications today, using transistors instead of vacuum tubes to amplify audio signals, allowed radios to become portable and work with much less power than the vacuum tube models that came before. As noted in this article, you can build an audio amplifier with only six components, taking a low-power signal from an MP3 player, and amplifying it for use on desktop speakers.

Of course, this is just an extremely small sampling of what can be done with these amazing devices. While they can be great for enhancing the abilities of microcontroller projects, even if you never dabble in them directly, it’s great to have a basic understanding of this technology that literally provides the brains for our connected world.

Zach Wendt and Jeremy S. Cook are engineers who write about how electronic components can best be applied in projects. Zach, with Arrow Electronics, has a background in consumer product development. Jeremy has worked in manufacturing automation and writes for a variety of technical publications. You can learn more about microcontrollers here.

You Might Also Like

Filed Under: Uncategorized

Primary Sidebar

EE Engineering Training Days

engineering

Featured Contributions

Five challenges for developing next-generation ADAS and autonomous vehicles

Robust design for Variable Frequency Drives and starters

Meeting demand for hidden wearables via Schottky rectifiers

GaN reliability milestones break through the silicon ceiling

From extreme to mainstream: how industrial connectors are evolving to meet today’s harsh demands

More Featured Contributions

EE Tech Toolbox

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“ee
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.
“bills

R&D World Podcasts

R&D 100 Episode 10
See More >

Sponsored Content

Advanced Embedded Systems Debug with Jitter and Real-Time Eye Analysis

Connectors Enabling the Evolution of AR/VR/MR Devices

Award-Winning Thermal Management for 5G Designs

Making Rugged and Reliable Connections

Omron’s systematic approach to a better PCB connector

Looking for an Excellent Resource on RF & Microwave Power Measurements? Read This eBook

More Sponsored Content >>

RSS Current EDABoard.com discussions

  • MOSFET thermal noise in Weak vs Strong inversion
  • High Side current sensing
  • Xiaomi Mijia 1C Robot problem of going backwards while working
  • Multiple DC/DC converters and a single input source
  • Will this TL084C based current clamp circuit work?

RSS Current Electro-Tech-Online.com Discussions

  • Curved lines in PCB design
  • using a RTC in SF basic
  • Parts required for a personal project
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz
  • PIC KIT 3 not able to program dsPIC
Search Millions of Parts from Thousands of Suppliers.

Search Now!
design fast globle

Footer

EE World Online

EE WORLD ONLINE NETWORK

  • 5G Technology World
  • Analog IC Tips
  • Battery Power Tips
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • Electro-Tech-Online Forums
  • Engineer's Garage
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

EE WORLD ONLINE

  • Subscribe to our newsletter
  • Teardown Videos
  • Advertise with us
  • Contact us
  • About Us

Copyright © 2025 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy