Choosing the right NPN Transistor

Hi,

I am having trouble choosing the right NPN transistor. I want to turn on a LCD display with voltage of 5v and current of 150 mA).
The arduino output pin is 5v with max current of 15mA so i figured out the best way is use a NPN transistor but how do i choose the right one?

Can i use for example a NPN C1815 with a voltage of 50 and current of 150?

Regards
Bart

Use a P channel MOSFET high side switch.
Or
You could use a low current relay driven by your transistor.

https://www.jameco.com/z/NA-5W-K-Fujitsu-5-Volt-178-Ohm-Double-Pole-Double-Throw-Relay_2202360.html

The right NPN transistor is usually a FET. :grinning:

But an NPN transistor or N-channel FET must switch the low - cathode - side of your LCD display illumination (the LED itself, not the display driver).

You need to explain what display you are using, and how you propose to connect this.

Hey:
MOSFET act as a switch, where commonly seen NMOS act as a grounding switch - When it is off, the component floats, hence no voltage difference and it is off. When it is on, the component is grounded on GND, therefore creating a voltage difference for the component to be turned on.
So I suppose you can connect everything you want to connect to ground in the LCD to the drain of the mosfet, and use a arduino to turn it on and off.
But if you mean NPN transistors ... there are heaps, to be honest. A good way I usually go when I am finding components is go on the website of a company called RS and use filter to search for desired part.
Hope this helps
Cheers

Switching a display off while the signal lines are still driven can give very nasty effects, including broken I/O pins (on both the display and the Arduino trying to control it). That's something to be aware of.

Many devices have an "enable" pin, which if available should be used instead.

Well, if he ever comes back to explain what he is trying to do (read as: XY problem), we could help him, but it may be just another "one-hit wonder". :roll_eyes:

Otherwise not worth talking to /dev/null. :astonished:

Trying to avoid the xy problem as Paul mentoined I will try to restate the base question:

"How to choose the right transistor for controlling object A (which uses more current) through a GPIO (which can give less current).

I have done some research about the principles of transistors but I am missing some basic info i guess.

If someone knows a good basic tutorials, please share.

You probably need a PNP one. Or p-channel MOSFET. For high-side switching. Depending on the actual voltages you switch, you may ALSO need an NPN one.

Which type you need depends on:

  • the current switched (you mentioned 150 mA).
  • the voltage switched (you mentioned 5V, I assume DC).
  • the actual device that's switched (an LCD display, type unspecified).
  • high or low side switching, largely dependent on what is being switched, and sometimes on why and when it's being switched.
  • what other connections that device has with the rest of the projects (unspecified; presumably data connections as it's an LCD display).

Step 1: decide HOW you're going to switch it (high or low side), and what type of transistor you want to use (BJT or MOSFET usually).
Step 2: open your parts box and see if you have anything that fits the bill.
Step 3: search for suitable part, using e.g. the parts selector of Digikey.
When you settle on a specific part, check the data sheet to see if it really is suitable.

And, as I mentioned already, if that device has an enable pin, that's normally the best way of powering it down.

WHY do you want to switch an LCD display off.
Current draw?
The LED behind the LCD probably uses most of it, so why not just switch the LED off.
The (unspecified) LCD could already have a LED transistor switch buildin.
Leo..

"How to choose the right transistor for controlling object A (which uses more current) through a GPIO (which can give less current).

As you have likely read, the in general most folks find an MosFet a more desirable choice than a BJT (transistor). Why....

  • A Mosfet can mimic a switch to ground with lower voltage across it when on than a transistor.
  • A Mosfet takes nearly no current to control, where as a transistor used as a switch required ~ 1/10 of the current being controlled to be provided from the µP output pin.

So to answer your question, you start with the requirements:

  1. how much current do you wish to control. This will help chose a specific part.
  2. are you trying to switch to ground or to +V
  3. If trying to switch to +V, is the voltage you are trying to control higher than the arduino voltage?

BartArien:
Trying to avoid the xy problem as Paul mentoined I will try to restate the base question:

"How to choose the right transistor for controlling object A (which uses more current) through a GPIO (which can give less current).

So you are making the problem worse by wanting to generalise. :roll_eyes:

Start by answering Wawa's questions, and give us Web links to the display you have.

I am using a standard 2x 16 LCD screen without I2C module as on Assembled Standard LCD 16x2 + extras - White on Blue : ID 1447 : $10.95 : Adafruit Industries, Unique & fun DIY electronics and kits
i want to be able to switch the screen off (with a button) because I only need to check the display once a week

I found out that with this lcd the LED BACKLIGHT draws 100 mA

Wow, that's a turbo-backlight you got installed! They normally draw only about 10 mA.

Just about any small signal NPN transistor such as the BC547 will do fine for this application.

BartArien:
I am using a standard 2x 16 LCD screen without I2C module as on Assembled Standard LCD 16x2 + extras - White on Blue : ID 1447 : $10.95 : Adafruit Industries, Unique & fun DIY electronics and kits
i want to be able to switch the screen off (with a button) because I only need to check the display once a week

Put the button in the 5 V line?

BartArien:
I found out that with this LCD the LED BACKLIGHT draws 100 mA

That is certainly what the datasheet suggests, and is somewhat unusual. But this display is - according to the datasheet - completely different to the "1602" displays with which we are familiar, to the extent that I suspect the datasheet is nothing more than a very bad counterfeit of a different company's product with many nonsensical errors.

It specifies the "Supply current for logic" as typical 120, maximum 150 mA. The HD44780 chip and presumably its clones, is specified at 150 typical, 300 maximum μA - that is microamps. This specification in the datasheet is surely not correct. Even if it included not only the logic, but the combined current for LED illumination as well, that would suggest the chip is drawing 20 to 50 mA.

It then illustrates the contrast potentiometer as 20 to 50k, and shows it connected to VDD (5 V) as well as VSS (ground). Now this latter is a stupid blunder you will find just about everywhere these displays are cited, so that is not entirely surprising; it means the people publishing devices and projects actually have no idea whatsoever as to how the LCD works (which is explained in the original HD44780 datasheet). The point is that you should not connect the potentiometer to 5 V, only to ground; it must be wired as a variable resistor rather than a potentiometer and as such, its value should be about 1k. If it is 10k and wired as a potentiometer, it will be usable only over one twentieth of its range and a 50k potentiometer will function only at the ground hundredth end of its range; virtually useless, you may as well just connect Vo (pin 3) to ground (which usually works, but not optimally).

What else could possibly be wrong? :roll_eyes: Well, it cites in "INTERFACE PIN FUNCTIONS" that
Pin 15 LED+ +5.0V Power supply for backlight.
Pin 16 LED- 0V The backlight ground.
... but warns: "NOTE: Do not connect +5V directly to the backlight terminals. This will ruin the backlight."

wvmarle:
Wow, that's a turbo-backlight you got installed! They normally draw only about 10 mA.

Well, no. With the "R8" being "101" or 100 Ohms, it is actually about 24 mA for the backlight. But that is within the switching capabilities of a common Arduino output pin.

wvmarle:
Just about any small signal NPN transistor such as the BC547 will do fine for this application.

Indeed. Once you have figured out the value for the backlight resistor - 0.9V /100 mA = 9.1 (or 10) Ohms - then to control the backlight only you can switch the cathode of the backlight on pin 16 with a common transistor.

With the usual version of the 1602 display requiring only 300 μA plus the contrast ladder, the display logic could be switched on and off directly by an Arduino pin with no trouble at all. If you use the correct wiring of the contrast resistor to ground only, then the 11k contrast ladder will draw only 455 μA, so a total easily less than 1 mA - generally not worth switching off (and so avoiding the dangers of "phantom powering") as long as you switch off the backlight.

But that is not what that datasheet seems to claim. If you have the Adafruit display, you perhaps need to make the measurements yourself to see if the datasheet tells the truth - it should not. :astonished: Put a 100 Ohm resistor in series with the backlight and see what current it draws and what voltage appears across it.